Given $\cos(3x) = u(x,0)=\sum_{n=0}^{\infty}a_n\cos(2n+1)x,\quad\forall 0<x<\frac{\pi}{2}$
Hello !
So I have been a solving a PDE question and this is the final step, where I have applied initial condition to the general solution and I am face to face with the Fourier series. I have to find the the value of term $a_n.$ The book gives the answer that $a_1=1$ and $a_n=0,\quad\forall n = 0,2,3,4,5\ldots$
Following is my calculations so far :
$\cos(3x) =a_0\cos(x)+\sum_{n=1}^{\infty}a_n\cos(2n+1)x$
Since the series is Fourier cosine with $p=\frac{\pi}{2}$ we have $a_0, a_n$ are given by :
$a_0=\frac{1}{p}\int_{0}^{p} \cos(3x){\rm d}x$
$a_n=\frac{2}{p}\int_{0}^{p} \cos(2n+1)\cos(3x){\rm d}x$
I am solving both but answer for $a_0=-\frac{2}{3}\pi$ and I didn't solve for $a_n$ since $a_0$ is not equal to zero required as per answer in the book. Can any one guide me where I am making the mistake ?
By Werner's identities $$ \begin{split} 2\cos (\alpha) \cos (\beta)&=\cos (\alpha-\beta)+\cos (\alpha+\beta),\\ 2\sin (\alpha) \cos (\beta)&=\sin (\alpha-\beta)+\sin (\alpha+\beta), \end{split}$$ and the related prosthaphaeresis formulae $$\sin(\alpha\pm\beta)=\sin(\alpha)\cos(\beta)\pm\sin(\beta)\cos(\alpha), $$ we find $$\begin{split} \frac 4 \pi \int_0^{\pi/2} \cos(3x)\cos(kx)dx&= \frac 2 {\pi} \int_0^{\pi/2} \cos((3-k)x)dx+\frac 1 \pi\int_0^{\pi/2}\cos((3+k)x)dx \\ &=\frac 2 {\pi} \left[\frac 1 {k-3}\int_0^{\pi(k-3)/2}\cos(u)du+\frac 1{k+3}\int_0^{\pi(k+3)/2}\cos(u)du \right]\\ &=\frac 2 {\pi} \left[\frac {1} {k-3} \sin \left(\frac{\pi(k-3)}{2} \right)+\frac {1} {k+3} \sin \left(\frac{\pi(k+3)}{2} \right)\right]\\ &= \frac{2}{\pi} \left[\frac{2k \sin(k\pi/2)\cos(3\pi/2) - 6\sin(3\pi/2)\cos(k\pi/2)}{k^2-9} \right]\\ &= \frac{12}\pi \frac{1}{k^2-9} \cos\left(\frac{\pi k}{2} \right). \end{split}$$ Your book's notation is retrieved by setting $k=(2n+1)$; thus, the case $n=0$ corresponds to $k=1$, where the integral evaluates to $12/\pi \cdot \cos(\pi/2)/(-8) = 0$.
Observe that the singularity at $k=3$ is removable: by continuity, you can insert the value $$\lim_{k\to 3} \frac{12}{\pi} \frac{1}{k^2-9} \cos\left(\frac{\pi k}{2} \right) = 1. $$ This corresponds to the fact that $$\frac 4 \pi \int_0^{\pi/2} \cos^2(3x) dx = 1. $$