Solution (source code)

= Solution

The far radial derivative selects the growing frequency-one term $Ur\cos\theta$. The matching decaying harmonic is $B\cos\theta/r$. The no-penetration condition gives $\partial_r\phi=(U-B/r^2)\cos\theta=0$ at $r=a$, so $B=Ua^2$. Thus the <potential flow around a circular cylinder> is
$$
\boxed{\phi(r,\theta)=U\left(r+\frac{a^2}{r}\right)\cos\theta+C.}
$$
The remaining single-valued exterior harmonics are excluded by the zero radial derivative at the cylinder and the prescribed derivative at infinity, apart from the arbitrary additive constant. In particular the logarithmic radial term would have a nonzero radial derivative on the cylinder. A circulation term proportional to $\theta$ is excluded by single-valuedness of the potential.