We are given:
$$\tag 1 f(x) = x^3$$
Legendre
Note: see my response here for the Legendre approach.
Using the method from the referenced approach, we find:
$$\tag 2 f(x) = x^3 = c_0P_0(x) + c_1P_1(x) + c_2P_2(x) = \frac{3}{5}P_1(x) + \frac{2}{5} P_3(x)$$
Please note that $(2)$ only has a finite number of terms as mentioned in the problem statement.
Fourier Sine Series
Note that since $f(-x) = -f(x)$, $(1)$ is an odd function and that is very helpful!
If a function is odd, then $a_n = 0$ and the Fourier sin series collapses to:
$$f(x) = \sum_{n=1}^\infty b_n~\sin(n x)$$
where
$$b_n = \frac{2}{\pi} \int_0^{\pi} f(x)~\sin(n x)~dx$$
However, the question wants us to extend the range to $L$, so we have:
$$b_n = \frac{2}{L} \int_0^{L} f(x)~\sin(\frac{n \pi x}{L})~dx$$
Lets calculate these terms:
$\displaystyle b_1 = \frac{2}{L} \int_0^{L} x^{3}~\sin(\frac{1 \pi x}{L})~dx = \frac{2 (\pi^2-6) L^3}{\pi^3}$
$\displaystyle b_2 = \frac{2}{L} \int_0^{L} x^{3}~\sin(\frac{2 \pi x}{L})~dx = -\frac{(2 \pi^2-3) L^3}{2 \pi^3}$
$\displaystyle b_3 = \frac{2}{L} \int_0^{L} x^{3}~\sin(\frac{3 \pi x}{L})~dx = \frac{2 (3 \pi^2-2) L^3}{9 \pi^3}$
$\ldots$
$\displaystyle b_n = \frac{2}{L} \int_0^{L} x^{3}~\sin(\frac{n \pi x}{L})~dx = -\frac{2 L^3 (\pi n (\pi^2 n^2-6) \cos(\pi n)-3 (\pi^2 n^2-2) \sin(\pi n))}{(\pi^4 n^4)}$
Please note that the Fourier sin series has an infinite number of terms as mentioned in the problem statement.
In the context of separation of variables, why is it important to understand both of these very different-looking series representations of a function?
Update to the last question
We have now written two very different ways to solve this problem (function). The first, based on the Legendre polynomials, provided a closed form solution, while the second is based on an infinite series Fourier analysis. These can aid us with different perspectives to solve separation of variable problems.
These two solutions are merely two facets of the same solution. The Fourier series formula shows how every piece-wise component of the solution can be decomposed into its constituent parts, while the Legendre approach demonstrates how all the components combine into a single solution.
Mathematically, both of these provide us with the ability to look at behaviors from a different perspective and are both very useful to analyze the behavior of the function (globally or component wise) and provide another tool in our tool-box for qualitative and quantitative analyses (do they converge, how fast, how large is the error $\ldots$).
Regards
This post imported from StackExchange Mathematics at 2014-06-01 19:35 (UCT), posted by SE-user Amzoti