# Heat Equation: Separation of Variables - Can't find solution

I am trying to solve the following problem on $$[0,\pi]$$ through separation of variables:
$$u_t=u_{xx}$$
$$u(x,0)=x^3\space (1)$$
$$u(0,t)=0\space (2)$$
$$u(\pi,t)=\pi^3\space (3)$$
So far I have come to the conclusion that the separation constant $$\lambda=-k^2<0$$. This led me to the solution $$u(x,0)=(\sum_{n=0}^\infty A_n\cos(k_nx)+\sum_{n=0}^\infty B_n\sin(k_nx))(\sum_{n=0}^\infty C_ne^{-k_n^2t})$$.
From (1) it follows that $$\sum_{n=0}^\infty A_n\cos(k_nx)+\sum_{n=0}^\infty B_n\sin(k_nx)=x^3$$, which can be realised by constructing the Fourier Series of $$x^3$$, which is $$\sum_{n=0}^\infty b_n\sin(nx)$$. I computed $$b_n$$ but it would take up too much unnecessary space.
It follows from this that (1) is met if we set $$A_n=0$$, $$B_n=b_n$$ and $$k_n=n$$. Then we have $$u(x,0)=(\sum_{n=0}^\infty b_n\sin(nx))(\sum_{n=0}^\infty C_ne^{-n^2t})$$This indeed makes (2) true, but $$u(\pi,t)$$ also becomes $$0$$. I don't see how this can be resolved. Did I make an error earlier on?

• This is an inhomogeneous problem so you cannot use Separation of Variables to solve it.
– user610336
Mar 12, 2019 at 18:55
• So... if the problem specifically states that I should use the method of separation of variables, the correct solution is: "No solution can be obtained through this method."? Mar 12, 2019 at 18:59
• You may try method of shifting the data
– user610336
Mar 12, 2019 at 19:04
• That seems like a highly nontrivial method that is not within the scope of my course, but I will give it a try, thanks. Mar 12, 2019 at 19:18
• It should not be so hard because the BC of your problem is simple
– user610336
Mar 12, 2019 at 19:21

Let $$v(x,t)=u(x,t)-\pi^2 x$$. Then $$v$$ will satisfy $$v_t = v_{xx} \\ v(x,0) = u(x,0)-\pi^2 x = x^3-\pi^2 x \\ v(0,t) = u(0,t)-\pi^2 0 = 0 \\ v(\pi,t) = u(\pi,t)-\pi^3 = 0.$$ This equation is solved by $$v(x,t)=\sum_{n=1}^{\infty}A_n e^{-n^2\pi^2 t} \sin(n\pi x)$$, where the constants $$A_n$$ are chosen to satisfy $$\sum_{n=1}^{\infty}A_n \sin(n\pi x)=x^3-\pi^2 x$$. The constants $$A_n$$ are uniquely determined by the mutual orthogonality of the $$\sin(n\pi x)$$ functions. Finally, $$u(x,t)=v(x,t)+\pi^2 x$$.

• That's a very neat solution, thanks. Mar 13, 2019 at 10:00
• @user569579 : It is a very neat trick that I learned in my course on PDEs. :) Mar 13, 2019 at 13:52