How can I use these boundary conditions to find a solution to this initial value problem to the heat equation?

75 Views Asked by At

I am currently trying to solve a heat-equation problem where I am required to solve the PDE $$ u_t = u_{xx} $$ subject to the following boundary conditions $$ u(0,t) = u(1,t) = 0, \hspace{20 mm} u(x,0) = \cases{x \hspace{13 mm} \text{ if } \hspace{6 mm} 0<x<\frac{1}{2} \\ 1-x \hspace{5 mm} \text{ if } \hspace{5 mm} \frac{1}{2} < x < 1}. $$

Assuming that our solution can be expressed in the form $u(x,t) = X(x)T(t)$, I have deduced (using the first boundary condition) that the only non-trivial solution for $X$ is $X(x) = Be^{\gamma x} \sin(n \pi x)$ where $B$ is a constant to be found, $\gamma$ is arbitrary and $n \in \mathbb{Z}$. I have also deduced that the solution for $T$ is of the form $T(t) = e^{\lambda t}$ for some unknown constant $\lambda$.

So, the solution is of the form $$ u(x,t) = Be^{\gamma x} \sin(n \pi x) \cdot e^{\gamma t}. $$

I'm now unsure of how to proceed using the second boundary condition. To apply it gives $$ u(x, 0) = Be^{\gamma x} \sin(n \pi x) = \cases{x \hspace{13 mm} \text{ if } \hspace{6 mm} 0<x<\frac{1}{2} \\ 1-x \hspace{5 mm} \text{ if } \hspace{5 mm} \frac{1}{2} < x < 1}. $$

But I cannot see how to find the solutions to this system.

Can anyone help me to find a solution to this PDE?