Finding the imaginary part of an analytic function from the real part

A function f of a complex variable z = xiy can be factored into real and imaginary parts:

f(x + iy) = u(x, y) + iv(x,y)

where x and y are real numbers, and u and v are real-valued functions of two real values.

Suppose you are given u(x, y) and you want to find v(x, y). The function v is called a harmonic conjugate of u.

Finding v

If u and v are the real and imaginary parts of an analytic function, then u and v are related via the Cauchy-Riemann equations. These are first order differential equations that one could solve to find u given v or v given u. The approach I’ll present here comes from [1] and relies on algebra rather than differential equations.

The main result from [1] is

So given an expression for u (or v) we evaluate this expression at z/2 and z/2i to get an expression for f, and from there we can find an expression for v (or u).

This method is simpler in practice than in theory. In practice we’re just plugging (complex) numbers into equations. In theory we’d need to be a little more careful in describing what we’re doing, because u and v are not functions of a complex variable. Strictly speaking the right hand side above applies to the extensions of u and v to the complex plane.

Example 1

Shaw gives three exercises for the reader in [1]. The first is

We find that

\begin{align*} f(z) &= 2u\left(\frac{z}{2}, \frac{z}{2i} \right) - \overline{f(0)}\\ &= iz^3 - \beta i \end{align*}

We know that the constant term is purely imaginary because u(0, 0) = 0.


\begin{align*} f(x + iy) &= i (x + iy)^3 - \beta i \\ &= y^3 - 3x^2y + i(x^3 - 3xy^2 - \beta) \end{align*}

and so

v(x, y) = x^3 - 3xy^2 - \beta

is a harmonic conjugate for u for any real number β.

The image above is a plot of the function u on the left and its harmonic conjugate v on the right.

Example 2

Shaw’s second example is

u(x, y) = \exp(x) \sin(y)


We begin with

\begin{align*} f(z) &= 2u\left(\frac{z}{2}, \frac{z}{2i} \right) - \overline{f(0)}\\ &= 1 - i \exp(z) + \beta i \end{align*}

and so

\begin{align*} f(x + iy) &= 1 - i \exp(x + iy) + \beta i \\ &= 1 - i\exp(x)(\cos y + i \sin y) + \beta i \end{align*}

From there we find

v(x, y) = \exp(x) \cos(y) + \beta

Example 3

Shaw’s last exercise is

u(x, y) = \cosh(x) \cos(y)


\begin{align*} f(z) &= 2u\left(\frac{z}{2}, \frac{z}{2i} \right) - \overline{f(0)}\\ &= 2 \cosh^2(z/2) + \beta i \end{align*}

This leads to

\begin{align*} f(x + iy) &= 2 \cosh^2((x + iy)/2) + \beta i \\ &= 2 \cosh^2(x/2) \cos^2(y/2) - 2\sinh^2(x/2)\sin(y/2) \\ &\phantom{=} \,+ 4i \sinh(x/2) \cosh(x/2) \sin(y/2)\cos(y/2) + \beta i \end{align*}

from which we read off

v(x,y) = 4 \sinh(x/2) \cosh(x/2) \sin(y/2)\cos(y/2) + \beta

Related posts

[1] William T. Shaw. Recovering Holomorphic Functions from Their Real or Imaginary Parts without the Cauchy-Riemann Equations. SIAM Review, Dec., 2004, Vol. 46, No. 4, pp. 717–728.