Solution (source code)

= Solution

Use the <product rule> for the <Laplace operator>:
$$
\Delta(xg(r))=x\Delta g(r)+2\partial_xg(r)=x\left(g''+\frac{g'}r\right)+2\frac{x}{r}g'=x\left(g''+\frac{3g'}r\right).
$$
Thus <Laplace's equation>, away from the origin, reduces to $g''+3g'/r=0$. On the line $x=0$ the displayed expression vanishes automatically; requiring the equation on an open region gives the same radial equation by continuity from $x\ne0$. Multiplying by $r^3$ gives $(r^3g')'=0$, so $g'=Cr^{-3}$ and $g=A+Br^{-2}$. Therefore
$$
\boxed{u(x,y)=Ax+B\frac{x}{x^2+y^2},\qquad r>0.}
$$
If extension through the origin is required, $B=0$: along the horizontal axis the second term is $B/x$. The remaining <harmonic function> is $Ax$.