Web Analytics

Verified Answer :

Assuming you want the cosine series expansion over an arbitrary symmetric interval \([-L,L]\), \(L eq0\), the cosine series is given by

\(f_C(x)=\dfrac{a_0}2+\displaystyle\sum_{n\ge1}a_n\cos nx\)

You have

\(a_0=\displaystyle\frac1L\int_{-L}^Lf(x)\,\mathrm dx\)
\(a_0=\dfrac1L\left(\dfrac{x^2}2-\dfrac{x^3}3\right)\bigg|_{x=-L}^{x=L}\)
\(a_0=\dfrac1L\left(\left(\dfrac{L^2}2-\dfrac{L^3}3\right)-\left(\dfrac{(-L)^2}2-\dfrac{(-L)^3}3\right)\right)\)
\(a_0=-\dfrac{2L^2}3\)

\(a_n=\displaystyle\frac1L\int_{-L}^Lf(x)\cos nx\,\mathrm dx\)

Two successive rounds of integration by parts (I leave the details to you) gives an antiderivative of

\(\displaystyle\int(x-x^2)\cos nx\,\mathrm dx=\frac{(1-2x)\cos nx}{n^2}-\dfrac{(2+n^2x-n^2x^2)\sin nx}{n^3}\)

and so

\(a_n=-\dfrac{4L\cos nL}{n^2}+\dfrac{(4-2n^2L^2)\sin nL}{n^3}\)

So the cosine series for \(f(x)\) periodic over an interval \([-L,L]\) is

\(f_C(x)=-\dfrac{L^2}3+\displaystyle\sum_{n\ge1}\left(-\dfrac{4L\cos nL}{n^2L}+\dfrac{(4-2n^2L^2)\sin nL}{n^3L}\right)\cos nx\)