Date: Oct 10, 2013 2:21 AM Author: Albert D. Rich Subject: Re: The A. F. Timofeev symbolic integration test suite On Sunday, October 6, 2013 6:44:47 AM UTC-10, clicl...@freenet.de wrote:

>> I did make the optimal results for examples #16 and #56 continuous as

>> you suggested. However, all the systems tested, except Derive, return

>> the more compact, but discontinuous antiderivative. Note that even

>> Derive returns the discontinuous form when single-stepping through the

>> integration. Currently, I am being lenient (and perhaps unfair to

>> Derive) and giving full credit to all the systems for these two

>> examples. Do you concur with this grade?

>

> I always suspected that Derive wants to keep some of its secrets from

> the competition! And I am not glad to hear that Rubi no longer returns

> continuous antiderivatives for this type of integrand - but I suppose

> that's easily put back in. Otherwise I concur absolutely.

Derive does not intentionally keep secret its method of finding continuous antiderivatives, and having Rubi generate continuous ones is nontrivial. Unfortunately the information required to achieve continuity is lost when single-stepping through the integration, so Derive is only able to return a discontinuous antiderivative.

Discontinuous antiderivatives often result when the substitution u=tan(theta) or u=tan(theta/2) is used to integrate trigonometric expressions. The algorithm Derive uses to make such antiderivatives continuous involves taking the difference of two limits to find the piecewise constant function required to achieve continuity. It is described in the 1994 paper I co-authored with D.J. Jeffrey ?The Evaluation of Trigonometric Integrals Avoiding Spurious Discontinuities? at http://www.apmaths.uwo.ca/~djeffrey/Offprints/toms1994.pdf. The 1994 Jeffrey paper ?The Importance of Being Continuous? at http://www.apmaths.uwo.ca/~djeffrey/Offprints/importan.pdf describes how to merge this piecewise constant term with the discontinuous inverse tangent term to obtain the desired optimal results for examples #16 and #56 in Chapter 1 of Timofeev?s book.

However this messy algorithm is not appropriate for an elegant, rule-based system; and it requires the host CAS provide a strong limit package and good algebraic simplification. So I was delighted to discover the following identity that makes it easy to transform discontinuous antiderivatives into continuous ones:

If g(x) = arctan(a*tan f(x)) and h(x) = f(x) - arctan(cos f(x)*sin f(x) / (a/(1-a) + cos f(x)^2), then g?(x) = h?(x).

Note that g(x) is discontinuous whenever f(x) mod pi equals pi/2. But if a>0 and f(x) is real, then the denominator a/(1-a)+cos f(x)^2 is never zero and so h(x) is continuous. And since the derivatives of g(x) and h(x) are equal, discontinuous terms in antiderivatives of the form g(x) can be replaced by continuous ones of the form h(x), thus resulting in antiderivatives continuous on the real line.

There are analogous identities for inverse tangents of cotangents, and inverse cotangents of tangents and cotangents. Also I have generalized the identity to handle discontinuous antiderivatives of the form arctan(a+b*tan f(x)). I leave this generalization as an exercise for intrepid readers...

The next release of Rubi will take advantage of these identities to produce continuous trig antiderivatives, thereby making the computation of definite integrals easy and reliable.

Albert