Stavros Macrakis wrote:
> Maxima has the tools for calculating these integrals, but sadly doesn't
> handle these cases directly:
>
> ex: 1/ ( (x-a)*(x-b)*sqrt(1-x^2) )
> ... integrate(ex,x) => nounform
> but
> ... integrate(partfrac(ex,x),x) => reasonable solution (with a couple of
> questions)
>
> ex: 1/ ( (x-1)*(x+1)*sqrt(1-x^2) )
> ... integrate(ex,x) => nounform
> ... integrate(radcan(ex),x) => nounform
> ... integrate(factor(radcan(ex)),x) => nounform
> but
> ... integrate(partfrac(ex,x),x) => reasonable solution
> ... integrate(ratsimp(ex),x) => reasonable solution
>
As a matter of fact, this integral is a particular case of
integrals of the form
int R(x,y) dx
where R(x,y) is a rational expression of x and y, and y is
related to x by a polynomial equation
P(x,y)=0
These are so--called Abelian integrals, and there are ways to
express tham in terms of canonical forms. For example there
is a discussion of that stuff in Goursat mathematic lectures.
In principle the Risch algorithm should be extended to handle such
cases, but i don't think it does in any CAS at present.
The particular case where P(x,y)=y^2 - P4(x) where P4 is a polynomial
in x of degree 4 (or 3) corresponds to elliptic integrals, and even that
is not present in Maxima, while it appears in maple and mathematica.
In our case one has P(x,y)=y^2+x^2-1, that describes a circle. A circle can
be paramatrized rationnally (as any genus 0 curve) so that any integral
of the above form reduces to the integral of a rational function, which
using parfrac can be compute in terms of rational functions and logarithms.
(In other words using the tangent of the half angle rationalizes the
expression).
The Risch algorithm, even in its most basic form should be able to produce
the value of this integral. Both maple and mathematica give an answer, even
if it is very complicated. The fact that it doesn't in maxima is a bug.
In the present instance one has a definite integral (extending exactly
on a branch cut). It may be that maxima tries to use contour methods to
compute this definite integral, and it may be also that the result is
incorrect. Anyways it is very poorly simplified, since in my %o2, one has
log(2-4a)=log(2)+log(1-2a), and the log(2) term completely cancels.
I suspect that the log(1-2a) term is very strange. The expression in %o3
seems much more plausible, but even here, a factor 2 should be simplified.
A few tries with maple seem to confirm this expression:
> int(1/(x-2)*1/sqrt(1-x^2), x=-1..1);
1/2
Pi 3
- -------
3
> int(1/(x-3)*1/sqrt(1-x^2), x=-1..1);
bytes used=112010572, alloc=6814496, time=8.50
1/2
Pi 2
- -------
4
For -1<a<1 there is clearly a pole in the integration domain, and maple
says that the integral is undefined. Maxima says that one can evaluate the
integral through a principal part prescription, which is reasonable. It
seems also reasonable that the value is then the analytic continuation of
the value for a>1 which maxima result is definitely not.
--
Michel Talon