With the same purpose as this question, I wish to evaluate an integral that contains the squared Legendre Polynomials.
$\int_{-1}^{1}\left[P_n(x)\right]^2dx=\frac{2}{2n+1}$
I tried evaluating with no success: Assuming[{
$n$$\in$Integers,n
$\geq$0},
$\int_{-1}^{1}$LegendreP[n,x]
$^2$dx]
Assuming[{Element[n, Integers], n >= 0},
Integrate[LegendreP[n, x]^2, {x, -1, 1}]]
It seems odd that Mathematica wouldn't natively consider doing this, because Wolfram has specified the relationship on mathworld.wolfram.com - See Eqn(28)
.
I am not familiar with the backend processes of Mathematica, however I would expect a check to be performed when integrating with Legendre Polynomials.
Why is this not the case, and is there any alternative for an algebraic solution?
Edit: Example
An example of where this may be used is in solving an ODE that is a Sturm-Liouville System, and is very close in relation to the Legendre DE:
$([1-x^2]u')' + \mu \rho(x) u = f(x)$
Both when $\mu=\lambda_n$ and $\mu\neq\lambda_n$ for some n, the solution for u(x) will involve series coefficients $\gamma_n$: $\gamma_n = \frac{\int_{-1}^{1}f(x) u_n(x)dx}{\int_{-1}^{1}\rho(x)u_n(x)^2dx}$
Here for the Legendre SL system we know there are eigenfunctions $u_n = $ LegendreP[n,x]. The evaluation I considered will be used in the denominator when calculating such series coefficients.
Answer
Generate a sequence using Table
then use FindSequenceFunction
to find the general form
f[n_] = FindSequenceFunction[
Table[Integrate[LegendreP[n, x]^2, {x, -1, 1}], {n, 10}], n]
(* 2/(1 + 2 n) *)
Checking outside the original range
f[n] == Integrate[
LegendreP[n, x]^2, {x, -1, 1}] /. {{n -> 20}, {n -> 50}}
(* {True, True} *)
Comments
Post a Comment