Let $B_r(x_0,y_0) \subset \mathbb{R}^2$ be the open ball of radius $r>0$ centered at $(x_0,y_0)$, I want to prove that if $u:B_r(x_0,y_0) \longrightarrow \mathbb{R}$ is harmonic, that is, a $C^2$ function that satisfies $u_{xx}+u_{yy}=0$, then there exist a $C^2$ function $v$ such that $$ u_x=v_y \textrm{ and } -u_y=v_x $$ This is why I tried: From the first equation, we have that if such a $v$ exist, then $$ v(x,y)=\int_{y_0}^{y}{u_x(x,t)dt}+g_{1}(x) $$ Similarly, we have by the second equation that $$ v(x,y)=-\int_{x_0}^{x}{u_y(s,y)ds}+g_2(y) $$ By setting the two equations equal to each other we get that $$ g_2(y)=\int_{y_0}^{y}{u_x(x,t)dt}+\int_{x_0}^{x}{u_y(s,y)ds}+g_1(x) $$ Therefore, $$ 0=u_y(x,y_0)+g_1'(x) $$ Which entails that $$ g_1(x)=-\int_{x_0}^{x}{u_y(s,y_0)ds}+C $$ For some constant $C$, and thus $$ v(x,y)=\int_{y_0}^{y}{u_x(x,t)dt}-\int_{x_0}^{x}{u_y(s,y_0)ds}+C $$ This function $v$ would satisfy by construction what we want. My question is: where did we use that $u$ is defined on a ball? It is of my understanding that we can't just take any domain, but where does this proof break down if we change the region? I don't see it. I don't know anything about complex analysis, so I would appreciate an explanation in terms of real analysis.
Any help?
In advance thank you very much.
Most of the integrals you used in the proof may not exist if the domain is not a convex set. For example, $\int_{y_0}^{y}{u_x(x,t)dt}$ may not be defined because the fact that $(x_0,y_0)$ and $(x,y)$ are in the domain does not imply that $(x,t)$ is in the domain for $t$ between $y_0$ and $y$.