I'm still trying to grasp fully the concept of directional derivatives and how they can be used to approximate functions, and so I have an example of a problem I made up that I tried to evaluate. Let's say I have the function,

$$f(x,y) = x^2+y^2$$

I want to evaluate the directional derivative at the point P = $(2,2,8)$ with the vector $\vec{v} = (1,2)$.

So I first found the gradient $\nabla f = (2x,2y)$, and plugging in the original points I got the gradient at point P to be $(4,4)$. I then found $\nabla f \cdot P$ and got $4 * 1 + 4 * 2 = 12$. So the directional derivative would be $12$. My understanding is that this is the best approximation around the point, and says that moving by $h*\vec{v}$ will cause a change of $12 * h$. So when $h=1$, you would be moving to the point (2,3) and the approximation would be $f \approx 8 + 12 = 20$, but the actual value of the function is $f = 25$. That's a very large error, but when $h$ gets smaller and smaller, this error will decrease monotonically.

I want to clarify if my logic, calculation, and reasoning is correct before I move on from this topic. I'd be worried if I went into the next topic with a fundamental misunderstanding.

  • $\begingroup$ You are missing that the direction has to be a unit vector. $\endgroup$ – Kaynex May 24 '17 at 1:31
  • $\begingroup$ @Kaynex from my question here, it seems that you do not actually need to scale down to a unit vector: math.stackexchange.com/questions/2291302/… $\endgroup$ – rb612 May 24 '17 at 1:32
  • $\begingroup$ I'm not sure what's going on in your question, but it's clear here that changing the length of your direction should not matter, yet if you multiply your direction vector by $2$, you're going to double your result. $\endgroup$ – Kaynex May 24 '17 at 1:35
  • $\begingroup$ That's true, except the directional derivative supposedly does indeed have that property, in most cases. Take a look at the section "finding slope" from Khan Academy - this is where I'm learning it from, and I hear that definitions do differ. But regardless of the approach, shouldn't the linearization yield the same result? $\endgroup$ – rb612 May 24 '17 at 1:38

First, as someone said in the comments, the formula $\nabla f \cdot \vec{v}$ for directional derivative only holds when $\vec{v}$ is a unit vector. What you are doing is almost correct, and it is similar in flavor to the directional derivative, but you are not computing the directional derivative. Careful with the terminology here.

You can use your approach to estimate the value of $f$ at some point 'near' $P = (2, 2)$. You are using a vector $\vec{v} = (1, 2)$ and taking $h=1$. That means you are trying to approximate $f$ at the point $P + \vec{v} = (3, 4)$. Using the directional derivative method, you estimated $f(3, 4) \approx 20$, but we calculate $f(3, 4) = 25$. Frankly, this isn't too bad of an approximation. Note that the point $(3, 4)$ is $\sqrt{5} \approx 2.2$ units aways from the original point $(2,2)$. This is kind of far to be expecting super close approximations. So being off by $5$ isn't so bad. If you try the same thing but take $h = 0.1$ or even $h = 0.001$, you will see that the error shrinks dramatically.

  • $\begingroup$ Thank you! You thoroughly answered my question - but with the directional derivative, I'm confused because it seems like most commonly it isn't scaled down to a unit vector, or at least it's a matter of style. What are your thoughts? en.wikipedia.org/wiki/Directional_derivative#Definition $\endgroup$ – rb612 May 24 '17 at 4:48
  • $\begingroup$ @rb612 There is a difference between the definition of the directional derivative (like the wikipedia definitions you linked) and a convenient method for computing it. You don't need $\vec{v}$ to be a unit vector if you use the limit definition of directional derivative. You do however need to take $\vec{v}$ to be a unit vector to use the convenient $\nabla f\cdot \vec{v}$ method of computing the directional derivative. $\endgroup$ – ChocolateAndCheese May 24 '17 at 4:59
  • $\begingroup$ What you're saying makes a lot of sense - I'm just wondering why (and I'm going purely off of what I've learned from Grant on KhanAcademy that he says you only need to scale down to a unit vector if you're using it to compute slope. He doesn't scale it down for any other circumstance. Could you please help me understand? Thank you! $\endgroup$ – rb612 May 24 '17 at 5:04
  • $\begingroup$ @rb612 The directional derivative is the 'slope' of the tangent plane in the direction of $\vec{v}$. They are the same thing. Most people avoid the term 'slope' in this context because talking about the 'slope' of a plane doesn't always make sense. $\endgroup$ – ChocolateAndCheese May 24 '17 at 5:08
  • $\begingroup$ ah thank you! But do the calculations work out the same? Like if I scaled it down to a unit vector and then did the magnitude times the directional derivative, I would get the same result always as if I were just taking the dot product with the original vector, right? In other words, scaling doesn't change the computation, merely the terminology used? $\endgroup$ – rb612 May 24 '17 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.