# check the solution of the initial-boundary value problem (diffusion equation)

Find the solution of the initial-boundary value problem

\begin{aligned} & u_t=3 u_{x x}, \quad 00 \\ & u(0, t)=0, u(4, t)=0 \\ & u(x, 0)=\sin 2 \pi x \cdot \cos 3 \pi x . \end{aligned}

By using solution formula $$u(x, t)=\sum_{n=1}^{\infty} A_n e^{-\left(\frac{n \pi}{4}\right)^2 3 t} \sin \frac{n \pi x}{4}$$ $$\sin u(x, 0)=\sin 2 \pi x \cdot \cos 3 \pi x$$ , by using trigonometric identities: \begin{aligned} & u(x, 0)=\frac{1}{2}(\sin 5 \pi x-\sin \pi x) \\ & =-\frac{1}{2} \sin \pi x+\frac{1}{2} \sin 5 \pi x \\ & A_4=-\frac{1}{2} \quad A_{20}=\frac{1}{2} \\ & u(x, t)=-\frac{1}{2} e^{-3 \pi^2 t} \sin \pi x+\frac{1}{2} e^{-75 \pi^2 t} \sin \pi x \end{aligned}

What coefficient should I use? $$A_1, A_5$$ or above and why? I was wondering whether my process is correct, can anyone help me to do a simple check?

• You should use $A_4$ and $A_{20}$. The $n$ in $A_n$ must be the same $n$ in $e^{-\left(\frac{n \pi}{4}\right)^2 3 t} \sin \frac{n \pi x}{4}$. (By the way, there is a typo in your solution: the last term should be $\frac{1}{2} e^{-75 \pi^2 t} \sin\color{red}{5} \pi x$.) Nov 5, 2023 at 6:13