Using Lagrange multipliers, find the point on the line 2x+y=5 that minimises f(x,y)=x2+y2, and what is the minimum value?

Linear algebra and optimisation, Constrained optimisation
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can form the Lagrangian for an equality constraint, solve the stationarity equations, and verify the solution.

Key idea

Form L(x,y,ν)=x2+y2+ν(2x+y−5), set all partial derivatives with respect to x, y and the Lagrange multiplier ν to zero, and solve the resulting linear system.

Steps

  1. Write the Lagrangian L(x,y,ν)=x2+y2+ν(2x+y−5), where ν∈R is unrestricted in sign because the constraint is an equality.
  2. Set the stationarity derivatives to zero: ∂L∂x=2x+2ν=0  ⟹  x=−ν, and ∂L∂y=2y+ν=0  ⟹  y=−ν2.
  3. Substitute x and y into the constraint ∂L∂ν=2x+y−5=0: 2(−ν)+(−ν2)=5  ⟹  −52ν=5  ⟹  ν=−2.
  4. Recover (x∗,y∗)=(2,1) and compute the minimum value f(2,1)=22+12=5. Geometrically, (2,1) is the orthogonal projection of the origin (0,0) onto the line 2x+y=5, and its squared distance is 52/(22+12)=5.

Common mistakes

How long your answer should be

Half a page; 3 minutes.

Last checked on 4 December 2026.

Read this

Previous in Linear algebra and optimisation: For what values of the constant c is f(x,y)=2x2+2cxy+8y2−12x−24y convex, for what values is it strictly convex, and what is its minimum when c=2?
Next in Linear algebra and optimisation: How does projected gradient descent handle a closed convex constraint set C, what is the Euclidean projection onto (a) a box [li,ui] and (b) the non-negative orthant R+d, and what does one step from (x0,y0)=(2,1) with η=0.5 give for min⁡x≥0, y≥0(x−1)2+(y+2)2?