D'Alembert's solution and Heaviside function Starting with the wave equation $$u_{tt} = c^2 u_{xx}$$
and given the initial conditions
$$u(x,0) = \phi(x)\\
u_t(x, t) = \psi(x)\\
-\infty<x<\infty
$$
We can derive D'Alembert's solution
$$u(x,t) = \frac{1}{2}\left[\phi(x - ct) + \phi(x + ct) \right] + \frac{1}{2c}\int_{x - ct}^{x + ct}\psi(s)ds$$
I have two questions;
a) Use D'Alembert's solution in $x > 0$ with $u_x(0,t) = 0$ for all $t > 0$ with the initial conditions
$$u(x,0) = 0\\
u_t(x, t) = \hat{\psi}(x)\\
0<x<\infty
$$
Here, I think we take the even extension of $\hat{\psi}(x)$ and use that to find a solution of the problem for $-\infty < x < \infty$ and then just limit to $x > 0$.
Edit: This is what I used to answer this question. I just need some clarification that this is the correct idea for some piece of mind, and in order to progress to the next question, which is the one I am truely stuck on.
b) When 
$$\hat{\psi} = 
    \begin{cases}
            c, &         0< x < 1\\
            0, &         x > 1
    \end{cases}$$ 
show the solution can be written as,
$$u(x,t) = \frac{1}{2}\left[(x + ct + 1)H(x + ct + 1) - (x + ct - 1)H(x + ct - 1) - (x - ct + 1)H(x - ct + 1)  + (x - ct + 1)H(x - ct + 1) \right]$$
Where $H(x)$ is the Heaviside function.
Edit: I would just appreciate a hint, and a discussion about what I should be looking for in this problem. The even extension of $\hat{\psi}$ looks like the Top Hat Function which I know has relation to delta functions, and the Heaviside function is the integral of the Dirac delta function, so perhaps this holds some significance. Regardless, I am unable to achieve what the question asks and would appreciate someone's help. This is not for an assignment. I am currently preparing for exams and this is a question I was unable to do and so I am seeking guidance.
Any help with this would be appreciated.
Thankyou.
 A: a) Yes, even extension is appropriate for $u_x=0$ boundary condition. 
b) The first step is to express the extension of $\hat \psi$ in terms of Heaviside function $H$. This does not do much mathematically, other than introduce convenient notation. In your case, the extended function 
$$\Psi(x ) = \begin{cases} c ,\quad & -1<x<1 \\ 0,\quad & \text{otherwise}\end{cases}$$
can be written as 
$$\Psi(x ) = cH(x+1) -cH(x-1)$$
because it jumps up by $c$ at $x=-1$ (as $cH(x+1)$ does), and then down by $c$ at $x=1$ (as $-cH(x-1)$ does). 
In general, a piecewise constant function that jumps by amount $\delta_j$ at point $x_j$ would be written as $\sum_j \delta_j H(x-x_j)$. 
Then you need antiderivative of $\Psi$, for the purpose of integration in d'Alembert's formula. Note that $xH(x)$  is an antiderivative of $H(x)$, and more generally $(x-a)H(x-a)$ is an antiderivative of $H(x-a)$. So,
$$F(x) = c(x+1)H(x+1) -c(x-1)H(x-1)$$
as an antiderivative of $\Psi$. Finally, plug into d'Alembert's formula: 
$$
u(x,t) = \frac{1}{2c}\int_{x - ct}^{x + ct}\psi(s)\,ds 
=\frac{1}{2c}(F(x+ct)-F(x-ct))
$$
and you'll get the answer as in your post.
