Re: Simple integral over special functions---HOW?
- To: mathgroup@smc.vnet.net
- Subject: [mg12619] Re: Simple integral over special functions---HOW?
- From: Paul Abbott <paul@physics.uwa.edu.au>
- Date: Tue, 26 May 1998 02:38:19 -0400
- Organization: University of Western Australia
- References: <6kakon$2em@smc.vnet.net>
Hi Michael:
> I have repeatedly run into trouble trying to get Mathematica to
> evaluate analytically simple integrals involving special functions. For
> example, the following integral has a simple analytic form:
> Integrate[LegendreP[n,x]/Sqrt[1-x^2],{x,-1,+1}] When I enter the
> above into Mathematica, it returns the integral unevaluated unless I
> specify a value for n. Figuring that the problem was that Mathematica
> didn't realize that n is a non-negative integer, I did the following:
> n/: IntegerQ[n] = True;
> Integrate[LegendreP[n,x]/Sqrt[1-x^2], {x,-1,+1}, Assumptions ->
> n >= 0]
> Again, Mathematica returned the integral unevaluated, along with the
> assumption.
> It's as though the information that n is an integer in the Global`
> context doesn't get communicated to the Integrate command. Can anyone
> tell me (a) whether the above method fully specifies n as an integer in
> all such situations (I have other failures where function definitions
> seem unaware of such a specification) and if not, how to properly
> specify a symbol as an integer and (b) how to make Integrate evaluate
> integrals such as the example above?
In my opinion, the correct approach to this problem is to use generating
functions. This is probably how you would do such integrals by hand
(and it is the standard method taught in most quantum mechanics
textbooks). In Version 3.0 there is no real way to tell Integrate that
n is a non-negative integer (except through implictly computing the
integral via a generating function!). If such functionality is added
into Mathematica then I suspect that it will be through a generating
function technique.
A generating function for the LegendreP is 1/(Sqrt[1 - 2 x z + z^2].
The generating integral is then:
In[1]:= SetOptions[Integrate, GenerateConditions -> False];
In[2]:= Integrate[1/(Sqrt[1 - 2 x z + z^2] Sqrt[1 - x^2]), {x, -1, 1}]
Out[2]=
2 z 4 z
(Sqrt[------ + 1] EllipticK[-(--------)] +
2 2
z + 1 (z - 1)
2 z 4 z
Sqrt[1 - ------] EllipticK[--------]) /
2 2
z + 1 (z + 1)
2 2
(z - 1) 2
(Sqrt[---------] Sqrt[z + 1])
2 2
(z + 1)
The integrals (for arbitrary integral n) you want can be found if you
can extract from this expression the general term of the Taylor series.
(SeriesTerm in DiscreteMath`RSolve` is not capable of computing the
general term of this Taylor series). Here we compute the integrals for
n=0,1,..,12, which are the coefficients of z^n (all odd terms vanish):
In[3]:= % + O[z]^13
Out[5]=
2 4 6 8 10
Pi z 9 Pi z 25 Pi z 1225 Pi z 3969 Pi z Pi + ----- +
------- + -------- + ---------- + ----------- +
4 64 256 16384 65536
12
53361 Pi z 13
------------ + O[z]
1048576
Cheers,
Paul
____________________________________________________________________
Paul Abbott Phone: +61-8-9380-2734
Department of Physics Fax: +61-8-9380-1014
The University of Western Australia Nedlands WA 6907
mailto:paul@physics.uwa.edu.au AUSTRALIA
http://www.pd.uwa.edu.au/~paul
God IS a weakly left-handed dice player
____________________________________________________________________