Wave equation, initial conditions The displacement of an infinite string obeys the wave equation:
$$ \frac{\partial ^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}$$
Find the solution in the form:
$$u(x,t) = f(x-ct) + g(x+ct) $$
where $g=-f$ and the initial conditions are given by:
$$u(x,0)=0$$
$$\frac{\partial}{\partial t} u(x,0) = \frac{x}{(1+x^2)^2}$$

The second condition leads to:
$$\frac{\partial u}{\partial t}=-cf'(x,0)+cg'(x,0)=-2cf'(x,0)=\frac{x}{(1+x^2)^2}$$
$$f(x,0) = - \frac{1}{2c} \left( \frac{x}{(1+x^2)^2} \right) t + h(x)$$
Now, this is the solution for $t=0$. Is it mathematically correct to simply substitute $x$ back with $x \pm ct$? i.e.:
$$u(x,t) = - \frac{1}{2c} \left( \frac{(x-ct)}{(1+(x-ct)^2)^2} \right) t +\frac{1}{2c} \left( \frac{(x+ct)}{(1+(x+ct)^2)^2} \right)t$$
In principle the initial conditions would be satisfied for any function of $t$ that yields $h(0)=0$, but since I am supposed to find a solution of that particular form ($f(x\pm ct)$), I suppose it is a correct solution?

Note:
There is a difference between $f(x,y)$ and $f(x+y)$. The first is a function of two variables and the second is a function of one variable $z=x+y$. For example
$$f(x+0)=f(x)=x^2\implies f(x+y)=(x+y)^2\\f(x,0)=x^2\implies \, \text{nothing} $$Also there is a meaning of $\frac{\partial f(x,y)}{\partial x}$ but it doesn't mean any thing for $f(x+y)$ despite $$w=f(x+y)\implies \frac{\partial w}{\partial x}=f'(x+y)\times \frac{\partial (x+y)}{\partial x}+=f'(x+y)\times 1=f'(x+y)$$
