Maths WorkshopMaths problems with full solutions
Exercise 1595Calculus › Multivariable calculus › Optimisation in several variablesL1Added 3 Nov 2026

Shortest distance from a point to a line

#Lagrange#distance#line

Statement

Find the shortest distance from the origin to the line 2x+y=52x+y=5.

Hint

Minimize x2+y2x^2+y^2 under 2x+y=52x+y=5.

Show solutionHide solution

Solution

Lagrange. 2x=2λ2x=2\lambda, 2y=λ2y=\lambda, so y=x/2y=x/2. Constraint gives 2x+x/2=52x+x/2=5, x=2x=2, y=1y=1.

Distance. 4+1=5\sqrt{4+1}=\sqrt5.

Conclusion. Distance =5=\sqrt5.