TransWikia.com

Integration of LegendreP

Mathematica Asked on March 13, 2021

I am trying to integrate a product of 2 Legendre polynomials as follows:

Integrate[LegendreP[1, x] LegendreP[2l+1, x], {x, -1, 1}]

I get the result:

Sin[2 l [Pi]]/(l (3 + 2 l) [Pi])

which is always 0 for integer values of l, but shouldn’t the result be 0 for $2l+1neq1$ and 2/3 for $2l+1=1$, since the LegendreP are orthogonal?

4 Answers

Look at

Table[Sin[2 l [Pi]]/(l (3 + 2 l) [Pi]), {l, -2, 2}]

and then try

Limit[Sin[2 l [Pi]]/(l (3 + 2 l) [Pi]), l -> 0]

Answered by Andreas on March 13, 2021

Note that sometimes a general result is returned. Think of:

Integrate[x^p,x]

returns:

x^(1+p)/(1+p)

However,

Integrate[x^-1, x]

gives:

Log[x]

But that is not represented by the general result…

Answered by SHuisman on March 13, 2021

Add Assumptions by hand or calculate the Limit

Integrate[LegendreP[1, x] LegendreP[2 l + 1, x], {x, -1, 1}, 
 Assumptions -> l == 0]
Limit[Integrate[LegendreP[1, x] LegendreP[2 l + 1, x], {x, -1, 1}], 
 l -> 0]
Integrate[LegendreP[1, x] LegendreP[2 l + 1, x], {x, -1, 1}, 
 Assumptions -> 3 + 2 l == 0]
Limit[Integrate[LegendreP[1, x] LegendreP[2 l + 1, x], {x, -1, 1}], 
 l -> -(3/2)]

Answered by cvgmt on March 13, 2021

Clear["Global`*"]

Use Piecewise to handle the special case.

f[l_, x_] = 
 Piecewise[{{Integrate[LegendreP[1, x] LegendreP[2 l + 1, x], {x, -1, 1}], 
    ll != 0}, {Integrate[LegendreP[1, x] LegendreP[1, x], {x, -1, 1}], 
    l == 0}}]

enter image description here

Simplify[f[l, x], Element[l, Integers] && l != 0]

(* 0 *)

Answered by Bob Hanlon on March 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP