First separate variables and plug back into the original equation.
Find the separated boundary conditions (worry about the initial condition later).
Now seperate the two functions on either side of the equation. The reasoning is that if the left side is a function of and it is equal to the right side, which is a function of , then both sides of the equation must be equal to a constant. It's good to keep higher derivatives on top of lower ones, and keep the with . When setting the next part equal to a constant, works best.
This gives the two solutions to the ODEs:
In the solution of the extra square root of was added in the denominator so that we won't have to make a special case for , which does not give interesting solutions anyway.
Use the separated boundary conditions on the function .
Nothing interesting would come from letting , so . because . These values of lambda are the eigenvalues. The eigenfunctions are .
For each value of n, a solution is then
Using the principle of superposition, the formal solution is the sum of all possible solutions:
The initial condition gives
This series is the Fourier sine series of , so the coefficient is given by
So the final answer is
Or just for fun: