I wish to solve $u_{tt} = u_{xx}, \; 0 < x < 1$ with the initial boundary conditions $u_x(0,t) = 0$, $(0 < t< \infty)$, $u_x(1,t) = 0$ and $u(x,0) = 0$, $0 \leq x \leq 1$, $u_t(x,0) = \cos(\pi x) + \cos(3\pi x)$.
So we assume $u(x,y) = X(x)T(t)$ and then get $u_x = X' T$, $u_{xx} = X''T$. Similarly, $u_t = X T'$ and $u_{tt} = X T''$.
So $\frac{X''}{X} = \frac{T''}{T} = \gamma$ for some constant $\gamma$. Now I form two ODEs $T'' - \gamma T = 0$ and $X'' - \gamma X = 0$. In solving the second ODE, the char. eq. is $\lambda^2 = \gamma$. Hence, $X(x) = Ax + B$, $(\gamma = 0)$, two real equal roots. And $X(x) = Ae^{\sqrt{\gamma}x} + Be^{-\sqrt{\gamma}x}$, $(\gamma > 0)$, real but unequal roots. And $X(x) = \cos(\sqrt{-\gamma}x) + B\sin(\sqrt{-\gamma}x)$, $(\gamma < 0)$, complex roots. Here $A,B$ are constants.
Now I want to solve for the constants $A,B$ by applying the boundary conditions. But how exactly is where I am stuck. Can anyone please assist with this?
Hint: Use the facts that \begin{align} u_x(0, t) =& X'(0)T(t)=0 \ \ \implies \ \ \ X'(0) =0,\\ u_x(1, t) =& X'(1)T(t)= 0 \ \ \implies \ \ \ X'(1) =0 \end{align} otherwise, your answer will be trivial. Use this to get constraints on $\gamma$.
Spoiler Hint:
Finally Hint: