4.1.31Calculus I — Limits & Derivatives

Optimization — constrained, unconstrained, real-world problems

1,720 words8 min readdifficulty · medium2 backlinks

WHY does the derivative vanish at an extremum?


Deriving the classification test from scratch

We want a way to tell a peak from a valley. Use the Taylor expansion near a critical point cc (where f(c)=0f'(c)=0):

f(c+h)=f(c)+f(c)h+12f(c)h2+f(c+h) = f(c) + f'(c)h + \tfrac{1}{2}f''(c)h^2 + \cdots

Since f(c)=0f'(c)=0, the leading change is

f(c+h)f(c)12f(c)h2.f(c+h) - f(c) \approx \tfrac{1}{2}f''(c)\,h^2.

Why this step? h2>0h^2>0 for any small h0h\neq 0, so the sign of f(c)f''(c) alone decides whether ff goes up or down on both sides.


Unconstrained vs Constrained — WHAT is the difference?

Why Lagrange multipliers? (geometric derivation)

At a constrained optimum we move along the curve g=0g=0. We can't increase ff while staying on the curve only when ff stops changing along the curve — i.e. f\nabla f has no component tangent to g=0g=0. That means f\nabla f is parallel to g\nabla g:

f=λg,g(x,y)=0.\boxed{\nabla f = \lambda \nabla g}, \qquad g(x,y)=0.

Why this step? g\nabla g is perpendicular to the constraint curve; if f\nabla f is also perpendicular, no tangent direction can improve ff. The scalar λ\lambda measures how much the optimum would change if the constraint loosened.


The universal recipe (the 80/20 core)

Figure — Optimization — constrained, unconstrained, real-world problems

Worked Example 1 — Box of maximum volume (constrained → 1-D)

A 12 cm × 12 cm sheet has equal squares of side xx cut from each corner; flaps fold up into an open box. Maximize volume.

  • Dimensions after folding: base (122x)(12-2x), height xx.
  • V(x)=x(122x)2V(x) = x(12-2x)^2, valid for 0x60 \le x \le 6. Why? x<0x<0 meaningless, x>6x>6 gives negative base.

Differentiate (product rule): V(x)=(122x)2+x2(122x)(2)=(122x)[(122x)4x].V'(x) = (12-2x)^2 + x\cdot 2(12-2x)(-2) = (12-2x)\big[(12-2x) - 4x\big]. Why factor? It instantly reveals roots. V(x)=(122x)(126x)=0x=6 or x=2.V'(x) = (12-2x)(12-6x) = 0 \Rightarrow x = 6 \text{ or } x = 2.

Classify by endpoints: V(0)=0, V(6)=0, V(2)=2(8)2=128V(0)=0,\ V(6)=0,\ V(2)=2(8)^2=128. So x=2x=2 gives maximum volume 128 cm3128\ \text{cm}^3.


Worked Example 2 — Closest point (substitution)

Find the point on the line y=2x+1y = 2x + 1 nearest the origin.

Minimize distance, but minimize D2D^2 instead of DD. Why? \sqrt{\cdot} is increasing, so the minimizer is the same and algebra is cleaner. S(x)=x2+y2=x2+(2x+1)2=5x2+4x+1.S(x) = x^2 + y^2 = x^2 + (2x+1)^2 = 5x^2 + 4x + 1. S(x)=10x+4=0x=25.S'(x) = 10x + 4 = 0 \Rightarrow x = -\tfrac{2}{5}. S(x)=10>0S''(x) = 10 > 0 → minimum. Then y=2(25)+1=15y = 2(-\tfrac25)+1 = \tfrac15.

Nearest point: (25, 15)\left(-\tfrac25,\ \tfrac15\right), distance =S=15=15=\sqrt{S}= \sqrt{\tfrac15}=\tfrac{1}{\sqrt5}. Sanity check: the segment to this point should be perpendicular to the line (slope 12-\tfrac12 vs line slope 22, product =1=-1 ✓).


Worked Example 3 — Lagrange multipliers

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

Set f=λg\nabla f = \lambda\nabla g with g=x+y10g = x+y-10: y=λ,x=λx=y.y = \lambda,\quad x = \lambda \Rightarrow x = y. Why? Both partials of gg are 11, so fx=fyy=xf_x=f_y \Rightarrow y=x. Constraint gives 2x=10x=y=52x=10 \Rightarrow x=y=5, so max product =25=25.

This recovers the famous result: among numbers with fixed sum, the product is largest when they are equal (AM–GM in disguise).


Recall Feynman: explain to a 12-year-old

Picture a roller-coaster track. At the very top of a hill the track is flat for a split second — that flatness is "the slope equals zero." So to find the highest or lowest spots, find where the track goes flat, then look around to see if it's a hilltop or a dip. If you're stuck on a path (a fence you must walk along), you stop being able to climb higher only when "uphill" points straight across the fence — that's the Lagrange idea.


Flashcards

What must f(c)f'(c) satisfy at an interior extremum of a differentiable function?
f(c)=0f'(c)=0 (Fermat's Theorem).
Is every critical point an extremum?
No — e.g. x3x^3 at 00 is an inflection; critical points are only candidates.
Second-derivative test: f(c)=0, f(c)>0f'(c)=0,\ f''(c)>0 implies?
Local minimum.
Second-derivative test: f(c)<0f''(c)<0 implies?
Local maximum.
When the 2nd-derivative test fails (f=0f''=0), what do you use?
The first-derivative sign test.
Why minimize D2D^2 instead of DD for distance problems?
\sqrt{\cdot} is increasing, so minimizers coincide and algebra is simpler.
Lagrange condition for optimizing ff s.t. g=0g=0?
f=λg\nabla f = \lambda\nabla g with g=0g=0.
Geometric meaning of f=λg\nabla f = \lambda\nabla g?
f\nabla f is perpendicular to the constraint curve, so no tangent move improves ff.
In the open-box problem, what domain restricts xx?
0x60 \le x \le 6 (base 122x012-2x\ge0).
Max product of two numbers with fixed sum SS occurs when?
They are equal, each S/2S/2.
What three categories of points must you compare for a global extremum on [a,b][a,b]?
Critical points, and the two endpoints.
What does the multiplier λ\lambda measure physically?
The sensitivity of the optimum to relaxing the constraint.

Connections

Concept Map

smooth extremum needs

defines

justified by

only candidates

classified via

sign of f'' gives

type A

type B

check crit pts and endpoints

route 1

route 2

reduces to

grad f parallel grad g

Optimization: max or min

Derivative = 0

Critical point

Fermat's Theorem

Taylor expansion near c

Second-derivative test

Unconstrained

Constrained

Closed Interval Method

Substitution

Lagrange multipliers

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Optimization ka core idea simple hai: kisi quantity ko maximum ya minimum karna hai. Calculus bolta hai — kisi smooth pahaadi ke top ya valley ke bottom par slope ek pal ke liye zero ho jaata hai, yaani f(x)=0f'(x)=0. In points ko hum critical points kehte hain. Lekin dhyan rakho: har critical point max ya min nahi hota (jaise x3x^3 at 00), isliye usko classify karna zaroori hai — second derivative dekho: f>0f''>0 matlab minimum (cup), f<0f''<0 matlab maximum (cap).

Real-world problems mein aksar ek constraint hota hai, jaise "perimeter fixed hai" ya "line par point hona chahiye". Do tareeke: ya to constraint se ek variable nikaal kar baaki sabko ek variable mein convert karo (substitution), ya multivariable case mein Lagrange multipliers use karo — jahan f=λg\nabla f = \lambda \nabla g. Iska geometry yeh hai ki optimum par "uphill direction" f\nabla f constraint curve ke perpendicular ho jaata hai, isliye curve ke along aur improve nahi kar sakte.

Steps yaad rakhne ke liye DUCK-DC: Draw, Unknown, Constraint to one variable, Kill the derivative, Discriminate, Check endpoints. Box problem mein humne dekha x=2x=2 par volume max (128cm3128\,cm^3), aur x=6x=6 ko reject kiya kyunki base zero ho jaata. Hamesha domain aur endpoints check karo — yeh sabse common galti hai jahan students marks gawate hain.

Go deeper — visual, from zero

Test yourself — Calculus I — Limits & Derivatives

Connections