24. Polar coordinates and polar curves

📖 Reading · 10 min
💡 Every code box below is live — edit it and hit Run.

Cartesian coordinates locate a point by two perpendicular distances. Polar coordinates locate it by a distance and an angle instead — a choice that turns some of the ugliest Cartesian curves (spirals, flowers, hearts) into short, clean equations, at the cost of needing new versions of derivative and area formulas. This lesson sets up the coordinate system and its curves; §6.3 adapts area and arc length to it.

The coordinate system

A point is located by (r,\theta): r is the distance from the origin (the pole), and \theta is the angle from the positive x-axis, measured counterclockwise — the same angle convention as radians in §0.4. Converting to and from Cartesian coordinates uses exactly the right-triangle relationships behind \sin and \cos:

x=r\cos\theta,\qquad y=r\sin\theta,\qquad r^2=x^2+y^2,\qquad\tan\theta=\frac yx

Polar coordinates are not unique. The same point has infinitely many representations — (r,\theta) and (r,\theta+2\pi) coincide, and (-r,\theta) is conventionally the point reached by going distance r in the opposite direction, which lands at the same place as (r,\theta+\pi). This non-uniqueness is a real source of subtlety later, particularly for area (§6.3), where a region can be swept out by more than one range of \theta.

Polar curves as r=f(\theta)

A polar curve is usually given as r in terms of \theta — for each angle, how far out the curve sits. This is secretly a parametric curve with parameter \theta:

x(\theta)=f(\theta)\cos\theta,\qquad y(\theta)=f(\theta)\sin\theta

which means §6.0 and §6.1's parametric derivative and arc-length formulas apply immediately, once x and y are written this way — polar curves don't need brand-new calculus, just this one substitution.

Common shapes:

  • r=a (constant): a circle of radius a centered at the origin — every angle, same distance out.
  • \theta=c (constant): a ray from the origin at angle c — every distance, same angle.
  • r=a\cos\theta: a circle of diameter a, passing through the origin, centered on the positive x-axis (not obvious from the equation alone — worth confirming by converting to Cartesian).
  • r=a(1+\cos\theta): a cardioid — a heart-shaped curve with a cusp at the origin (r=0 when \theta=\pi).
  • r=a\cos(n\theta): a rose curve with n petals if n is odd, 2n petals if n is even.

The tangent line in polar form

Since a polar curve is parametric with parameter \theta, §6.0's formula applies directly:

\frac{dy}{dx}=\frac{dy/d\theta}{dx/d\theta}=\frac{f'(\theta)\sin\theta+f(\theta)\cos\theta}{f'(\theta)\cos\theta-f(\theta)\sin\theta}

obtained by product-ruling x=f(\theta)\cos\theta and y=f(\theta)\sin\theta before dividing — not \frac{dr}{d\theta} by itself, which is a common shortcut mistake. \frac{dr}{d\theta} measures how fast the curve moves outward; \frac{dy}{dx} measures the slope of the tangent line, and the two only coincide in special cases (like \theta=0, where the curve happens to be moving purely radially).

Doing it in Python

Converting the circle r=a\cos\theta to Cartesian form, to confirm the claim above:

import sympy as sp

theta, a, x, y, r = sp.symbols('theta a x y r', positive=True)

# start from r = a cos(theta), multiply both sides by r
# r^2 = a r cos(theta)  ->  x^2+y^2 = a x
lhs = x**2 + y**2
rhs = a * x
completed = sp.expand((x - a/2)**2 + y**2 - (a/2)**2)
print(f"x^2 + y^2 - a*x, completed the square: {sp.simplify(completed)}")
print("this is (x - a/2)^2 + y^2 = (a/2)^2 -- a circle of radius a/2")
print("centered at (a/2, 0), i.e. diameter a, passing through the origin")

The tangent slope of a cardioid, computed the correct way — through x(\theta) and y(\theta), not directly from dr/d\theta:

import sympy as sp

theta = sp.Symbol('theta')
r = 1 + sp.cos(theta)   # cardioid
x = r * sp.cos(theta)
y = r * sp.sin(theta)

dx_dtheta = sp.diff(x, theta)
dy_dtheta = sp.diff(y, theta)
dy_dx = sp.simplify(dy_dtheta / dx_dtheta)
print(f"dy/dx = {dy_dx}")
print(f"at theta = pi/2: {dy_dx.subs(theta, sp.pi/2)}")

Plotting a rose curve's shape by sampling — confirming a 3-petal rose from r=\cos(3\theta):

from math import cos, sin, pi

def polar_to_xy(r_func, theta):
    r = r_func(theta)
    return r * cos(theta), r * sin(theta)

r_func = lambda th: cos(3 * th)

# sample and report where r crosses zero (petal tips are where |r| peaks)
n = 12
print(f"{'theta/pi':>10} {'r':>8}")
for i in range(n + 1):
    th = i * pi / n
    r = r_func(th)
    print(f"{th/pi:>10.3f} {r:>8.3f}")
print("\nr crosses zero 3 times over [0, pi] -- a 3-petal rose,")
print("consistent with n petals for odd n = 3")

Worked example

Find the slope of the tangent line to the cardioid r=1+\cos\theta at \theta=\frac\pi2.

x=(1+\cos\theta)\cos\theta,\qquad y=(1+\cos\theta)\sin\theta

By the product rule:

\frac{dx}{d\theta}=-\sin\theta\cos\theta+(1+\cos\theta)(-\sin\theta)=-\sin\theta\big(\cos\theta+1+\cos\theta\big)=-\sin\theta(1+2\cos\theta)

\frac{dy}{d\theta}=-\sin\theta\sin\theta+(1+\cos\theta)\cos\theta=-\sin^2\theta+\cos\theta+\cos^2\theta

At \theta=\frac\pi2: \sin\theta=1, \cos\theta=0.

\frac{dx}{d\theta}=-1(1+0)=-1,\qquad\frac{dy}{d\theta}=-1+0+0=-1

\frac{dy}{dx}=\frac{-1}{-1}=\boxed{1}

Sanity check. At \theta=\frac\pi2, r=1+\cos\frac\pi2=1, so the point is (x,y)=(0,1) — the top of the cardioid, where by the shape's left-right symmetry (it's symmetric about the x-axis, since r(\theta)=r(-\theta) for cosine) you'd expect the tangent to run at a "clean" angle rather than something asymmetric. A slope of exactly 1 (45°) is a plausible clean value for a point sitting at the curve's top. ✓

Your turn

1. Convert the polar point (r,\theta)=\left(4,\frac{2\pi}3\right) to Cartesian coordinates.

2. Identify the curve r=4\sin\theta by converting to Cartesian (same technique as the worked r=a\cos\theta example, multiply both sides by r first).

3. True or false: the point with Cartesian coordinates (0,0) has a unique polar representation.

Solutions

1.

x=4\cos\frac{2\pi}3=4\left(-\frac12\right)=-2,\qquad y=4\sin\frac{2\pi}3=4\left(\frac{\sqrt3}2\right)=2\sqrt3

(x,y)=\boxed{(-2,2\sqrt3)}

2. Multiply both sides by r: $r^2=4r\sin\theta\Rightarrow x^2+y^2=4y\Rightarrow x^2+y^2-4y=0$. Complete the square:

x^2+(y-2)^2=4

\boxed{\text{a circle of radius 2, centered at }(0,2)}

— the \sin\theta analogue of the worked example's \cos\theta circle, reflected onto the y-axis instead of the x-axis.

3. False. The origin has r=0 at every angle \theta — infinitely many polar representations (0,\theta) for any \theta all describe the same point, the most extreme case of polar coordinates' general non-uniqueness. This is exactly why area calculations near the origin (§6.3) need extra care: a curve can pass through the pole at more than one \theta-value without those values being related by a simple 2\pi-shift.

Check yourself in code

For the cardioid r=1+\cos\theta, compute \frac{dy}{dx} symbolically and evaluate it at \theta=\frac\pi2.

Print exactly this:

dy/dx = -(cos(theta) + cos(2*theta))/(sin(theta) + sin(2*theta))
at theta=pi/2: 1
import sympy as sp

theta = sp.Symbol('theta')
r = 1 + sp.cos(theta)
x = r * sp.cos(theta)
y = r * sp.sin(theta)

dx_dtheta = sp.diff(x, theta)
dy_dtheta = sp.diff(y, theta)
dy_dx = sp.simplify(dy_dtheta / dx_dtheta)
print("dy/dx = ...")
print("at theta=pi/2: ...")
import sympy as sp

theta = sp.Symbol('theta')
r = 1 + sp.cos(theta)
x = r * sp.cos(theta)
y = r * sp.sin(theta)

dx_dtheta = sp.diff(x, theta)
dy_dtheta = sp.diff(y, theta)
dy_dx = sp.simplify(dy_dtheta / dx_dtheta)
print(f"dy/dx = {dy_dx}")
print(f"at theta=pi/2: {dy_dx.subs(theta, sp.pi/2)}")

Polar coordinates trade (x,y) for (r,\theta), and a polar curve r=f(\theta) is a parametric curve in disguise — §6.0's tangent-slope formula applies once x=f(\theta)\cos\theta and y=f(\theta)\sin\theta are written out, and it is emphatically not the same as \frac{dr}{d\theta}. Circles, cardioids, and rose curves all get compact polar equations that would be painful or impossible to write cleanly as y=f(x) — the entire reason to switch coordinate systems in the first place.

Next: area and arc length, rebuilt one more time — this time for regions and curves described by angle and radius instead of by x.