How to solve a second order BVP with functions as boundary values? Problem:
$ u_{tt} = 16 u_{xx}, 0 \leq x \leq 1
\\u(0,t) = u(1,t) = 0, t \geq 0
\\u(x,0) = \sin(3 \pi x)
\\u_{t}(x,0) = x(1-x^2)
$
Attempt:
$u = X(x)T(t)
\\ X(x)T''(x)=16X''(x)T(t)
\\ \frac{X''(x)}{X(x)} = \frac{T''(t)}{16T(t)} = -\lambda $
I first got this general equation for X: $ X(x) = C_{1}\cos(\sqrt{\lambda} x) + C_{2}\sin(\sqrt{\lambda} x) $
Plugging in the initial conditions $u(0,t)$ and $u(1,t)$, I got $ X(x) = C\sin(n\pi x)$
I then got this general equation for T: $ T(t) = C_{1}\cos(4\pi nt) + C_{2}\sin(4\pi nt) $
However, I don't know how to proceed from here. When I plug in $t = 0$ into $u(x,t)$, I can't find a way to solve any variables
$ u(x,0) = X(x)T(0) = C\sin(n\pi x) * C_{1} = \sin(3\pi x)$
I'm lost and I feel like I don't have the right approach
 A: The separation of variables solution starts with
$$
                u(x,t)=X(x)T(t).
$$
Then
$$
                u_{tt}=16u_{xx} \implies X(x)T''(t)=16X''(x)T(t) \\
             \implies \frac{T''}{16T}=\lambda = \frac{X''}{X} \\
             \implies T''=16\lambda T,\;\; X''=\lambda X.
$$
The condition $u(0,t)=u(1,t)=0$ requires $X(0)=X(1)=0$, which gives solutions which are constant multiples of
$$
                    X_0(x)= 0,\\
                   X_n(x)=\sin(n\pi x),\;\;\; n=1,2,3,\cdots
$$
The values of $\lambda$ are determined by $X(0)=X(1)=0$ to be
$$
             \lambda_n = n^2\pi^2,\;\;\; n=1,2,3,\cdots.
$$
The corresponding solutions in $T$ are
$$
                      T_n(t)=A_n\cos(4n\pi t)+B_n\sin(4n\pi t).
$$
So, the general solution is
$$
                 u(x,t)=\sum_{n=1}^{\infty}A_n\sin(n\pi x)\cos(4n\pi t)+B_n\sin(n\pi x)\sin(4n\pi t)
$$
The coefficients $A_n, B_n$ are determined by the initial conditions:
$$
        \sin(3\pi x)=u(x,0) = \sum_{n=1}^{\infty}A_n\sin(n\pi x) \\
        x(1-x^2)=u_t(x,0) = \sum_{n=1}^{\infty}4n\pi B_n\sin(n\pi x)
$$
So $A_{3}=1$ and all other $A_n$'s are $0$. The $B_n$'s are determined by the orthogonality of the $\sin(n\pi x)$ terms:$$
        \int_0^1 x(1-x^2)\sin(n\pi x)dx= 4n\pi B_n \int_0^1 \sin^2(n\pi x)dx, \\
            B_n = \frac{\int_0^1 x(1-x^2)\sin(n\pi x)dx}{4n\pi\int_0^1\sin^2(n\pi x)dx},\;\;\; n=1,2,3,\cdots.
$$
Without computing the coefficients,
$$
       u(x,t)=\sin(3\pi x)\cos(12\pi t)+\\+\sum_{n=1}^{\infty}\frac{\int_0^1 x(1-x^2)\sin(n\pi x)dx}{4n\pi\int_0^1\sin^2(n\pi x)dx}\sin(n\pi x)\sin(4n\pi t).
$$
