Chapter 12 Problem 9.1
Expand the following function into Legendre series.
f(x)={−11−1<x<00<x<1
Solution: We need to compute
cn=22n+1∫−11f(x)Pn(x)dx
Then we can find that
f(x)≈n=0∑∞cnPn(x).
To evaluate the integral, we will use the Rodrigue formula, which says
Pn(x)=2nn!1dxndn(x2−1)n.
Let's use this and apply integration by part
∫−11f(x)Pn(x)dx=−∫−10Pn(x)dx+∫01Pn(x)dx=2nn!1[−dxn−1dn−1(x2−1)n∣−10+dxn−1dn−1(x2−1)n∣01]=2nn!1(−2)dxn−1dn−1(x2−1)n(0)
In one of the steps, we used
dxn−1dn−1(x2−1)n equals 0 when x=±1.
Now, we need to figure out, what is dxn−1dn−1(x2−1)n(0). This is looking for xn−1's coefficient in (x2−1)n. Thus, we see this is only nonzero if n−1=2m is an even number. That would be the binomial coefficient of (x2−1)n's m-th term
(x2−1)n=(x2)n+(n−1n)(x2)n−1(−1)1+⋯+(mn)(x2)m(−1)n−m+⋯
Hence, we have (using n−1=2m)
(d/dx)2m(x2−1)n(0)=(2m)!(mn)(−1)n−m=(2m)!(m2m+1)(−1)m+1
Hence, we get, for n=2m+1)
∫−11f(x)Pn(x)dx=2nn!1(−2)(2m)!(m2m+1)(−1)m+1=22m(2m+1)(−1)m(m2m+1)
All in all, we have coefficient
cn=22n+1⋅{022m(2m+1)(−1)m(m2m+1)n even n=2m+1
By the way, if you can find the first few terms, that would be enough.