Directional derivative vs. function restriction and then derivative

357 Views Asked by At

Say I have a function of two variables, and a line in the plane, and I'd like to "take the derivative along the line". Is this an indication to use the directional derivative, OR is it expected that I first restrict the function to the line in the plane, so that it's a function of one variable, and then take a derivative in, say, the x variable?

And whichever one is the right answer, what is the other option doing then?

(this specifically is in relation to a hermite finite element example; the line in question is one side of a triangle, so two points on the line are given (two of the triangle vertices); if the directional derivative is what is in fact meant, then I guess they mean to evaluate it at one of the two points.)

1

There are 1 best solutions below

1
On

The two methods give the same answers (although there are some subtleties). For a vector $v=(v_x,v_y)$ and point $x=(x_0,y_0)$, the directional derivative is $$ \lim_{t\rightarrow 0}\frac{f(x+tv)-f(x)}{t}. $$ A standard theorem in multivariate calculus is that the directional derivative is $\nabla f\cdot v=v_x\partial_xf+v_y\partial_yf$.

Now, if you restrict to the line $y=m(x-x_0)+y_0$ (for a non-vertical line), then the derivative of $f(x,y)$ along this line is the derivative of $$ f(x,y)=f(x,m(x-x_0)+y_0) $$ (for now, we'll focus on the derivative with respect to $x$). The derivative of this (using the chain rule) is $$ \frac{d}{dx}f(x,m(x-x_0)+y_0)=\partial_xf+m\partial_yf. $$

We can now relate the two expressions. Note that the line $y=m(x-x_0)+y_0$ has direction vector $(1,m)$, so this connects the two methods.

The main caution is that by writing a line as $y=mx+b$, as a function of $x$, this is not a curve of unit speed (one must divide by $\sqrt{1+m^2}$). Therefore, unless you change your variables, you'll get a scaling error between the directional derivative and the restriction.