This is an exercise from Potential Theory in the Complex Plane by Ransford. As in the title:
Assume $h,k$ are harmonic and non constant on some domain $D$. Prove that $hk$ is harmonic if and only if $h + ick$ is holomorphic for some real constant $c$. Hint: Consider $f/g$ where $f = h_x -ih_y$, $g=k_x - ik_y$.
What I tried: The functions $f,g$ are holomorphic, and so is $f/g$ (barring zeroes of $g$, but lets not worry about that now). If you look at the real part of $f/g$ then from the other assumptions you get that it's equal to zero. This means that $f/g$ (which is equal to its imaginary part) by holomorphy has to be constant. This leaves us with:
$$ \frac{h_xk_y - h_y k_x}{k_x^2 + k_y^2} = const $$
Now we would like to somehow extract from this the Riemann Cauchy equations, i.e. arrive at $h_x = ck_y$, but I'm failing to do so. Any help would be appreciated, thanks.
We have the function $F = \frac{f}{g}$, which is holomorphic in some open neighborhood of the complex plane. Previously, you were able to deduce that $$F = i\frac{h_xk_y-h_yk_x}{k_x^2+k_y^2}.$$ Notice that, if $F$ is holomorphic, necessarily $F\equiv ic$, where $C\in\mathbb{R}$. This is equivalent to the fact that $f(z)=icg(z)$. Thus, $$h_x-ih_y = ic(k_x-ik_y).$$ Now, equating real and imaginary parts: \begin{align} h_x =& ck_y\\ h_y =& -ck_x. \end{align} So, the functions $h$ and $k$ satisfies the Cauchy-Riemann equations. Therefore, $h+ick$ is holomorphic.