Course contentsShow
← Mathematics
Lesson 1878 of 3,12140. Multivariable OptimizationFree lesson

Solving Two-Variable Constrained Problems

Working through complete examples of optimizing f(x,y) subject to g(x,y) = k in two dimensions.

Solving Two-Variable Constrained Problems

What You'll Learn

You'll learn how to work through complete examples of finding extrema of a function f(x,y) subject to a constraint g(x,y) = k using the Lagrange multiplier method.

The Complete Solution Process

Now that you've set up the Lagrange system, it's time to solve real problems from start to finish. The process combines everything: identifying the objective function, writing the constraint, forming the Lagrange equations, and solving the system.

The Standard Workflow

Step 1: Identify f(x,y) (what to optimize) and g(x,y) = k (the constraint).

Step 2: Compute gradients ∇f = ⟨f_x, f_y⟩ and ∇g = ⟨g_x, g_y⟩.

Step 3: Write the Lagrange system:

  • f_x = λg_x
  • f_y = λg_y
  • g(x,y) = k

Step 4: Solve for x, y, and λ. Often you'll eliminate λ by dividing equations or substitute one equation into another.

Step 5: Evaluate f at all candidate points to find the maximum or minimum.

Example Walkthrough

Problem: Maximize f(x,y) = xy subject to x + y = 10.

Solution:

  • ∇f = ⟨y, x⟩ and ∇g = ⟨1, 1⟩
  • System: y = λ(1), x = λ(1), x + y = 10
  • From first two equations: y = λ and x = λ, so x = y
  • Substitute into constraint: x + x = 10 → x = 5, y = 5
  • Maximum value: f(5,5) = 25

The key is methodical algebra: eliminate λ early, reduce to fewer variables, then substitute back into the constraint.

Common Techniques

  • Ratio method: Divide one equation by another to eliminate λ
  • Substitution: Solve constraint for one variable, substitute into gradient equations
  • Check endpoints: If the constraint has natural boundaries, test those too

Key Takeaway: Solving constrained optimization problems requires systematically working through the Lagrange equations using algebra to find critical points, then evaluating the objective function to identify the optimum.