Maths WorkshopMaths problems with full solutions
Exercise 149Calculus › Single-variable calculus › Differentiation › Optimisation and curve sketchingL1Added 4 Nov 2026

The shortest path touching a line

#optimisation#reflection#geometry#sums of square roots

Statement

Let A=(0,1)A=(0,1) and B=(4,3)B=(4,3). We look for a point M=(x,0)M=(x,0) on the horizontal axis such that the path A→M→BA\to M\to B is as short as possible.

  1. Minimise L(x)=AM+MBL(x)=AM+MB with calculus.
  2. Recover the result geometrically with a reflection.
Hint

L(x)=x2+1+(4−x)2+9L(x)=\sqrt{x^2+1}+\sqrt{(4-x)^2+9}. For part 2, reflect BB in the axis.

Show solutionHide solution

Solution

1. Derivative.
L′(x)=xx2+1−4−x(4−x)2+9.L'(x)=\frac x{\sqrt{x^2+1}}-\frac{4-x}{\sqrt{(4-x)^2+9}}.
L′(x)=0L'(x)=0 means xx2+1=4−x(4−x)2+9\dfrac x{\sqrt{x^2+1}}=\dfrac{4-x}{\sqrt{(4-x)^2+9}}. Both sides must have the same sign, so xx and 4−x4-x have the same sign, i.e. x∈(0,4)x\in(0,4). Squaring,
x2((4−x)2+9)=(4−x)2(x2+1) ⟹ 9x2=(4−x)2 ⟹ 3x=±(4−x),x^2\bigl((4-x)^2+9\bigr)=(4-x)^2(x^2+1)\ \Longrightarrow\ 9x^2=(4-x)^2\ \Longrightarrow\ 3x=\pm(4-x),
and the condition x∈(0,4)x\in(0,4) rejects 3x=−(4−x)3x=-(4-x) (i.e. x=−2x=-2) and keeps 3x=4−x3x=4-x, i.e. x=1x=1.
LL is convex, as a sum of two functions of the form x↦(x−c)2+d2x\mapsto\sqrt{(x-c)^2+d^2} (the norm of an affine function of xx), so this critical point is the global minimum, and
L(1)=2+18=42.L(1)=\sqrt2+\sqrt{18}=4\sqrt2.

2. Reflection. Let B′=(4,−3)B'=(4,-3). For every MM on the axis, MB=MB′MB=MB', so AM+MB=AM+MB′≥AB′=16+16=42AM+MB=AM+MB'\ge AB'=\sqrt{16+16}=4\sqrt2, with equality when MM is on the segment AB′AB'. This segment lies on the line y=1−xy=1-x, which meets the axis at x=1x=1, in agreement with part 1.

Remark. At the optimum, the angles of incidence and reflection are equal: this is the law of reflection of light (Heron of Alexandria's principle).