[b][size=150]Directional derivatives[/size][/b][br][br]Suppose [math]z=f(x,y)[/math] is a function of two variables and [math](x_0,y_0)[/math] is a point in the domain of [math]f[/math]. Its partial derivatives [math]f_x(x_0,y_0)[/math] and [math]f_y(x_0,y_0)[/math] are the slope of the curve on the graph of [math]z=f(x,y)[/math] in the direction of x-axis and y-axis respectively. In fact, we can also consider the slope of the curve on the graph in any direction. Let [math]\vec{u}=\langle u_1,u_2 \rangle[/math] be a unit vector. We have the following definition:[br][br][u]Definition[/u]: The [b]directional derivative[/b] of [math]f[/math] at [math](x_0,y_0)[/math] in the direction of [math]\vec{u}[/math], denoted by [math]D_\vec{u} f(x_0,y_0)[/math], is as follows:[br][br][math]D_\vec{u} f(x_0,y_0)=\lim_{t \to 0}\frac{f(x_0+t u_1,y_0+t u_2)-f(x_0,y_0)}t=\left.\frac{d}{dt}\left(f(x_0+tu_1,y_0+tu_2)\right)\right|_{t=0}[/math][br][br]([u]Note[/u]: By definition, [math]f_x(x_0,y_0)=D_{\langle 1,0\rangle}f(x_0,y_0)[/math] and [math]f_y(x_0,y_0)=D_{\langle 0,1 \rangle}f(x_0,y_0)[/math].)[br][br][br]The applet below illustrates the geometric meaning of directional derivatives of a function of two variables. You can drag the point [math]A=(x_0,y_0)[/math] and the red unit vector to see the change in the value of [math]D_\vec{u}f(x_0,y_0)[/math].[br][br]
For a function of three variables [math]w=g(x,y,z)[/math], we can define its directional derivative in a similar way. Let [math](x_0,y_0,z_0)[/math] be a point in the domain of [math]g[/math] and [math]\vec{v}=\langle v_1,v_2,v_3 \rangle[/math] be a unit vector in [math]\mathbb{R}^3[/math]. Then we have the following definition:[br][br][u]Definition[/u]: The [b]directional derivative[/b] of [math]g[/math] at [math](x_0,y_0,z_0)[/math] in the direction of [math]\vec{v}[/math] is [br][br][math]D_\vec{v}g(x_0,y_0,z_0)=\lim_{t\to 0}\frac{g(x_0+tv_1,y_0+tv_2,z_0+tv_3)-g(x_0,y_0,z_0)}t=\left.\frac{d}{dt}\left(g(x_0+tv_1,y_0+tv_2,z_0+tv_3)\right)\right|_{t=0}[/math][br][br][br]The following useful theorem is a formula for computing directional derivatives:[br][br][u]Theorem[/u]: Suppose [math]z=f(x,y)[/math] and [math]\vec{u}=\langle u_1,u_2\rangle[/math] is a unit vector in [math]\mathbb{R}^2[/math], then[br][br][math]D_\vec{u}f(x_0,y_0)=\langle f_x(x_0,y_0),f_y(x_0,y_0)\rangle \cdot \vec{u}[/math][br][br]For [math]w=g(x,y,z)[/math] and [math]\vec{v}=\langle v_1,v_2,v_3\rangle[/math] is a unit vector in [math]\mathbb{R}^3[/math], then[br][br][math]D_\vec{v}f(x_0,y_0,z_0)=\langle g_x(x_0,y_0,z_0),f_y(x_0,y_0,z_0),f_z(x_0,y_0,z_0)\rangle \cdot \vec{v}[/math][br][br][br][u]Proof[/u]: [br][br]We only prove the result for functions of two variables here. The three variable version can be proved by similar argument.[br][br]Let [math]x=x_0+tu_1[/math] and [math]y=y_0+tu_2[/math]. By chain rule, we have[br][br][math]D_\vec{u}f(x_0,y_0)=\left.\frac{d}{dt}\left(f(x_0+tu_1,y_0+tu_2)\right)\right|_{t=0}=\left.f_x(x,y)\frac{dx}{dt}+f_y(x,y)\frac{dy}{dt}\right|_{t=0}[/math][br][math]=f_x(x_0,y_0)u_1+f_y(x_0,y_0)u_2=\langle f_x(x_0,y_0),f_y(x_0,y_0)\rangle \cdot \vec{u}[/math][br][br][br][u]Example[/u]: Let [math]f(x,y)=xy[/math] and [math]\vec{u}=\left\langle \frac{\sqrt{3}}2,\frac 12\right\rangle[/math]. Find the directional derivative of [math]f[/math] at [math](1,2)[/math] in the direction of [math]\vec{u}[/math].[br][br][u]Answer[/u]:[br][br][math]f_x=y[/math] and [math]f_y=x[/math]. Moreover, it can be easily checked that [math]\vec{u}[/math] is already a unit vector. [br][br](If the given vector is not a unit vector, we need to first normalize it into a unit vector pointing towards the same direction.)[br][br][math]D_\vec{u}f(1,2)=\langle f_x(1,2),f_y(1,2)\rangle \cdot \left\langle \frac{\sqrt{3}}2,\frac 12\right\rangle[/math][br][math]=\langle 2,1 \rangle \cdot \left\langle \frac{\sqrt{3}}2,\frac 12\right\rangle=\sqrt{3}+\frac 12[/math][br]
[u]Exercise[/u]: Let [math]w=g(x,y,z)=\frac 34 x^2+\frac 12 y^2 + 3z^2[/math] and [math]\vec{v}=\left\langle \frac 13, -\frac 23, \frac 23\right\rangle[/math]. Find the directional derivative of [math]g[/math] at [math](1,2,3)[/math] in the direction of [math]\vec{v}[/math].[br][br][br]
[u]Remark[/u]: For any unit vector [math]\vec{u}[/math] in [math]\mathbb{R}^2[/math], it can be written as [math]\vec{u}=\langle \cos\theta,\sin\theta\rangle[/math], where [math]\theta[/math] is the angle measured from the positive x-axis to the direction of [math]\vec{u}[/math] in anticlockwise direction. Therefore, we have the following formula for directional derivatives in terms of [math]\theta[/math]:[br][br][math]D_\vec{u}f(x_0,y_0)=f_x(x_0,y_0)\cos\theta+f_y(x_0,y_0)\sin\theta[/math][br][br]
[b][size=150]Gradient[/size][/b][br][br]Suppose [math]z=f(x,y)[/math] is a function of two variables that is differentiable at [math](x,y)[/math]. The [b]gradient[/b] of [math]f[/math] at [math](x,y)[/math] is the vector in [math]\mathbb{R}^2[/math], denoted by [math]\nabla f(x,y)[/math], is defined as follows:[br][br][math]\nabla f(x,y)=\langle f_x(x,y), f_y(x,y) \rangle[/math][br][br]