Engineering Mathematics‹›⌂ 0:00 studied

Module 1 · 10 min read · Free chapter

Complex variables: analytic functions, contour integrals and residues

In short

A complex function is analytic where it has a derivative, which needs the Cauchy-Riemann equations to hold. For analytic functions, a closed contour integral is zero unless the contour encloses a singularity. The residue theorem then gives the integral as 2πi times the sum of residues inside, which makes hard real integrals easy.

What are you preparing for? We show the practice and previous year questions of your exam.

Start from zero: numbers that can turn

On a number line you can only move forward or backward. Complex numbers add a second direction, so a number becomes a point on a plane. In z=x+iyz = x + iy, the real part xx is the step to the right and the imaginary part yy is the step upward. Here ii is defined by i2=−1i^2 = -1.

The real power of the idea is rotation. Multiplying by ii turns a point through 90° about the origin, and multiplying by ii twice turns it through 180°, which is the same as multiplying by −1-1. That is exactly why i2=−1i^2 = -1 makes sense.

Polar form. A point can also be described by its distance from the origin and its angle. The modulus is r=∣z∣=x2+y2r = \lvert z \rvert = \sqrt{x^2 + y^2}, and the argument is θ=tan⁡−1yx\theta = \tan^{-1}\dfrac{y}{x}, placed in the correct quadrant. Then z=r(cos⁡θ+isin⁡θ)z = r(\cos\theta + i\sin\theta), and Euler's formula shortens this to z=reiθz = re^{i\theta}.

Rules that follow.

  • Multiplying two complex numbers multiplies their moduli and adds their arguments.
  • De Moivre's theorem: (cos⁡θ+isin⁡θ)n=cos⁡nθ+isin⁡nθ(\cos\theta + i\sin\theta)^n = \cos n\theta + i\sin n\theta, which gives powers and roots quickly.
  • The conjugate zˉ=x−iy\bar{z} = x - iy is the mirror image in the real axis, and zzˉ=∣z∣2z\bar{z} = \lvert z \rvert^2.

Why it matters. Every AC circuit is analysed with complex numbers called phasors. The same tool is used for transfer functions in control and for frequency in signals. GATE ME, EE and EC list complex variables, while GATE CS does not.

Analytic functions and the Cauchy-Riemann equations

A function of a complex variable maps each point zz to another point w=f(z)=u(x,y)+i v(x,y)w = f(z) = u(x, y) + i\,v(x, y). For a real function, the derivative must be the same from the left and the right. For a complex function, z can approach a point from every direction in the plane, so the condition is much stronger.

A function that has a derivative at every point of a region is called analytic (or holomorphic) there. Taking the limit along the x-direction and along the y-direction, and asking that they agree, gives the Cauchy-Riemann (C-R) equations: ∂u∂x=∂v∂y\dfrac{\partial u}{\partial x} = \dfrac{\partial v}{\partial y} and ∂u∂y=−∂v∂x\dfrac{\partial u}{\partial y} = -\dfrac{\partial v}{\partial x}. They are necessary, and when the partial derivatives are continuous they are also sufficient.

Worked example. For f(z)=z2=(x2−y2)+i(2xy)f(z) = z^2 = (x^2 - y^2) + i(2xy), u=x2−y2u = x^2 - y^2 and v=2xyv = 2xy. Then ux=2x=vyu_x = 2x = v_y and uy=−2y=−vxu_y = -2y = -v_x, so z2z^2 is analytic everywhere. By contrast, f(z)=zˉ=x−iyf(z) = \bar{z} = x - iy has ux=1u_x = 1 but vy=−1v_y = -1, so it is analytic nowhere.

Harmonic functions. If f is analytic, both u and v satisfy Laplace's equation, ∇2u=0\nabla^2 u = 0 and ∇2v=0\nabla^2 v = 0. Given u, its harmonic conjugate v can be built from the C-R equations. For example, u=x2−y2u = x^2 - y^2 leads back to v=2xyv = 2xy, plus a constant.

Why it matters. In two-dimensional ideal fluid flow, u and v act as the velocity potential and the stream function. Their level curves cross at right angles, which is how flow nets for seepage and potential flow are drawn.

Cauchy's integral theorem and formula

In the complex plane, we integrate along a curve, called a contour. When the contour is closed and traced anticlockwise, the integral is written ∮f(z) dz\oint f(z)\,dz. The results are surprisingly strong.

Cauchy's integral theorem. If f is analytic on a simple closed curve CC and everywhere inside it, then ∮f(z) dz=0\oint f(z)\,dz = 0. It is the complex version of a conservative field: with no "holes" where f misbehaves, going round a loop gives nothing. So the integral between two points also does not depend on the path inside such a region.

Cauchy's integral formula. If aa is inside CC, then f(a)=12πi∮f(z)z−a dzf(a) = \dfrac{1}{2\pi i}\oint \dfrac{f(z)}{z - a}\,dz. The values on the boundary fix the value at every point inside. Differentiating gives f(n)(a)=n!2πi∮f(z)(z−a)n+1 dzf^{(n)}(a) = \dfrac{n!}{2\pi i}\oint \dfrac{f(z)}{(z - a)^{n+1}}\,dz, so an analytic function has derivatives of every order.

Worked example 1. Find ∮ezz−1 dz\oint \dfrac{e^z}{z - 1}\,dz round ∣z∣=2\lvert z \rvert = 2. The point z=1z = 1 lies inside, and eze^z is analytic, so the integral is 2πi×e1=2πie2\pi i \times e^1 = 2\pi ie.

Worked example 2. Find ∮sin⁡z(z−π/2)3 dz\oint \dfrac{\sin z}{(z - \pi/2)^3}\,dz round ∣z∣=2\lvert z \rvert = 2. Here n=2n = 2, and f′′(z)=−sin⁡zf''(z) = -\sin z, so f′′(π2)=−1f''\left(\dfrac{\pi}{2}\right) = -1. The formula then gives the integral as 2πi2!×f′′(π2)=πi×(−1)=−πi\dfrac{2\pi i}{2!} \times f''\left(\dfrac{\pi}{2}\right) = \pi i \times (-1) = -\pi i.

Taylor and Laurent series, and kinds of singularity

Inside any circle where f is analytic, f has a Taylor series in powers of (z−a)(z - a), just as for real functions. For example, 11−z=1+z+z2+⋯\dfrac{1}{1 - z} = 1 + z + z^2 + \cdots for ∣z∣<1\lvert z \rvert < 1. The series stops working at the nearest point where f breaks down, so the radius of convergence is the distance to the nearest singularity.

Near a point where f does break down, a Laurent series is used instead. It contains negative powers as well, f(z)=∑n=−∞∞an(z−a)nf(z) = \sum_{n=-\infty}^{\infty} a_n(z - a)^n, and it is valid in a ring r<∣z−a∣<Rr < \lvert z - a \rvert < R. The part with negative powers is called the principal part, and it tells what kind of singularity a is.

  • If there are no negative powers, the singularity is removable, as for (sin z)/z at 0.
  • If the negative powers stop at (z−a)−m(z - a)^{-m}, a is a pole of order mm; order 1 is a simple pole.
  • If there are infinitely many negative powers, a is an essential singularity, as for e1/ze^{1/z} at 0.

The coefficient a−1a_{-1} of (z−a)−1(z - a)^{-1} is special and is called the residue of f at a. It is the only term that survives when you integrate round the point, because ∮(z−a)n dz\oint (z - a)^n\,dz is 2πi2\pi i for n=−1n = -1 and zero for every other whole number nn.

Worked example. For f(z)=1z(z−1)f(z) = \dfrac{1}{z(z - 1)} in 0<∣z∣<10 < \lvert z \rvert < 1, write f=−1z×11−z=−1z(1+z+z2+⋯ )=−1z−1−z−⋯f = -\dfrac{1}{z} \times \dfrac{1}{1 - z} = -\dfrac{1}{z}(1 + z + z^2 + \cdots) = -\dfrac{1}{z} - 1 - z - \cdots. The principal part is −1z-\dfrac{1}{z}, so z=0z = 0 is a simple pole with residue −1-1.

The residue theorem: integrals by bookkeeping

The residue theorem combines everything so far. If f is analytic inside and on C except at a few poles inside it, then

∮Cf(z) dz=2πi×(sum of the residues at those poles)\oint_C f(z)\,dz = 2\pi i \times (\text{sum of the residues at those poles})

A hard integral is reduced to finding a few coefficients.

Finding residues quickly.

  • At a simple pole a, the residue is lim⁡z→a(z−a)f(z)\lim_{z \to a} (z - a)f(z).
  • If f=p(z)q(z)f = \dfrac{p(z)}{q(z)} with q(a)=0q(a) = 0 and q′(a)≠0q'(a) \ne 0, the residue is p(a)q′(a)\dfrac{p(a)}{q'(a)}.
  • At a pole of order mm, the residue is 1(m−1)!lim⁡z→adm−1dzm−1[(z−a)mf(z)]\dfrac{1}{(m-1)!}\lim_{z \to a}\dfrac{d^{m-1}}{dz^{m-1}}\left[(z - a)^m f(z)\right].

Worked example. Evaluate ∮z+1z(z−2) dz\oint \dfrac{z + 1}{z(z - 2)}\,dz round ∣z∣=3\lvert z \rvert = 3. Both poles, z=0z = 0 and z=2z = 2, lie inside. The residue at 0 is 0+10−2=−12\dfrac{0 + 1}{0 - 2} = -\dfrac{1}{2}, and at 2 it is 2+12=32\dfrac{2 + 1}{2} = \dfrac{3}{2}. So the integral is 2πi×(−12+32)=2πi2\pi i \times \left(-\dfrac{1}{2} + \dfrac{3}{2}\right) = 2\pi i.

Round ∣z∣=1\lvert z \rvert = 1 instead, only z=0z = 0 is inside, so the answer becomes 2πi×(−12)=−πi2\pi i \times \left(-\dfrac{1}{2}\right) = -\pi i. Choosing which poles are enclosed is often the whole question.

Why it matters. In control systems the poles of a transfer function decide stability, and the Nyquist criterion is built on this same "count the poles inside a contour" idea. Inverse Laplace and z-transforms can also be found by residues.

Descriptive lens: how ESE and state papers ask this

Descriptive questions ask you to test analyticity with the C-R equations, to build a harmonic conjugate, or to evaluate a real integral using residues.

Our practice questions (not previous-year questions).

  1. Show that u=excos⁡yu = e^x\cos y is harmonic, find its harmonic conjugate vv, and write f(z)=u+ivf(z) = u + iv in terms of zz.
  2. Evaluate ∮3z2+2(z−1)(z2+4) dz\oint \dfrac{3z^2 + 2}{(z - 1)(z^2 + 4)}\,dz round ∣z∣=3\lvert z \rvert = 3.
  3. Evaluate ∫02πdθ2+cos⁡θ\int_0^{2\pi} \dfrac{d\theta}{2 + \cos\theta} by putting z=eiθz = e^{i\theta} and using residues.

Answer plan for question 3.

  • First, put z=eiθz = e^{i\theta}, so cos⁡θ=z+1/z2\cos\theta = \dfrac{z + 1/z}{2} and dθ=dzizd\theta = \dfrac{dz}{iz}, and the integral runs round ∣z∣=1\lvert z \rvert = 1.
  • Next, simplify the integrand to 2i×1z2+4z+1\dfrac{2}{i} \times \dfrac{1}{z^2 + 4z + 1}, whose poles are z=−2±3z = -2 \pm \sqrt{3}.
  • Then note that only z=−2+3z = -2 + \sqrt{3} lies inside the unit circle, and its residue is 123\dfrac{1}{2\sqrt{3}}.
  • Finally, the integral is 2πi×2i×123=2π32\pi i \times \dfrac{2}{i} \times \dfrac{1}{2\sqrt{3}} = \dfrac{2\pi}{\sqrt{3}}.

Quick revision

  • z=x+iy=reiθz = x + iy = re^{i\theta}, with ∣z∣=x2+y2\lvert z \rvert = \sqrt{x^2 + y^2}, and multiplying by ii turns a point through 90°.
  • De Moivre gives (cos⁡θ+isin⁡θ)n=cos⁡nθ+isin⁡nθ(\cos\theta + i\sin\theta)^n = \cos n\theta + i\sin n\theta, and zzˉ=∣z∣2z\bar{z} = \lvert z \rvert^2.
  • C-R equations: ux=vyu_x = v_y and uy=−vxu_y = -v_x; the parts of an analytic function are harmonic.
  • z2z^2, eze^z and sin⁡z\sin z are analytic everywhere, while zˉ\bar{z} and ∣z∣\lvert z \rvert are analytic nowhere.
  • Cauchy's theorem gives ∮f dz=0\oint f\,dz = 0 when ff is analytic inside and on CC.
  • Cauchy's formula gives f(a)=12πi∮f(z)z−a dzf(a) = \dfrac{1}{2\pi i}\oint \dfrac{f(z)}{z - a}\,dz, with n!2πi\dfrac{n!}{2\pi i} for derivatives.
  • A Laurent principal part decides the type: none is removable, finite is a pole, infinite is essential.
  • At a simple pole the residue is lim⁡z→a(z−a)f(z)\lim_{z \to a} (z - a)f(z), or p(a)q′(a)\dfrac{p(a)}{q'(a)}.
  • The residue theorem gives ∮f dz=2πi×(sum of residues inside)\oint f\,dz = 2\pi i \times (\text{sum of residues inside}).

Check yourself

Exam-style questions on this chapter. Pick an answer to see the explanation. 0 of 11 answered

  1. The modulus of z=3+4iz = 3 + 4i is:

  2. Multiplying a complex number by ii rotates it through:

  3. Which function is analytic everywhere?

  4. The harmonic conjugate of u=x2−y2u = x^2 - y^2 is:

  5. ∮z2 dz\oint z^2\,dz round the circle ∣z∣=1\lvert z \rvert = 1 equals:

  6. ∮ezz−1 dz\oint \dfrac{e^z}{z - 1}\,dz round ∣z∣=2\lvert z \rvert = 2 equals:

  7. ∮ezz−3 dz\oint \dfrac{e^z}{z - 3}\,dz round ∣z∣=1\lvert z \rvert = 1 equals:

  8. For f(z)=sin⁡zzf(z) = \dfrac{\sin z}{z}, the point z=0z = 0 is:

  9. For e1/ze^{1/z}, the point z=0z = 0 is:

  10. The residue of z+1z(z−2)\dfrac{z + 1}{z(z - 2)} at z=2z = 2 is:

  11. ∮dzz2+1\oint \dfrac{dz}{z^2 + 1} round ∣z∣=2\lvert z \rvert = 2 equals:

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

Frequently asked questions

What are the Cauchy-Riemann equations?

uₓ = v_y and u_y = −vₓ for f = u + iv.

What is a residue?

The coefficient of 1/(z − a) in the Laurent series about a singularity a.

What does the residue theorem give?

A closed contour integral equals 2πi times the sum of enclosed residues.

What is the modulus of 3 + 4i?

5.

More in this module: Algebra and calculus for engineers

Official sources

Facts in this chapter were checked against these official sources.

  1. GATE 2026 syllabus ME, Section 1 Engineering Mathematics
  2. GATE 2026 syllabus EE, Section 1 Engineering Mathematics
  3. NPTEL Engineering Mathematics - II (IIT Kharagpur, 111105134)