How to calc $\tilde{A}_n$ in $w\left(x,t\right)=\sum_{n=1}^{\infty }\tilde{A}_n\cos\left(nx\right)\cdot e^{\left(4-n^2\right)t}=\frac{1}{4}e^{4t}$?

23 Views Asked by At

The full problem goes as follows:

\begin{equation} \begin{cases} w_t=w_{xx}+4w \\ w\left(x,0\right)= \frac{1}{4}\\ w_x\left(0,t\right)= 0\\ w_x\left(\pi ,t\right)= 0 \end{cases} \end{equation}

Thanks to Fourier Method, I got (assuming that $w\left(x,t\right)=X\left(x\right)T\left(t\right)$):

$$X_n\left(x\right)=\tilde{A}_n\cos \left(nx\right)$$

and

$$T_n\left(t\right)=e^{\left(4-n^2\right)t}$$

Because $w\left(x,t\right)=\sum _{n=1}^{\infty }w_n\left(x,t\right)$ and $w_n\left(x,t\right)=X_n\left(x\right)T_n\left(t\right)$, we get:

$$w\left(x,t\right)=\sum _{n=1}^{\infty }\tilde{A}_n\cos \left(nx\right)\cdot e^{\left(4-n^2\right)t}$$

I've looked up in the solutions, and I definitely know that $w\left(x,t\right)=\frac{1}{4}e^{4t}$

But if I calculate here (using the w(x,0)=$\frac{1}{4}$ condition):

$$\tilde{A}_n=c_n=\frac{2}{\pi }\int _0^{\pi }\frac{1}{4}cos\left(nx\right)dx=\frac{\sin \left(n\pi \right)}{2n\pi }$$

I get

$$w\left(x,t\right)=\sum _{n=1}^{\infty }\frac{\sin \left(n\pi \right)\cos \left(nx\right)}{2n\pi }e^{\left(4-n^2\right)t} = 0 \text{ (according to WolframAlpha)}$$

So what am I doing wrong here?