       Elliptic integral trouble in Mathematica...

• To: mathgroup at yoda.physics.unc.edu (Mathematica user group)
• Subject: Elliptic integral trouble in Mathematica...
• From: squash at msri.org (Jonathan King)
• Date: Mon, 9 Mar 92 17:53:06 PST

```Hello. Can you help me, or refer me to someone who can help, with the
following difficulty?

I'm hoping that a certain ratio of integrals, line In below, can be
expressed as an algebraic formula in "F" and "P", even though most
probably neither integral has an elementary antiderivative.

However, it appears that Mathematica is computing an erroneous
numerator.  Numerical integration, however, produces a more plausible
result.  However, it is the theoretical result that I need.

Jonathan King, squash at msri.org

================================================================
Mathematica 2.0 for SPARC
-- X11 windows graphics initialized --

In:= \$Version

Out= SPARC 2.0 (August 26, 1991)

In:= P = 1/2

1
Out= -
2

In:= F = 1/5

1
Out= -
5

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}]

4
Out= 2 EllipticK[-(--)]
25

In:= N[%]

Out= 3.02612

in:= (* Now do same integral numerically, directly.  A different value
will come out. *)

In:= NIntegrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}]

Out= 1.98604

In:= (* This is way off from "3.02612" up above.  Now I change the value of P. *)

In:= P = 99 / 100

99
Out= ---
100

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}]

400
100 EllipticK[-(----)]
9801
Out= ----------------------
99

In:= N[%]

Out= 1.57084

In:= NIntegrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}]

Out= 0.140156

In:= (* What I am actually interested in is the ratio below.
The numerator integrates from P to 1.  The denominator integrates
from 0 to 1.
Let's do it symbolically, then theoretically. *)

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}] /
Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,0,1}]

Out= 1

In:= (* Now, numerically. *)

In:= NIntegrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}] /
NIntegrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,0,1}]

Out= 0.0892241

In:= (* Way off. What to do?  Lets manually alter the limits of
integration. *)

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,P,1}]

400
100 EllipticK[-(----)]
9801
Out= ----------------------
99

In:= N[%]

Out= 1.57084

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,1/9,1}]

400
100 EllipticK[-(----)]
9801
Out= ----------------------
99

In:= N[%]

Out= 1.57084

In:= Integrate[1/Sqrt[(1-x^2)(P^2 + (F^2)x^2)], {x,8/9,1}]

400
100 EllipticK[-(----)]
9801
Out= ----------------------
99

In:= N[%]

Out= 1.57084

(* No change in result, even when I alter the lower limit from "1/9"
to "8/9".  Yet the integrand is strictly positive.  *)

```

• Prev by Date: Re: LatticeReduce
• Next by Date: Notebook Design
• Previous by thread: Integration of Gaussians
• Next by thread: Notebook Design