# Partial Derivatives with Respect To Lines That Are Not In The Direction of Axis

1. Aug 11, 2012

### Byron Chen

A 3-dimensional graph has infinite number of derivatives (in different directions) at a single point. I've learned how to find the partial derivative with respect to x and y, simply taking y and x to be constant respectively. But what do I do if I want to take the partial derivative with respect to a line that is not in the direction of an axis, but rather a diagonal line, like a line cutting through the x-axis at 45 degrees? In this case you can't simply take one of the axis to be a constant, right?

2. Aug 11, 2012

### micromass

These are so-called directional derivatives.

So, let's say we are given a function $f:\mathbb{R}^3\rightarrow \mathbb{R}$ and a unit vector $\mathbf{v}=(v_1,v_2,v_3)$. The the directional derivative of f in v is given by

$$D_\mathbb{v} f = v_1\frac{\partial f}{\partial x}+v_2\frac{\partial f}{\partial y}+v_2\frac{\partial f}{\partial z}$$

First of all, note that if $\mathbb{v}=(1,0,0)$, then we just obtain the partial derivative with respect to x. So this is clearly the case where you differentiate with respect to the x-axis.

As an example, given $f(x,y,z)=x^5yz^4+\log(x)\sin(yz)$. We wish to find the partial derivative with respect to the line x=y=-z. A unit vector on this line is given by $\mathbb{v}=(\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},-\frac{1}{\sqrt{3}})$. (of course, $-\mathbb{v}$ is another unit vector but this vector will give us the same directional derivative up to a sign). So, we have

$$\frac{\partial f}{\partial x}=5x^4yz^4 + \frac{\sin(yz)}{x}$$
$$\frac{\partial f}{\partial y}=x^5z^4 + z\log(x)\cos(yz)$$
$$\frac{\partial f}{\partial z}= 4x^5yz^3 + y\log(x)\cos(yz)$$

So

$$D_\mathbb{v} f = \frac{1}{\sqrt{3}}(5x^4yz^4 + \frac{\sin(yz)}{x})+\frac{1}{\sqrt{3}}(x^5z^4 + z\log(x)\cos(yz)) -\frac{1}{\sqrt{3}}(4x^5yz^3 + y\log(x)\cos(yz))$$

3. Aug 11, 2012

### micromass

The previous post gave information on how to calculate it, but not on why this is the derivative with respect to a line. To see how to define it, take a function

$$f:\mathbb{R}^3\rightarrow \mathbb{R}$$

We want to find the derivative when this is restricted to a line.
First, take a point $\mathbb{a}$ in which we wish to find the directional derivative. We wish to find the directional derivative with respect to a line L.
First, take a unit vector $\mathbb{v}$ which is parallel to L. Then we can write all points on L in the form $\mathbb{a}+\alpha\mathbb{v}$.

So f restricted on the line gives us the function

$$g(\alpha)=f(\mathbb{a}+\alpha\mathbb{v})$$

Note that $g(0)=f(\mathbb{a})$. So we wish to find the derivative of g with respect to $\alpha$, and we wish to find the derivative of this in 0. This is

$$g^\prime(0)=\lim_{h\rightarrow 0}\frac{g(h)-g(0)}{h} = \lim_{h\rightarrow 0} \frac{ f(\mathbb{a}+h\mathbb{v})-f(\mathbb{a})}{h}$$

This expression is called the directional derivative of f in $\mathbb{a}$. So

$$D_\mathbb{v} f = \lim_{h\rightarrow 0} \frac{ f(\mathbb{a}+h\mathbb{v})-f(\mathbb{a})}{h}$$

Now, you may wonder, how are the things in this post and my previous post equal. Why is

$$g^\prime(0)=v_1\frac{\partial f}{\partial x}+v_2\frac{\partial f}{\partial y}+v_3\frac{\partial f}{\partial z}$$

The equality of these two things can very easily be shown by the chain rule. Try it yourself once you've seen the chain rule!

4. Aug 11, 2012

### GarageDweller

If you have a parametric curve, r(t), then the directional derivative of a scalar function along that curve is
Df/dt=r'(t) O f'(t)

O is the dot product, f'(t) is a vector with components equal to the respective derivatives of f