Directional Derivative
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Directional Derivative
Ok, here's the problem. Find the directional derivative of the function at the given point in the direction of the vector v.
f(x,y) = 1 + 2 x sqrt(y)
P(3,4)
v = < 4, -3 >
The answer in the book is 23/10.
f(x,y) = 1 + 2 x sqrt(y)
P(3,4)
v = < 4, -3 >
The answer in the book is 23/10.
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
Well, the directional derivative of f(X) in the direction V at the point P is simply the regular derivative of g(t):=f(P+tV) at t=0. Capital letters being vectors.
I get 23/2 if I follow that. I may have made one or the other mistake, but definitely, I see no way of a prime factor of 5 entering the denominator. So I call the book's solution wrong
The other definition would be to take all the partial derivatives of f at the given point. Together they form a vector called the gradient of f at that point. Then you build the scalar product of the gradient and the given test vector. Well, actually, the gradient is a linear form and not a vector, but the actual calculations are the same.
My calculation:
g(t)=f(3+4t, 4-3t)=1+2(3+4t)sqrt(4-3t)
Product and chain rules give
g'(t)=8 sqrt(4-3t) + 2(3+4t) * (-3)/(2 sqrt(4-3t))
and at t=0, that's
g'(0)=8 sqrt(4) + 2*3*(-3)/(2*sqrt(4)) = 16 - 9/2 = 23/2.
I get 23/2 if I follow that. I may have made one or the other mistake, but definitely, I see no way of a prime factor of 5 entering the denominator. So I call the book's solution wrong
The other definition would be to take all the partial derivatives of f at the given point. Together they form a vector called the gradient of f at that point. Then you build the scalar product of the gradient and the given test vector. Well, actually, the gradient is a linear form and not a vector, but the actual calculations are the same.
My calculation:
g(t)=f(3+4t, 4-3t)=1+2(3+4t)sqrt(4-3t)
Product and chain rules give
g'(t)=8 sqrt(4-3t) + 2(3+4t) * (-3)/(2 sqrt(4-3t))
and at t=0, that's
g'(0)=8 sqrt(4) + 2*3*(-3)/(2*sqrt(4)) = 16 - 9/2 = 23/2.
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Here's what I did. I took the gradient approach. If you convert the vector v into a unit vector, you can dot that with the gradient, which is what you were saying.
So, I get the gradient to be < 2 sqrt(y), x/sqrt(y) > . Went over that a few times, I'm pretty confident about it. (Unless I copied the problem wrong, but I went over that a few times because it is a mistake I make..)
Then the unit vector u is < 4/5, -3/5 >. |v| = sqrt( 4^2 + 3^2 ), which of course yields 5.
So the directional derivative then is:
2 sqrt(y) * 4/5 + x/sqrt(y) * (-3/5)
Plug in the point and I wind up with 13/5.
To check my method (which isn't the method the book tries to teach), I did the problems around it, and each of those I came up with the same answer the book gives. Now I'm looking at it again and wondering if I did the partial derivatives wrong, heh. Now it looks like I didn't bring a 2 down that I should have, which should double the y term in the dot product. Grrr... That gives me 2 for an answer.
So, I get the gradient to be < 2 sqrt(y), x/sqrt(y) > . Went over that a few times, I'm pretty confident about it. (Unless I copied the problem wrong, but I went over that a few times because it is a mistake I make..)
Then the unit vector u is < 4/5, -3/5 >. |v| = sqrt( 4^2 + 3^2 ), which of course yields 5.
So the directional derivative then is:
2 sqrt(y) * 4/5 + x/sqrt(y) * (-3/5)
Plug in the point and I wind up with 13/5.
To check my method (which isn't the method the book tries to teach), I did the problems around it, and each of those I came up with the same answer the book gives. Now I'm looking at it again and wondering if I did the partial derivatives wrong, heh. Now it looks like I didn't bring a 2 down that I should have, which should double the y term in the dot product. Grrr... That gives me 2 for an answer.
well.... it can........ if you normalize the vector before doing the calculations........z-man wrote:I see no way of a prime factor of 5 entering the denominator. So I call the book's solution wrong
but right now im looking at my lecture notes and they dont mention normalizing
though it kinda makes sense for the direction vector to be normalized
Yes, apparently Lucifer's book wants you to NORMALIZE the vector V before you do the procedure described in my post. The norm (length) of your vector here is 5, that's where the extra factor comes from. In "real" math, you avoid normalization requirements, because not all vector spaces have the concept of the length of a vector.
Lucifer's gradient is right. The problem must be with the insertion of the point, I get:
2 sqrt(y) * 4/5 + x/sqrt(y) * (-3/5) =
2 sqrt(4) * 4/5 + 3/sqrt(4) * (-3/5) =
2 * 2 * 4/5 + 3*(-3)/(2*5) = 16/5 - 9/10 = 32/10 - 9/10 = 23/10.
Lucifer's gradient is right. The problem must be with the insertion of the point, I get:
2 sqrt(y) * 4/5 + x/sqrt(y) * (-3/5) =
2 sqrt(4) * 4/5 + 3/sqrt(4) * (-3/5) =
2 * 2 * 4/5 + 3*(-3)/(2*5) = 16/5 - 9/10 = 32/10 - 9/10 = 23/10.
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Wait a minute, I did a substitution wrong. I just found a 10 in the denominator when I thought there shouldn't be one.
I'm satisfied with the partial y again, because you take the 1/2 out front and get 2/2, so x/sqrt(y) unless I'm badly mistaken.
So the substition should look like (bold indicating where I screwed up):
2 sqrt(4) * (4/5) + 3/sqrt(4) * (-3/5)
4 * 4/5 + 3/2(-3/5)
16/5 - 9/10
32/10 - 9/10 = 23/10
It at least agrees with the book.
I'm satisfied with the partial y again, because you take the 1/2 out front and get 2/2, so x/sqrt(y) unless I'm badly mistaken.
So the substition should look like (bold indicating where I screwed up):
2 sqrt(4) * (4/5) + 3/sqrt(4) * (-3/5)
4 * 4/5 + 3/2(-3/5)
16/5 - 9/10
32/10 - 9/10 = 23/10
It at least agrees with the book.
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Re: Directional Derivative
I'd say that direction is a normalized version.Lucifer wrote:Find the directional derivative of the function at the given point in the direction of the vector v.
ˌɑrməˈɡɛˌtrɑn
I'd say that the direction is the member of an oriented line bundle. That's fancy math speech for "the length of the vector giving the direction does not matter, v and 2 * v give the same direction. v and -v don't give the same direction." Obviously, you can't say anything about a directional derivative along a direction with that definition other than whether the function is increasing, decreasing or constant. Real math is really useful