4.4.10 · HinglishMultivariable Calculus

Gradient as direction of steepest ascent

1,486 words7 min readRead in English

4.4.10 · Maths › Multivariable Calculus


Hum pooch kya rahe hain?

Hum kya chahte hain: saari possible directions mein se, kaun si direction mein sabse tezi se grow karta hai, aur kitni tezi se?


KAISE: directional derivative ko scratch se derive karein

Yeh step kyun? Hum har direction ke liye limit nahi lena chahte. Multivariable chain rule use karo taaki ko un cheezoon se express kiya ja sake jo hum pehle se jaante hain (partials).

Ek single-variable function define karo se direction mein jaane wali line ke saath:

Phir definition se .

Chain rule apply karo (, ):

= f_x\,u_1 + f_y\,u_2$$ **Yeh step kyun?** $\frac{dx}{dh}=u_1$ aur $\frac{dy}{dh}=u_2$ kyunki $x,y$ linearly $h$ ke saath move karte hain. $h=0$ rakho: $$\boxed{D_{\mathbf u}f = f_x u_1 + f_y u_2 = \nabla f \cdot \mathbf u}$$ > [!formula] Key result > $$D_{\mathbf u}f = \nabla f \cdot \mathbf u \quad (\|\mathbf u\|=1)$$ > Directional derivative bas gradient aur direction ka **dot product** hai. --- ## KAISE: ab *sabse steep* direction dhundho Hum **maximise** karna chahte hain $D_{\mathbf u}f = \nabla f \cdot \mathbf u$ ko saare unit $\mathbf u$ par. Dot product ka geometric form use karo: $$\nabla f \cdot \mathbf u = \|\nabla f\|\,\|\mathbf u\|\cos\theta = \|\nabla f\|\cos\theta$$ **Yeh step kyun?** $\|\mathbf u\|=1$ hai, isliye sirf $\nabla f$ aur $\mathbf u$ ke beech ka angle $\theta$ matter karta hai. Kyunki $\cos\theta \in [-1,1]$: | $\theta$ | $\cos\theta$ | $D_{\mathbf u}f$ | matlab | |---|---|---|---| | $0$ ($\nabla f$ ke saath) | $+1$ | $+\|\nabla f\|$ | **steepest ascent** ↑ | | $\pi$ (opposite) | $-1$ | $-\|\nabla f\|$ | steepest descent ↓ | | $\pi/2$ (perpendicular) | $0$ | $0$ | level curve ke saath (flat) | > [!formula] Teen badi baatein > - Steepest ascent direction: $\displaystyle \mathbf u^* = \frac{\nabla f}{\|\nabla f\|}$ > - Maximum rate of increase: $\displaystyle \max_{\mathbf u} D_{\mathbf u}f = \|\nabla f\|$ > - $\nabla f$ level curves $f=\text{const}$ ke **perpendicular** hai (kyunki level curve ke saath move karne par $D_{\mathbf u}f=0 \Rightarrow \cos\theta=0$). --- ## Worked examples > [!example] Example 1 — Steepest direction dhundho > Maano $f(x,y)=x^2+y^2$ point $(1,2)$ par. > > **Step 1.** $f_x = 2x,\ f_y=2y$ → *Kyun?* partials lo. > **Step 2.** $\nabla f(1,2) = (2,4)$ → *Kyun?* point plug in karo. > **Step 3.** Steepest ascent direction $= \dfrac{(2,4)}{\sqrt{20}} = \dfrac{1}{\sqrt5}(1,2)$ → *Kyun?* unit length ke liye normalise karo. > **Step 4.** Max rate $= \|\nabla f\| = \sqrt{4+16}=\sqrt{20}=2\sqrt5$ → *Kyun?* maximum directional derivative gradient ki magnitude ke barabar hoti hai. > [!example] Example 2 — Diye gaye direction mein directional derivative > Wahi $f$, $(1,2)$ par, direction $(4,6)$ ki taraf. > > **Step 1.** Direction vector $(4-1,\,6-2)=(3,4)$. *Kyun?* tip minus tail. > **Step 2.** Unit vector $\mathbf u = (3,4)/5$. *Kyun?* $\|\mathbf u\|$ 1 hona chahiye, warna rate galat scale ho jaata hai. > **Step 3.** $D_{\mathbf u}f = \nabla f\cdot\mathbf u = (2,4)\cdot(3/5,4/5)= \frac{6+16}{5}=\frac{22}{5}=4.4.$ *Kyun?* boxed formula apply karo. > Note karo $4.4 < 2\sqrt5\approx4.47$ — consistent hai: gradient direction ko koi beat nahi kar sakta. > [!example] Example 3 — Level curve ke perpendicular > $f(x,y)=xy$, point $(2,3)$. Usse hone wali level curve: $xy=6$. > > **Step 1.** $\nabla f=(y,x)=(3,2)$. *Kyun?* $xy$ ke partials. > **Step 2.** Tangent to $xy=6$: implicit diff $y + x\,y'=0 \Rightarrow y' = -3/2$, isliye tangent direction $\propto(2,-3)$. *Kyun?* slope $dy/dx$. > **Step 3.** Check karo $\nabla f\cdot(2,-3)=(3)(2)+(2)(-3)=0$. ✓ *Kyun?* gradient ⟂ level curve, bilkul jaisa predict kiya tha. --- ## Common mistakes > [!mistake] "Main raw direction vector use karoonga, unit vector nahi." > **Kyun sahi lagta hai:** $\nabla f\cdot\mathbf v$ ek directional derivative jaisa dikhta hai. > **Kyun galat hai:** agar $\|\mathbf v\|\ne 1$, to tum $\|\mathbf v\|$ times zyada paa lete ho — woh rate *$\mathbf v$ ki length ke per unit* hai, unit distance per nahi. > **Fix:** hamesha **normalise karo**: $\mathbf u = \mathbf v/\|\mathbf v\|$ dot karne se pehle. > [!mistake] "Gradient level curve ke *saath saath* point karta hai, jaise ek contour line." > **Kyun sahi lagta hai:** tum map par trails ke saath chalte ho, isliye gradients unhe follow karte honge. > **Kyun galat hai:** level curve ke saath $f$ nahi badalta, isliye *fastest-increase* arrow ko curve se **door** jaana chahiye — uske perpendicular. > **Fix:** yaad rakho $D_{\mathbf u}f=0$ contour ke saath $\Rightarrow \cos\theta=0 \Rightarrow \perp$. > [!mistake] "Steepest ascent aur steepest descent unrelated directions hain." > **Fix:** descent bas $-\nabla f$ hai (opposite arrow). Gradient descent (ML) literally $-\nabla f$ mein step karta hai. --- > [!recall]- Feynman: ek 12-saal ke bachche ko samjhao > Socho tum ghane kohere mein ek ऊबड़-खाबड़ pahaad par khade ho. Tum door nahi dekh sakte, lekin apne pairon ke neeche har direction mein dhaal feel kar sakte ho. **Gradient** ek aisi arrow jaisi hai jo jadui tarah se seedha uphill point karti hai — seedha uupar jaane ka sabse steep rasta. Poora ghumo aur tum sabse steep raste se **neeche** point kar rahe ho. Sideways chalo arrow ke right angle par aur zameen flat rehti hai (tum pahaad ke around same height par chal rahe ho). **Jitni lambi** arrow, wahan pahaad utna hi steep hai. > [!mnemonic] Yaad rakho > **"GUS"** — **G**radient = **U**phill, **S**teepest. Aur **"dot karne se pehle normalise karo."** > Magnitude $\|\nabla f\|$ = *kitna steep hai*; direction = *kaun sa rasta uupar hai*. --- ## Recall checkpoint > [!recall] Bina dekhe jawab de sakte ho? > 1. $D_{\mathbf u}f$ ko dot product ke roop mein likho. > 2. $D_{\mathbf u}f$ ki max value $\|\nabla f\|$ kyun hoti hai? > 3. $\nabla f$ level curve ke saath kaun sa angle banata hai? --- ### #flashcards/maths What is the directional derivative $D_{\mathbf u}f$ in terms of the gradient? ::: $D_{\mathbf u}f = \nabla f \cdot \mathbf u$ ek **unit** vector $\mathbf u$ ke liye. In which direction does $\nabla f$ point? ::: **Steepest ascent** ki direction mein ($f$ ki sabse tezi se increase). What is the maximum rate of increase of $f$ at a point? ::: $\|\nabla f\|$, gradient ki magnitude. What direction gives steepest descent? ::: $-\nabla f$ (gradient ke opposite). Why must $\mathbf u$ be a unit vector in $D_{\mathbf u}f=\nabla f\cdot\mathbf u$? ::: Taaki rate "per unit distance" ho; warna yeh $\|\mathbf u\|$ se scale ho jaata hai. What angle is the gradient to a level curve $f=\text{const}$? ::: $90°$ — yeh perpendicular hai, kyunki $D_{\mathbf u}f=0$ curve ke saath. Derive $D_{\mathbf u}f$: what trick is used? ::: Chain rule on $g(h)=f(\mathbf x+h\mathbf u)$, phir $g'(0)=f_xu_1+f_yu_2$. Why is $\nabla f\cdot\mathbf u$ maximised along $\nabla f$? ::: $=\|\nabla f\|\cos\theta$, maximum tab hota hai jab $\cos\theta=1$, yaani $\theta=0$. --- ## Connections - [[Directional Derivative]] - [[Partial Derivatives]] - [[Multivariable Chain Rule]] - [[Dot Product and Angle]] - [[Level Curves and Contour Maps]] - [[Gradient Descent (Machine Learning)]] - [[Tangent Plane and Linearization]] ## 🖼️ Concept Map ```mermaid flowchart TD F[Scalar field f] -->|partial derivatives| GRAD[Gradient grad f] U[Unit direction u] -->|step along| DD[Directional derivative] DD -->|defined as| LIM[Limit of difference quotient] GRAD -->|chain rule gives| KEY[D_u f = grad f dot u] U --> KEY KEY -->|geometric dot product| ANG[grad f times cos theta] ANG -->|cos theta = 1| ASC[Steepest ascent along grad f] ANG -->|cos theta = -1| DESC[Steepest descent] ANG -->|cos theta = 0| LEVEL[Along level curve, flat] ASC -->|max rate equals| MAG[Magnitude of grad f] LEVEL -->|implies| PERP[grad f perpendicular to level curves] ``` ## 🔬 Deep Dive > [!intuition] Aur gehraai mein jao — visual, zero se > Is topic ki step-by-step 3Blue1Brown-style breakdowns. - [[4.4.10 D1 Foundations|D1 · Foundations — har symbol zero se]] - [[4.4.10 D2 Visual Walkthrough|D2 · Visual walkthrough — derivation pictures mein]] - [[4.4.10 D3 Worked Examples|D3 · Worked examples — har scenario]] - [[4.4.10 D4 Exercises|D4 · Exercises — graded, full solutions]] - [[4.4.10 D5 Question Bank|D5 · Question bank — concept traps]]