Fourier-Legendre Series

Author

Eric W. Weisstein
January 4, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Calculus/Fourier-LegendreSeries.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Fourier-LegendreSeries.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

FourierLegendreA[f_,x_,n_]:=(2n+1)/2Integrate[LegendreP[n,x]f,{x,-1,1}]

Examples

sinx

FourierLegendreA[Sin[Pi x],x,n]

Factor[Table[FourierLegendreA[Sin[Pi x],x,n],{n,0,7}]]

a=Factor[Table[FourierLegendreA[Sin[Pi x],x,n],{n,1,7,2}]]

l=Reverse[NestList[Most,a.Table[LegendreP[n,x],{n,1,7,2}],3]];

Plot[Evaluate[{Sin[Pi x],Sequence@@l}],{x,-1.2,1.2},PlotRange->{-1,1}1.1,PlotStyle->{{Thickness[.01],Black},Violet,Blue,Green,Yellow,Red}]