Multivariate Calculus
Multivariate Calculus
1 Lagrange Multipliers
1.1 Introduction
The Lagrange Multiplier Method is a mathematical technique used to find the max-
imum or minimum values of a function subject to a constraint.
It is widely used in:
• Mathematics
• Physics
• Engineering
• Economics
• Optimization problems
f (x, y)
subject to a constraint
g(x, y) = 0.
Instead of solving directly, we introduce a new variable called the Lagrange multi-
plier λ.
∇f = λ∇g,
where:
1
1.4 Steps of Lagrange Multipliers
1.4.1 Step 1: Objective Function
Consider the function to be optimized:
f (x, y) = x2 + y 2 .
2
1.6 Geometrical Meaning
The method works at the point where:
• the level curve of f (x, y)
• touches the constraint curve g(x, y) = 0
At this point, the gradients are parallel.
1.7 Applications
Mathematics
• Optimization problems
Physics
• Energy minimization
Economics
• Profit maximization
• Cost minimization
Engineering
• Design optimization
Machine Learning
• Constrained optimization
x + y = 10 ⇒ 2x = 10 ⇒ x = 5, y = 5.
3
1.8.4 Step 4: Maximum Value
f (5, 5) = 25.
∇
is called the del or gradient operator.
The gradient tells us:
• Calculus
• Physics
• Optimization
• Machine Learning
• Lagrange Multipliers
4
3 Gradient of a Function
Suppose we have a function:
f (x, y)
Its gradient is written as:
∇f
and defined as:
∂f ∂f
∇f = ,
∂x ∂y
This means:
4 Example 1
Find gradient of:
f (x, y) = x2 + y 2
Final Gradient
∇f = (2x, 2y)
This is a vector.
5
5 Meaning of Gradient
At every point (x, y):
∇f = (2x, 2y)
tells us:
∇f = λ∇g
where:
• g(x, y) = 0 = constraint
• λ = Lagrange multiplier
∇f = λ∇g
8 Simple Visualization
Think of climbing a hill.
In optimization:
6
9 Example 2
Given:
f (x, y) = xy
Find gradient.
Gradient
∇f = (y, x)
10 Gradient in 3 Variables
For:
f (x, y, z)
gradient is:
∂f ∂f ∂f
∇f = , ,
∂x ∂y ∂z
Example:
f = x2 + y 2 + z 2
then:
11 Important Terms
Symbol Meaning
∇ Gradient operator
∇f Gradient of function
∂ Partial derivative
Vector Quantity with direction and magnitude
7
12 Short Definition
Gradient is a vector containing all partial derivatives of a function. It points in the
direction of maximum increase of the function.
8
13 Lagrange Multipliers with Two Constraints
When a function has two constraints, we use two Lagrange multipliers.
14 Problem Setup
Suppose we want to maximize or minimize:
f (x, y, z)
subject to two constraints:
g(x, y, z) = 0
and
h(x, y, z) = 0
Then we introduce two multipliers:
λ and µ
15 Main Formula
For two constraints:
∇f = λ∇g + µ∇h
where:
• λ, µ = Lagrange multipliers
f (x, y, z) = x + y + z
9
Step 2: Write Constraints
x2 + y 2 + z 2 = 14
x+y−z =0
Rewrite as:
g(x, y, z) = x2 + y 2 + z 2 − 14 = 0
h(x, y, z) = x + y − z = 0
∇f = (1, 1, 1)
Gradient of g
∇h = (1, 1, −1)
∇f = λ∇g + µ∇h
we get:
1 = 2λx + µ
1 = 2λy + µ
1 = 2λz − µ
along with constraints:
x2 + y 2 + z 2 = 14
10
x+y−z =0
Now solve all equations together.
17 Geometrical Meaning
With one constraint:
At optimum point:
g1 = 0, g2 = 0, g3 = 0
then:
19 Important Idea
Each constraint introduces:
11
21 Simple Summary
For two constraints:
∇f = λ∇g + µ∇h
This method helps find maxima or minima when a function must satisfy two conditions
simultaneously.
• A constraint function g(x, y) = 0 which restricts the motion of the point (x, y).
Geometrically, both f (x, y) and g(x, y) represent curves in the (x, y)-plane.
Geometrical Picture
The function f (x, y) represents a family of level curves
f (x, y) = constant,
∇f = λ∇g.
Physical Interpretation
In physics, the constraint g(x, y) = 0 restricts the motion of a system to a surface or
curve (for example, a particle moving on a wire or surface).
The function f (x, y) represents a physical quantity such as:
• Energy,
• Potential,
12
• or any quantity to be optimized.
• At equilibrium, the force (or gradient of f ) is balanced by the constraint force (given
by λ∇g).
Key Idea
At the optimal point, the curve of f (x, y) just touches the constraint curve
g(x, y) = 0, and both curves share the same direction of steepest change.
Thus, Lagrange multipliers help us find points where a function is optimized under a
restriction by studying how two curves interact geometrically.
13