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

Distance to a line, without a formula

#optimisation#distance#line#quadratic function

Statement

Find the point of the line 3x+4y=103x+4y=10 closest to the origin, and the distance from the origin to the line.

Hint

Write yy in terms of xx and minimise the squared distance x2+y2x^2+y^2.

Show solutionHide solution

Solution

Squared distance. y=10−3x4y=\dfrac{10-3x}4, so
D(x)=x2+(10−3x)216=25x2−60x+10016.D(x)=x^2+\frac{(10-3x)^2}{16}=\frac{25x^2-60x+100}{16}.
Minimising DD (the squared distance) is equivalent to minimising the distance, since the square root is increasing.

Minimum. D′(x)=50x−6016=0  ⟺  x=65D'(x)=\dfrac{50x-60}{16}=0\iff x=\dfrac65, hence y=10−18/54=85y=\dfrac{10-18/5}4=\dfrac85. DD is a convex parabola, so this is the global minimum, and D(65)=36+6425=4D\left(\frac65\right)=\frac{36+64}{25}=4.

Answer. The closest point is (65,85)\left(\frac65,\frac85\right) and the distance is 4=2\sqrt4=2.

Check. The formula ∣3⋅0+4⋅0−10∣32+42=105=2\dfrac{|3\cdot0+4\cdot0-10|}{\sqrt{3^2+4^2}}=\frac{10}5=2 agrees. Also, the vector (65,85)\left(\frac65,\frac85\right) is proportional to the normal vector (3,4)(3,4) of the line, as it must be.