<s>[INST] Velocity from velocity potential I have this homework question and I get a different answer to the solutions. 
In Cylindrical polar coordinates $(r,\theta,z)$, the velocity potential of a flow is given by:
$$\phi = -\frac{Ua^2r}{b^2-a^2}(1+\frac{b^2}{r^2})cos\theta$$
Find the velocity. 
I get the velocity as:
$$v = (-\frac{Ua^2}{b^2-a^2}(1+\frac{b^2}{r^2})cos\theta + \frac{2Ua^2b^2}{(b^2-a^2)r^2}cos\theta)e_r + (\frac{Ua^2}{b^2-a^2}(1+\frac{b^2}{r^2})sin\theta) e_{\theta}$$
The answer misses out the second term in the $r$ direction, but I can't see where I've gone wrong. Any help appreciated. 
 [/INST] For a flow in polar coordinates, the stream function $\phi$ leads to the velocities as
$$
v_r=\frac{1}{r}\frac{\partial\phi}{\partial\theta}\qquad v_\theta=-\frac{\partial\phi}{\partial r}
$$
and not $v_r=\partial_r\phi$ and $v_\theta=\partial_\theta\phi$. Thus,
$$
v_r=\frac{1}{r}\frac{\partial}{\partial \theta}\left(-\frac{Ua^2r}{b^2-a^2}\left(1+\frac{b^2}{r^2}\right)\cos\theta\right) \\
 = \frac{1}{r}\left(\frac{Ua^2r}{b^2-a^2}\left(1+\frac{b^2}{r^2}\right)\sin\theta\right) \\
=\frac{Ua^2}{b^2-a^2}\left(1+\frac{b^2}{r^2}\right)\sin\theta
$$
and
$$
v_\theta=-\frac{\partial}{\partial r}\left(-\frac{Ua^2r}{b^2-a^2}\cos\theta-\frac{Ua^2}{b^2-a^2}\frac{b^2}{r}\cos\theta\right) \\
= +\frac{Ua^2}{b^2-a^2}\cos\theta-\frac{Ua^2}{b^2-a^2}\frac{b^2}{r^2}\cos\theta
$$
If $v_0\equiv Ua^2/(b^2-a^2)$, then the vector velocity is
$$
\vec{v} = v_0\left(1+\frac{b^2}{r^2}\right)\sin\theta\hat{r}+v_0\left(1-\frac{b^2}{r^2}\right)\cos\theta\hat{\theta}
$$
</s>