# Characteristics for nonhomogeneous wave equation $y_{tt}=y_{xx} + f$

Consider the initial- and boundary-value problem \eqalign{ & {y_{tt}} = {y_{xx}} + f(t,x){\text{ }}{\text{, (t}}{\text{,x)}} \in {\text{(0}}{\text{,}}\infty {\text{)}} \times {\text{(0}}{\text{,1)}} \cr & y(t,0) = y(t,1) = 0 \cr & y(0,x) = {y_0}(x),{\text{ }}{y_t}(0,x) = {y_1}(x) \cr} To solve that, I reduced the above system to 1-d hyperbolic system by letting \eqalign{ & p = {y_t} - {y_x} \cr & q = {y_t} + {y_x} \cr} We obtain \eqalign{ & {p_t} = -{p_x} + f(t,x) \cr & {q_t} = {q_x} + f(t,x) \cr & p(t,0) + q(t,0) = p(t,1) + q(t,1) = 0 \cr & p(0,x) = {p_0}(x),q(0,x) = {q_0}(x) \cr} The characteristic lines are $$x^-=t+c_1$$ and $$x^+=-t+c_2$$ for the first and second equation respectively. let us consider the first transport equation, We have along x^-: $$\frac{d}{{dt}}p(t,t + {c_1}) = f(t,t + {c_1})$$ Let $$f$$ be defined as$$f(t,x) = \left\{ \matrix {f_1}(t,x),{\text{ if x + t}} \in (0,1), {f_2}(t,x),{\text{ if x + t}} \in (1,2). \right.$$ The characteristic $$x^-$$ will cuts the line $$x=t$$ in the point $$t=\frac{{1 - {c_1}}}{2}$$. Integrating over $$(0,t)$$, we get $$p(t,t+c_1) = {p_0}(c_1) + \int\limits_0^t {f(s,s+c_1)ds}$$ How can I write the solution in function of $$f_1$$ and $$f_2$$? Is the following expression correct? $$p(t,x) = {p_0}(x-t) + \int\limits_0^{\frac{{1 - {c_1}}}{2}} {{f_1}(s,s - t + x)ds} + \int\limits_{\frac{{1 - {c_1}}}{2}}^{1 - {c_1}} {{f_2}(s,s - t + x)ds}$$

Or that expression? \eqalign{ & p(t,t + {c_1}) = {p_0}({c_1}) + \int\limits_0^t {{f_1}(s,s+c_1)ds} ,{\text{ if t}} \in {\text{(0}}{\text{,}}\frac{{1 - {c_1}}}{2}) \cr & p(t,t + {c_1}) = {p_0}({c_1}) + \int\limits_0^t {{f_1}(s,s + {c_1})ds} + + \int\limits_{\frac{{1 - {c_1}}}{2}}^t {{f_2}(s,s + {c_1})ds} ,{\text{ if t}} \in {\text{(}}\frac{{1 - {c_1}}}{2},1 - {c_1}) \cr}