Incorrect result for a standing wave on a rope with free ends Given a rope with both ends free, the general solution is
$$\psi(x,t)=f(x-vt)+g(x+vt),$$
such that 
$$\frac{\partial\psi}{\partial x}(0,t)=0=\frac{\partial\psi}{\partial x}(L,t).$$
Question
If $f(x-vt)=\cos\left[k(x-vt)\right]$ then what is $g(x+vt)$ ? 
The answer should be $g(x+vt)=\cos\left[k(x+vt)\right]$ but I am getting $g(x+vt)=-\cos\left[k(x+vt)\right]$. 
Attempted solution
From $\frac{\partial\psi}{\partial x}(0,t)=0$ we obtain
$$\frac{\partial f}{\partial x}(-vt)=-\frac{\partial g}{\partial x}(vt),$$
which holds for all $t$. Thus
$$\frac{\partial f}{\partial x}(-u)=-\frac{\partial g}{\partial x}(u),$$
which has a solution
$$g(u)=-f(-u).$$
Choose $u=x+vt$ and use $f(x+vt)=\cos\left[k(x+vt)\right]$ and the above equation yields
$$g(x+vt)=-\cos\left[k(x+vt)\right].$$
This is of course wrong because this gives 
$$\frac{\partial\psi}{\partial x}(0,t)=2\sin(\omega t)\neq 0.$$
 A: So to be a little bit more terse about it, you almost have the right equation, but remember that $f,g$ are functions of one variable only and therefore partial derivatives of these are totally meaningless. But we do have that  $$\left({\partial\psi\over\partial x}\right)_{t~\text{const},~x=0} = 0 ~~~\Leftrightarrow~~~f'(-\omega t) + g'(\omega t) = 0$$You are correct to replace the $\omega t$ with just a generic argument $u$, and to find that $$g'(u) = - f'(-u).$$
However your claim that this has the solution $g(u) = - f(-u)$ is not correct. This is because of the chain rule which says that the derivative of $p(x) = q(r(x))$ is not $p'(x) = q'(r(x))$ but is instead $$p'(x) = q'(r(x))\cdot r'(x).$$This means that the actual solution must be $g(u) = f(-u)$ so that the chain rule coming in this form of  $r(x) = -x, ~~r'(x) = -1$ introduces the minus sign that we see above.
A: So what was your error?
Your error is choosing $g(x,t) = -\cos (x+vt)$ which gives $\frac{\partial f}{\partial x} + \frac{\partial g}{\partial x} \ne 0 $ at $x=0$  
The choice of $g$ was flawed because you did not apply the condition $\frac{\partial f}{\partial x} + \frac{\partial g}{\partial x} = 0 $  correctly. 
So you wanted $\frac{\partial f}{\partial x} =  -\sin(x-vt) = -\frac{\partial g}{\partial x}$ at $x=0$.
which gives $\frac{\partial g}{\partial x} = - \sin (vt)$ and the function of $x+vt$ which satisfies this is $g(x,t) = +\cos (x+vt)$  

The graphs below are snapshots at an instant of time $t$.  
 
The function $f$ is a right travelling wave and is shown in red on the graph.  
The function $\frac {\partial f}{\partial x}$ is the gradient of the cosine function $f$ and is a sine function and with time it also travels to the right following the function $f$ (shown in mauve on the graph).
One of the conditions that you are imposing is that at $x=0$ you must have for all time $ \frac{\partial \psi}{\partial x}=0$ 
This means that $\frac{\partial f}{\partial x}+\frac{\partial g}{\partial x}=0$ so the $\frac{\partial g}{\partial x}$ graph must be the "opposite" of the $\frac{\partial f}{\partial x}$ graph and and so must be a sine graph travelling to the left as shown in blue. 
Because you want that condition  $ \frac{\partial \psi}{\partial x}=0$ to hold for all times wave $g$ must be left travelling. 
This means that the $g(x,t) = +\cos(x+vt)$.  
If you picture in your mind a little later in time the $f$ and $\frac {\partial f}{\partial x}$ graphs moving a little to the right with the $g$ and $\frac {\partial g}{\partial x}$ graphs moving a little to the left then you can image the intercepts on the y-axis of the gradient graphs both moving further from the origin by the same amount thus still having their sum euual to zero.  
