First separate variables and plug back into the original equation.
Find the separated boundary conditions (worry about the initial condition later).
When seperating variables, it's good to keep higher derivatives on top of lower ones. 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. In this problem the sine term will disappear, but in general the extra part in the denominator is a good idea.
Use the separated boundary conditions on the function .
Nothing interesting would come from setting . So,
Then for each , a solution is
So the formal solution is the sum of all of these:
Now deal with the initial condition.
The series on the RHS is the Fourier cosine series for . Therefore, the coefficients are: