Use Duhamel principle to find inhomogenous solution to $u_t-u_{xx}=sin^2(x)$

245 Views Asked by At

Question as it appeared in the book: $$u_t-u_{xx}=sin^2(x) \quad 0<x<\pi, t>0$$ $$u(x,0)=\frac{\pi x}{2}\quad 0<x<\pi$$ $$u_x(0,t)=u_x(\pi,t)=0$$ The homogeneous solution of the above problem is given by $$u_h(x,t)=\sum_{n=0}^\infty C_n e^{-n^2t}cos(nx)$$ with $C_n=-2/n^2$ for odd n and $C_n=0$ otherwise. Use Duhamel principle to find the inhomogeneous solution.

Theory stated in book: For: $$u_t-ku_{xx}=f(x,t) \quad 0<x<l, t>0$$ $$u(x,0)=g(x)\quad 0<x<l$$ $$u_x(0,t)=u_x(l,t)=0$$ Duhamel principle: $$u(x,t)= S(t)g(x)-\int_0^tS(t-s)f(x,s)ds=u_h(x,t)+w(x,t) $$ $$u_h(x,t)+w(x,t)=\sum_{n=0}^{\infty}A_nX_n(x)e^{-kt\lambda_nt}+\int_0^t\sum_{n=1}^{\infty}B_n(s)X_n(x)e^{-kt\lambda_n(t-s)}$$ Where: $$A_n=\frac{<X_n,g(x)>}{<X_n,X_n>}$$ $$B_n=\frac{<X_n,f(s)>}{<X_n,X_n>}$$ My attempt: Taking n is odd,$\lambda_n=n^2$ and $k=1$ $$u(x,t)= \sum_{n=0}^\infty \frac{-2}{n^2}e^{-n^2t}cos(nx) +\int_0^{t}\sum_{n=0}^\infty B_n(s)e^{-n^2(t-s)}cos(nx) $$ $$B_n(s)=\frac{<cos(nx),sin^2(x)>}{<cos(nx),cos(nx)>}$$ $$<cos(nx),cos(nx)>=\frac{\pi}{2}$$ as n is odd and n>0 and $cos(x)$ is repeating $cos(nx)=cos(x)$ $$<cos(nx),sin^2(x)>=\int_0^{\pi}cos(x)sin^2(x)dx=[\frac{sin^3(x)}{3}]_0^{\pi}=0-0=0$$ $$B_n=0$$ $$u(x,t)= \sum_{n=0}^\infty \frac{-2}{n^2}e^{-n^2t}cos(nx) $$ I don't think this can be right as I can't see how you can get $u(x,0)=\frac{\pi x}{2}$. Any help would be greatly appreciated thank you.