Gradient Question: Why Does Direction Maximize Function?

  • Context: Graduate 
  • Thread starter Thread starter kidsasd987
  • Start date Start date
  • Tags Tags
    Gradient
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
kidsasd987
Messages
142
Reaction score
4
This is a bit counterintuitive to me that the gradient vector is always normal to the level curve
and the level surface.

lets say we have a function f(x,y)=z

then the gradient is,

f(x,y) partial derivative with respect to x*i +f(x,y) partial derivative with respect to y*j


what we actually get is,

dz/dx*i+dz/dy*j=grad_f(x,y)

then,

[(dz/dx*i)+(dz/dy)*j]/sqrt((dz/dx*i)^2+(dz/dy*j)^2)

this is always perpendicular to the level curve. But why does that direction always maximize the function?
 
Physics news on Phys.org
Think of going up a hill. You always have to go perpendicular to the level curve. You're not going to be winding around the side if you want the most direct route.
 
Another way of looking at it: if z= f(x, y) then the "directional derivative", [itex]f_{\theta}[/itex], the rate of change of f as you move in the direction that makes angle [itex]\theta[/itex] with the positive x axis, is [itex]\nabla f\cdot \vec{e}_{\theta}[/itex] where [itex]\vec{e}_{\theta}[/itex] is the unit vector in that direction, which, in turn, is equal to [tex]\left(\frac{\partial f}{\partial x}\vec{i}+ \frac{\partial f}{\partial y}\vec{j}\right)\cdot \left(\vec{i}cos(\theta)+ \vec{j}sin(\theta)\right)= cos(\theta)\frac{\partial f}{\partial x}+ sin(\theta)\frac{\partial f}{\partial x}[/tex].

To maximize (or minimize) that with respect to [itex]\theta[/itex], take the derivative with respect to [itex]\theta[/itex], set it equal to 0 and solve for [itex]\theta[/itex]. you will get
[tex]tan(\theta)= \frac{\frac{\partial f}{\partial y}}{\frac{\partial f}{\partial x}}[/tex]
showing that [itex]\theta[/itex] for the maximum is, indeed, the direction in which [itex]\nabla f[/itex] points while the minimum is in the opposite direction.