Hello I am trying to solve the partial differential equation with initial and boundary conditions given by \begin{eqnarray} (\partial_{tt}-\partial_{xx})u(x,t)=0\\ u(x,0)=f(x)\\ \partial_t u(x,0)=0\\ u(0,t)=u(1,t)=0\\ f(x)=x(1-x) \end{eqnarray} where $x\in [0,1]$ and $t\geq 0$.
Usually we can seek solutions to this problem by writing it of the form $$ u(x,t)=\frac{1}{2} (f(x+t)+f(x-t)) $$ but this assumes that $f(-x)=-f(x)$ and also $f(x+2)=f(x)$. Note, this is required for these boundary and initial conditions, the function $f$ most have two derivatives and be extended to the whole real line by defining it to be odd and satisfying $f(x+2)=f(x)$.
However, in this example, $f(x)$ is not odd (or even), so I am stuck as to how to find this analytic solution.
I thought about Fourier transforming in space, using $u(x,t)=\int_{-\infty}^\infty u(k,t)e^{ikx}dk$, to obtain $$ (\partial_{tt}+k^2 )u(k,t)=0\implies u(k,t)=A\cos(kt)+B\sin(kt) $$ however then had problems computing the inverse Fourier transform.
Thanks for your help.

HIT :
The general solution of the PDE is on the form : $$u(x,t)=g(x+t)+h(x-t)$$ any two times differentiable functions $g$ and $h$.
With condition $u(x,0)=f(x)$ $$u(x,0)=g(x)+h(x)=f(x)\quad\implies\quad h(x)=f(x)-g(x)$$ $$u(x,t)=g(x+t)+h(x-t)=g(x+t)+f(x+t)-g(x+t)$$ With $f(x)=x(1-x)\quad\to\quad f(x+t)=(x+t)\left(1-(x+t)\right)$
$$u(x,t)=(x+t)\left(1-(x+t)\right)+g(x+t)-g(x+t)$$
The function $g$ is to be determined according to the other conditions.