Is it Possible to have Two Distinct Analytic Functions with the Same Real Part? My professor says given the real part $u$ of an analytic function $f$ defined on a domain $D\subset \mathbb{C}$, that we can't rule out the possibility that there could exist some other analytic function $g$, distinct from $f$ beyond just the addition of a constant, defined on a domain $E\subset \mathbb{C}$ either disjoint from, or not homeomorphic to, $D$, provided that $f$ is not analytic on $E$.
Since differentiating $u$ with respect to one variable and then integrating it with respect to the other completely determines the imaginary part, what this says to me is that $u$ would have to either produce different partial derivatives on $D$ and $E$ respectively, or $\frac{\partial u}{\partial x}$ different primitives.
The case of D and E being disjoint is trivial, but can anyone give me an example for D and E overlapping but non-homeomorphic?
 A: Let $f$ and $g$ be two analytic functions defined on the domains $D$ and $E$, respectively, and suppose $A=D\cap E$ is nonempty and connected. Suppose that $\Re f(z) = \Re g(z)$ for all $z\in A$. Then I claim that $f$ and $g$ differ by an additive (imaginary) constant, that is, $f(z) = g(z) + i\alpha$ for some $\alpha\in\mathbb R$. (Furthermore, by the uniqueness of analytic continuation, this relationship continues to hold wherever $f$ and $g$ are both defined.)
To prove the claim, we set $h=f-g$; then $\Re h(z)=0$ for all $z\in A$, and we need to show that $h$ is constant. But this follows immediately from the Cauchy-Riemann equations (the integral of the derivative of $0$ is constant), since the difference of two analytic functions is also analytic. (More precisely, the derivative being zero forces $h$ to be locally constant; since $A$ is connected, that implies that $h$ is constant.)
In particular, suppose that $g(z)$ were an analytic function defined on the annulus such that $\Re g(z) = \log |z|$ everywhere in the annulus. In particular, on the slit annulus, $\Re g(z) = \Re(\log z)$ (for your favorite branch of $\log$ defined on that slit annulus). Then on the slit annulus, $g(z) = \log z + i\alpha$ for some $\alpha\in\mathbb R$. However, the function $\log z + i\alpha$ is not continuous on the slit, contradicting the analyticity of $g$ there; hence there can be no such $g$.
