PDE: $ (\partial_{tt}-\partial_{xx})u(x,t)=0, u(x,0)=x(1-x)$ 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.
 A: I would suggest the ol' fashioned way of separating by variables.
$\underline{\textbf{Separation}}$
We begin by considering the equivalent PDE:
$$\frac{\partial^2u}{\partial t^2}=\frac{\partial^2u}{\partial x^2}$$
And consider solutions of the form $u(x,t)=X(x)T(t)$. From this we obtain:
$$X\frac{d^2T}{dt^2}=T\frac{d^2X}{dx^2}$$
Which can be rearranged to reveal:
$$\frac{1}{T}\frac{d^2T}{dt^2}=\frac{1}{X}\frac{d^2X}{dx^2}=-k^2$$
Choosing $-k^2$ as the eigenvalue. This results in two separate PDEs:
$$\frac{d^2T}{dt^2}+k^2T=0\phantom{..}\&\phantom{..}\frac{d^2X}{dx^2}+k^2X=0$$
We recognize that these both have the solution:
$$T(t)=A\cos(kt)+B\sin(kt)\phantom{..}\&\phantom{..}X(x)=C\cos(kt)+D\sin(kx)$$
$\underline{\textbf{Endpoint Conditions}}$
We now turn to the boundary conditions. The first of which deals with the fact that:
$$u(0,t)=0\phantom{..}\&\phantom{..}u(1,t)=0$$
Since $u(x,t)=X(x)T(t)$, we can reformulate these in terms of the component functions. Of course assuming that $T(t)\neq0$, then this implies the initial value conditions:
$$X(0)=0\phantom{..}\&\phantom{..}X(1)=0$$
The first implies a form of $X(x)=D\sin(kx)$, the second implies that k can be of the form $n\pi$ where $n$ is an integer. This means effectively that $X(x)$ can in fact be a sum of functions in the following form:
$$X(x)=\sum_{n=0}^\infty D_n\sin(n\pi x)$$
$\underline{\textbf{Initial Speed Condition}}$
The following condition:
$$\frac{\partial}{\partial t}u(x,0)=0$$
speaks about the time variable. This means after differentiating that
$$\frac{d}{dt}T(0)=0$$
This implies that the time function is of the following form:
$$T(t)=A_n\cos(n\pi t)$$
Therefore our function is:
$$u(x,t)=\sum_{n=0}^\infty A_nD_n\cos(n\pi t)\sin(n\pi x)$$
We allow $\Gamma_n=A_nD_n$ to produce the final function:
$$u(x,t)=\sum_{n=0}^\infty \Gamma_n\cos(n\pi t)\sin(n\pi x)$$
$\underline{\textbf{Initial Function Condition}}$
By this point in time, you may see that the solution is headed towards a Fourier Series. This is because the final condition states that:
$$u(x,0)=x(1-x)$$
Expanding using the product form, we find the following condition:
$$\sum_{n=0}^\infty\Gamma_n\sin(n\pi x)=x(1-x)$$
Normally, a function $f(x)$ which can be represented by a sum of sines is represented under the Fourier Series as
$$f(x)=\sum_{n=0}^\infty b_n\sin\left(\frac{\pi n x}{P}\right),\text{ where },b_n=\frac{2}{P}\int^{x_0+P}_{x_0}f(x)\sin\left(\frac{\pi n x}{P}\right)dx$$
Therefore, we need to alter the form to:
$$f(x)=\sum_{n=0}^\infty \Gamma_n\sin\left(\pi n x)\right),\text{ where },\Gamma_n=2\int_0^1x(1-x)\sin(\pi n x)dx$$
Obtaining the coefficients for the integral and using them for $\Gamma_n$, we finally get our function. This is the final product:

A: 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.
