[SciPy-User] How Do You Integrate Legendre Polynomials or high order?

Joseph Smidt josephsmidt at gmail.com
Mon Sep 21 20:20:22 EDT 2009


Hello,

   I need to integrate the integral  \int_-1^1 dx/2
P_l1(x)*P_l2(x)*P_l3(x) for 0 < l1, l2, l3 < 1000.  In case my write
up is confusing I believe this website makes it more clear:
http://en.wikipedia.org/wiki/3-jm_symbol#Other_properties

Here is my python code for one value of this integral:

------------------------------------------------------------------------------

from pylab import *
from scipy.integrate import quad
from scipy.special import legendre

a = quad(lambda x: 0.5*legendre(500)(x)*legendre(100)(x)*legendre(2)(x), -1, 1)

print a[0]

------------------------------------------------------------------------------

Anyways, Scipy can't seem to integrate this this way.  Does anyone
have any ideas how to calculate this integral in Python?  Thanks.

                                              Joseph Smidt

-- 
------------------------------------------------------------------------
Joseph Smidt <josephsmidt at gmail.com>

Physics and Astronomy
4129 Frederick Reines Hall
Irvine, CA 92697-4575
Office: 949-824-3269



More information about the SciPy-User mailing list