A wave f(x+ct) travels along a semi-infinite string (0<x<inf) for t<0. Find the vibrations u(x,t) of the string for t>0 if the end x=0 is fixed.

Then answer in the back of the book is f(x+ct) for x>ct and f(x+ct)-f(ct-x) for x<ct.

I'm not sure how they got that from these equations (i think):
v(x,t) = .5(phi(x+ct)+phi(x-ct))+(1/2c)*integral from x-ct to x+ct of psi(y)dy for x>c|t|
v(x,t) = .5(phi(ct+x)-phi(ct-x))+(1/2c)*integral from ct-x to ct+x of psi(y)dy for 0<x<ct