D’Alembert Formula - PDE 
Find $u(2,1)$ and $u(3.5,0.5)$ if $u$ solves $$u_{tt}=u_{xx}, \ 0<x<2, t>0$$ $$u(0,x)=x^2(2-x)^2, \ u_t(0,x)=x(2-x), \ 0\le x\le 2$$ $$u(t,0)=u(t,2)=0, \ t\ge0.$$

I can use D’Alembert formula which is $$u(x,t)=\frac12 \left[ f(x+ct)+f(x-ct) \right]+\frac{1}{2c}\int^{x+ct}_{x-ct}g(s)ds.$$
Therefore, $$u(x,t)=\frac12 \left[(x+t)^2(2-(x+t))^2+(x-t)^2(2-(x-t))^2\right] + \frac12\int^{x+t}_{x-t}s(2-s)ds.$$
But I am doing it wrong since I am not getting the right the answer. How will I proceed?
 A: First, your solution should take into account the fact that $x\in[0,2]$, while d'Alembert formula works for free space. So your $f$ and $g$ in d'Alembert formula should be defined to be nonzero only for these values of $x$.
Next, d'Alembert formula doesn't take boundary conditions at finite points into account. What you'll get when you fix your definition of $f$ and $g$ is the solution $u_0(t,x)$ for free space.
To force the solution to zero at the boundaries you can use the fact that if $u_0(t,x)$ is a solution of wave equation, then $u_0(t,a-x)$ is also a solution, where $a$ is constant. Thus, when you take linear combination of these solutions with different $a$, you'll be able to get your boundary conditions satisfied (until some time $T$ if you take finite number of terms). Thus for time up to $t=2$ this solution will work:
$$u(t,x)=u_0(t,x)-u_0(t,4-x)-u_0(t,-x).\tag1$$
These added functions represent reflections from the boundaries. As you add more retarded reflections, you'll get solution for further times, satisfying the boundary conditions.
For clarity, here's the free solution of d'Alembert:

And here's what I do in $(1)$:

You can see that for $t>2$ the solution ceases to satisfy boundary conditions. So for further time we can add yet another set of reflections:

In the limit, the solution would be periodic in $x\in\mathbb R$, although the useful domain is $[0,2]$, as given in the initial problem statement.
