Using d'Alembert's formula, I found the solution to the following wave equation on a half-line problem:
$$u_{xx} = u_{tt} \tag 1$$ $$u_x(0, t)=0 \tag 2$$ $$u(x, 0)=0 \tag 3$$ $$u_t(x, 0)=(1-x)e^{-kx} \tag 4$$
The solution for $x>t>0$ is:
$$ u(x,t)={ \bigg(k(t-x)+(k-1)\bigg)e^{k(t-x)}+ \bigg(k(t+x)-(k-1)\bigg)e^{-k(t+x)}\over 2k^2} \tag 5$$
Also, the solution for $x < t$ is:
$$ u(x,t)={2(k-1)+ \bigg(k(t-x)-(k-1)\bigg)e^{-k(t-x)}+ \bigg(k(t+x)-(k-1)\bigg)e^{-k(t+x)}\over 2k^2} \tag 6$$
I am not sure how to define the solution at $x=t$. A hint would be helpful.
Is there some way I can extend this solution to satisfy the boundary condition $u(1, t)=0$? The method of reflection can't help me because this boundary condition requires my solution to be oddly extended, but the boundary condition $u_x(0,t)$ requires an even extension.
Can I extend the solution using the method of images? If yes, how would I find the mirror wave solution? In literature, I found the method of images to be used to solve the Laplace equation, but I don't know how to use it for the wave equation. Do I need to solve one more wave equation where $v_x(2,t)=0$, $v(x,0)=0$ and $v_t(x,0)=-(1-x)e^{-kx}$? I tried this but failed.
I need this for a numerical analysis I am doing. I know I can easily solve this using the separation of variables method (which I did). However, because I do my analysis in finite time (typically for $t_{max}=1$ and $t_{max} = 2.5$ so I have one or two reflections), I would like to avoid infinite sums in my code. I had trouble with the Gibbs phenomenon a couple of times, so I would like to avoid it whenever I can.