Advanced Physics‹›⌂ 0:00 studied

Module 22 · 10 min read · Free chapter

Vector calculus: gradient, divergence and curl, line and surface integrals, Gauss and Stokes theorems, curvilinear coordinates

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

Start from zero: fields everywhere

A weather map shows a temperature at every point (a scalar field) and wind arrows at every point (a vector field). Physics is full of such fields: gravitational potential, electric field, fluid velocity, magnetic flux density. Vector calculus is the language for asking how a field changes from place to place.

Three questions cover almost everything.

Which way is the field increasing fastest (gradient)? Is something flowing out of a point (divergence)? Is the flow swirling round a point (curl)? Two theorems then connect what happens inside a region to what happens on its boundary.

The del operator and the gradient

In Cartesian coordinates the vector differential operator is

∇=i^∂∂x+j^∂∂y+k^∂∂z\nabla = \hat{i}\frac{\partial}{\partial x} + \hat{j}\frac{\partial}{\partial y} + \hat{k}\frac{\partial}{\partial z}

Acting on a scalar field ϕ(x,y,z)\phi(x, y, z) it gives the gradient:

∇ϕ=∂ϕ∂xi^+∂ϕ∂yj^+∂ϕ∂zk^\nabla\phi = \frac{\partial\phi}{\partial x}\hat{i} + \frac{\partial\phi}{\partial y}\hat{j} + \frac{\partial\phi}{\partial z}\hat{k}

Meaning. For a small step dr⃗d\vec{r}, the change is dϕ=∇ϕ⋅dr⃗=∣∇ϕ∣ drcos⁡θd\phi = \nabla\phi\cdot d\vec{r} = \lvert\nabla\phi\rvert\,dr\cos\theta. This is largest when the step is along ∇ϕ\nabla\phi, so the gradient points in the direction of steepest ascent and its magnitude is the maximum rate of change. Along a level surface (ϕ\phi = constant) dϕ=0d\phi = 0, so ∇ϕ\nabla\phi is normal to that surface.

The directional derivative along a unit vector n^\hat{n} is dϕds=∇ϕ⋅n^\dfrac{d\phi}{ds} = \nabla\phi\cdot\hat{n}.

Worked example. For ϕ=x2y+yz3\phi = x^2y + yz^3 at (1, 2, 1): ∇ϕ=2xy i^+(x2+z3)j^+3yz2k^=4i^+2j^+6k^\nabla\phi = 2xy\,\hat{i} + (x^2 + z^3)\hat{j} + 3yz^2\hat{k} = 4\hat{i} + 2\hat{j} + 6\hat{k}. The unit normal to the surface ϕ\phi = 4 there is 4i^+2j^+6k^56\dfrac{4\hat{i} + 2\hat{j} + 6\hat{k}}{\sqrt{56}}.

In physics. A conservative force is F⃗=−∇U\vec{F} = -\nabla U; the electric field is E⃗=−∇V\vec{E} = -\nabla V; heat flows down the temperature gradient, q⃗=−K∇T\vec{q} = -K\nabla T (Fourier's law).

Divergence, curl and the Laplacian

Divergence of A⃗=Axi^+Ayj^+Azk^\vec{A} = A_x\hat{i} + A_y\hat{j} + A_z\hat{k}:

∇⋅A⃗=∂Ax∂x+∂Ay∂y+∂Az∂z\nabla\cdot\vec{A} = \frac{\partial A_x}{\partial x} + \frac{\partial A_y}{\partial y} + \frac{\partial A_z}{\partial z}

Physically, it is the net outward flux per unit volume from a tiny box around the point:

∇⋅A⃗=lim⁡ΔV→01ΔV∮A⃗⋅dS⃗\nabla\cdot\vec{A} = \lim_{\Delta V\to 0}\frac{1}{\Delta V}\oint\vec{A}\cdot d\vec{S}

Positive divergence marks a source, negative a sink, zero a field that is solenoidal (as much flows in as out). Examples: ∇⋅E⃗=ρε0\nabla\cdot\vec{E} = \dfrac{\rho}{\varepsilon_0} (charges are sources) and ∇⋅B⃗=0\nabla\cdot\vec{B} = 0 (no magnetic monopoles). For an incompressible fluid ∇⋅v⃗=0\nabla\cdot\vec{v} = 0.

Curl:

∇×A⃗=∣i^j^k^∂∂x∂∂y∂∂zAxAyAz∣\nabla\times\vec{A} = \begin{vmatrix}\hat{i} & \hat{j} & \hat{k}\\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z}\\ A_x & A_y & A_z\end{vmatrix}

Its component along n^\hat{n} is the circulation per unit area of a tiny loop normal to n^\hat{n}. A small paddle wheel placed in a flow spins if the curl is non-zero. For a rigidly rotating body, v⃗=ω⃗×r⃗\vec{v} = \vec{\omega}\times\vec{r} gives ∇×v⃗=2ω⃗\nabla\times\vec{v} = 2\vec{\omega}.

Worked example. A⃗=x2y i^−2xz j^+2yz k^\vec{A} = x^2y\,\hat{i} - 2xz\,\hat{j} + 2yz\,\hat{k}. Divergence =2xy+0+2y= 2xy + 0 + 2y. Curl =(2z+2x)i^+0 j^+(−2z−x2)k^= (2z + 2x)\hat{i} + 0\,\hat{j} + (-2z - x^2)\hat{k}.

Laplacian. ∇⋅∇ϕ=∇2ϕ=∂2ϕ∂x2+∂2ϕ∂y2+∂2ϕ∂z2\nabla\cdot\nabla\phi = \nabla^2\phi = \dfrac{\partial^2\phi}{\partial x^2} + \dfrac{\partial^2\phi}{\partial y^2} + \dfrac{\partial^2\phi}{\partial z^2}. It measures how much ϕ\phi at a point differs from its average nearby. It appears in Poisson's equation ∇2V=−ρε0\nabla^2 V = -\dfrac{\rho}{\varepsilon_0}, the wave equation and the heat equation (partial differential equations).

Standard identities (proved by writing out components):

  • ∇×(∇ϕ)=0\nabla\times(\nabla\phi) = 0: a gradient field has no curl.
  • ∇⋅(∇×A⃗)=0\nabla\cdot(\nabla\times\vec{A}) = 0: a curl field has no divergence, which is why B⃗=∇×A⃗\vec{B} = \nabla\times\vec{A}.
  • ∇⋅(ϕA⃗)=ϕ ∇⋅A⃗+A⃗⋅∇ϕ\nabla\cdot(\phi\vec{A}) = \phi\,\nabla\cdot\vec{A} + \vec{A}\cdot\nabla\phi.
  • ∇×(∇×A⃗)=∇(∇⋅A⃗)−∇2A⃗\nabla\times(\nabla\times\vec{A}) = \nabla(\nabla\cdot\vec{A}) - \nabla^2\vec{A}, used to derive the EM wave equation.

Conservative fields. These statements are equivalent for a field in a simply connected region: ∇×F⃗=0\nabla\times\vec{F} = 0; F⃗=−∇U\vec{F} = -\nabla U; ∮F⃗⋅dl⃗=0\oint\vec{F}\cdot d\vec{l} = 0; the line integral between two points is independent of path.

Integral theorems: Gauss, Stokes and Green

Line integral ∫CF⃗⋅dl⃗\int_C\vec{F}\cdot d\vec{l} (work done along a path), surface integral ∫SA⃗⋅dS⃗\int_S\vec{A}\cdot d\vec{S} (flux through a surface, dS⃗=n^ dSd\vec{S} = \hat{n}\,dS with n^\hat{n} outward for a closed surface), and volume integral ∫Vϕ dV\int_V\phi\,dV.

Gauss's divergence theorem. For a closed surface S enclosing volume V:

∮SA⃗⋅dS⃗=∫V(∇⋅A⃗) dV\oint_S\vec{A}\cdot d\vec{S} = \int_V(\nabla\cdot\vec{A})\,dV

Proof idea. Split V into tiny cubes. For each, the outward flux equals (∇⋅A⃗) ΔV(\nabla\cdot\vec{A})\,\Delta V by the definition of divergence. On every interior face two neighbouring cubes have opposite normals, so their fluxes cancel, leaving only the flux through the outer surface S.

Use. Applying it to Gauss's law ∮E⃗⋅dS⃗=1ε0∫ρ dV\oint\vec{E}\cdot d\vec{S} = \dfrac{1}{\varepsilon_0}\int\rho\,dV for any volume gives ∇⋅E⃗=ρε0\nabla\cdot\vec{E} = \dfrac{\rho}{\varepsilon_0}. The same step turns the conservation of charge into the continuity equation ∇⋅J⃗+∂ρ∂t=0\nabla\cdot\vec{J} + \dfrac{\partial\rho}{\partial t} = 0.

Stokes's theorem. For an open surface S bounded by the closed curve C (orientation by the right-hand rule):

∮CA⃗⋅dl⃗=∫S(∇×A⃗)⋅dS⃗\oint_C\vec{A}\cdot d\vec{l} = \int_S(\nabla\times\vec{A})\cdot d\vec{S}

Tile S with tiny loops; circulation round each is (∇×A⃗)⋅n^ ΔS(\nabla\times\vec{A})\cdot\hat{n}\,\Delta S, and shared interior edges are traversed in opposite directions and cancel. From Ampère's law ∮B⃗⋅dl⃗=μ0∫J⃗⋅dS⃗\oint\vec{B}\cdot d\vec{l} = \mu_0\int\vec{J}\cdot d\vec{S} it gives ∇×B⃗=μ0J⃗\nabla\times\vec{B} = \mu_0\vec{J} (Maxwell's equations).

Green's theorem in the plane is Stokes's theorem for a flat region R in the xy-plane:

∮C(M dx+N dy)=∬R(∂N∂x−∂M∂y)dx dy\oint_C(M\,dx + N\,dy) = \iint_R\left(\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y}\right)dx\,dy

Taking M = −y and N = x gives area =12∮(x dy−y dx)= \dfrac{1}{2}\oint(x\,dy - y\,dx).

Worked example (verify Gauss). A⃗=xi^+yj^+zk^\vec{A} = x\hat{i} + y\hat{j} + z\hat{k} over a sphere of radius R. ∇⋅A⃗\nabla\cdot\vec{A} = 3, so the volume integral is 3⋅43πR3=4πR33\cdot\dfrac{4}{3}\pi R^3 = 4\pi R^3. On the surface A⃗⋅n^=R\vec{A}\cdot\hat{n} = R, so the flux is R⋅4πR2=4πR3R\cdot 4\pi R^2 = 4\pi R^3. Both sides agree.

Worked example (verify Stokes). A⃗=−yi^+xj^\vec{A} = -y\hat{i} + x\hat{j} round the circle x2+y2=a2x^2 + y^2 = a^2. On the circle x=acos⁡tx = a\cos t, y=asin⁡ty = a\sin t, so ∮A⃗⋅dl⃗=∫02πa2 dt=2πa2\oint\vec{A}\cdot d\vec{l} = \int_0^{2\pi}a^2\,dt = 2\pi a^2. And ∇×A⃗=2k^\nabla\times\vec{A} = 2\hat{k}, so the surface integral is 2πa22\pi a^2.

Curvilinear coordinates

Problems with spherical or cylindrical symmetry are easier in matching coordinates. For orthogonal coordinates (u1,u2,u3)(u_1, u_2, u_3) with scale factors hih_i (so that dli=hi duidl_i = h_i\,du_i):

∇ϕ=∑i1hi∂ϕ∂uie^i,∇⋅A⃗=1h1h2h3[∂∂u1(h2h3A1)+∂∂u2(h3h1A2)+∂∂u3(h1h2A3)]\nabla\phi = \sum_i\frac{1}{h_i}\frac{\partial\phi}{\partial u_i}\hat{e}_i, \qquad \nabla\cdot\vec{A} = \frac{1}{h_1h_2h_3}\left[\frac{\partial}{\partial u_1}(h_2h_3A_1) + \frac{\partial}{\partial u_2}(h_3h_1A_2) + \frac{\partial}{\partial u_3}(h_1h_2A_3)\right]
System Coordinates Scale factors Volume element
Cartesian x, y, z 1, 1, 1 dx dy dz
cylindrical ρ, φ, z 1, ρ, 1 ρ dρ dφ dz
spherical polar r, θ, φ 1, r, r sin θ r² sin θ dr dθ dφ

Spherical Laplacian:

∇2ϕ=1r2∂∂r(r2∂ϕ∂r)+1r2sin⁡θ∂∂θ(sin⁡θ∂ϕ∂θ)+1r2sin⁡2θ∂2ϕ∂φ2\nabla^2\phi = \frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial\phi}{\partial r}\right) + \frac{1}{r^2\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial\phi}{\partial\theta}\right) + \frac{1}{r^2\sin^2\theta}\frac{\partial^2\phi}{\partial\varphi^2}

Worked example. Show that ϕ=1r\phi = \dfrac{1}{r} satisfies Laplace's equation for r ≠ 0. Only the radial part matters: r2dϕdr=−1r^2\dfrac{d\phi}{dr} = -1, whose derivative is 0. So ∇2(1r)=0\nabla^2\left(\dfrac{1}{r}\right) = 0 away from the origin.

At the origin, Gauss's theorem shows that ∇2(1r)=−4π δ3(r⃗)\nabla^2\left(\dfrac{1}{r}\right) = -4\pi\,\delta^3(\vec{r}). That is why the potential of a point charge solves Poisson's equation.

Also note ∇⋅(r^r2)=0\nabla\cdot\left(\dfrac{\hat{r}}{r^2}\right) = 0 except at r = 0, where the flux through any enclosing sphere is 4π4\pi.

Geophysics link. Gravity and magnetic potentials outside the Earth satisfy ∇2ϕ=0\nabla^2\phi = 0 in spherical coordinates. Their solutions are spherical harmonics, which are used to model the geoid and the geomagnetic field (the IGRF model).

Mains lens: how UPSC asks this

Vector calculus is tested inside electrodynamics and fluid questions in the CSE and IFoS papers, and directly in Geo-Scientist Geophysics (Part A3 and B1) and NET Part A.

Expect:

  • State and prove Gauss's divergence theorem or Stokes's theorem (10 marks).
  • Verify a theorem for a given field and surface (10 to 15 marks, a pure calculation).
  • Show that a field is conservative and find its potential.
  • Prove an identity such as ∇×(∇×A⃗)=∇(∇⋅A⃗)−∇2A⃗\nabla\times(\nabla\times\vec{A}) = \nabla(\nabla\cdot\vec{A}) - \nabla^2\vec{A}.
  • Derive the differential forms of Maxwell's equations using the theorems.

Model answer plan: "State Gauss's divergence theorem and verify it for F⃗=4xz i^−y2j^+yz k^\vec{F} = 4xz\,\hat{i} - y^2\hat{j} + yz\,\hat{k} over the unit cube." (15 marks).

  1. Statement with a sketch of the closed surface and outward normals.
  2. ∇⋅F⃗=4z−2y+y=4z−y\nabla\cdot\vec{F} = 4z - 2y + y = 4z - y; volume integral over the cube =2−12=32= 2 - \dfrac{1}{2} = \dfrac{3}{2}.
  3. Six faces: x = 1 gives 2, y = 1 gives −1, z = 1 gives 12\dfrac{1}{2}, the three faces through the origin give 0.
  4. Total flux =32= \dfrac{3}{2}, equal to the volume integral.
  5. Comment: physical meaning as net outflow equals total source strength.

Quick revision

  • ∇ϕ\nabla\phi: steepest ascent, normal to level surfaces; dϕ=∇ϕ⋅dr⃗d\phi = \nabla\phi\cdot d\vec{r}.
  • ∇⋅A⃗\nabla\cdot\vec{A}: flux per volume (source); ∇×A⃗\nabla\times\vec{A}: circulation per area (rotation).
  • Gauss: ∮SA⃗⋅dS⃗=∫V∇⋅A⃗ dV\oint_S\vec{A}\cdot d\vec{S} = \int_V\nabla\cdot\vec{A}\,dV; Stokes: ∮CA⃗⋅dl⃗=∫S(∇×A⃗)⋅dS⃗\oint_C\vec{A}\cdot d\vec{l} = \int_S(\nabla\times\vec{A})\cdot d\vec{S}.
  • curl grad = 0; div curl = 0; curl curl = grad div − ∇2\nabla^2.
  • Conservative: curl zero, potential exists, path independent (simply connected).
  • Spherical scale factors 1, r, r sin θ; ∇2(1r)=−4πδ3(r⃗)\nabla^2\left(\dfrac{1}{r}\right) = -4\pi\delta^3(\vec{r}).

Mains answer practice

Write your answer first, then open the points a good answer should cover.

  1. Find the gradient of φ = x²y + yz³ at (1, 2, 1) and the unit normal to the surface φ = 4 at that point. What is the directional derivative along (î + ĵ)/√2?

    Show answer points
    • ∇φ = 2xy î + (x² + z³) ĵ + 3yz² k̂
    • At (1, 2, 1): ∇φ = 4î + 2ĵ + 6k̂
    • Unit normal = (4î + 2ĵ + 6k̂)/√56
    • Directional derivative = ∇φ·n̂ = 6/√2 = 3√2
  2. Explain the physical meaning of divergence and curl of a vector field with examples. Show that for a rigidly rotating body ∇ × v = 2ω.

    Show answer points
    • Divergence = net outward flux per unit volume: source or sink; ∇·E = ρ/ε0, ∇·B = 0
    • Curl = circulation per unit area; paddle-wheel picture
    • v = ω × r with ω constant
    • ∇ × (ω × r) = ω(∇·r) − (ω·∇)r = 3ω − ω = 2ω
    • Zero curl means irrotational, conservative with a scalar potential
  3. State Gauss's divergence theorem and verify it for F = 4xz î − y² ĵ + yz k̂ over the unit cube 0 ≤ x, y, z ≤ 1.

    Show answer points
    • Statement: closed-surface flux equals volume integral of divergence
    • ∇·F = 4z − 2y + y = 4z − y
    • Volume integral = 2 − 1/2 = 3/2
    • Faces: x = 1 gives 2, y = 1 gives −1, z = 1 gives 1/2, faces through origin give 0
    • Total flux 3/2 equals volume integral; theorem verified
  4. State Stokes's theorem. Using it, derive the differential form of Ampère's law, and verify the theorem for A = −y î + x ĵ round the circle x² + y² = a².

    Show answer points
    • Statement with right-hand orientation of surface normal
    • ∮B·dl = μ0∫J·dS for any surface gives ∫(∇×B − μ0J)·dS = 0, so ∇×B = μ0J
    • Line integral with x = a cos t, y = a sin t: ∫a² dt = 2πa²
    • ∇×A = 2k̂, surface integral = 2 × πa² = 2πa²
    • Both sides equal
  5. Write the Laplacian in spherical polar coordinates. Show that ∇²(1/r) = 0 for r ≠ 0 and explain what happens at the origin.

    Show answer points
    • Scale factors 1, r, r sin θ
    • Full spherical Laplacian expression
    • Radial part: r² d(1/r)/dr = −1, derivative zero, so ∇²(1/r) = 0 for r ≠ 0
    • Flux of ∇(1/r) through any sphere = −4π, so ∇²(1/r) = −4πδ³(r)
    • Point charge potential solves Poisson's equation

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 →

More in this module: Mathematical physics

Official sources

Facts in this chapter were checked against these official sources.

  1. IGNOU PHE-04 Mathematical Methods in Physics I: vector analysis
  2. MIT OpenCourseWare 18.02 Multivariable Calculus