Unit #20 - Directional Derivatives and the Gradient The Dot Product

Unit #20 - Directional Derivatives and the Gradient
Some problems and solutions selected or adapted from Hughes-Hallett Calculus.
The Dot Product
For Problems 1-8, perform the following operations on the given 3-dimensional vectors.
To find the unit vector in the direction
of ~v =<
√
√ 2, 3 >,
we find the length of ~v , or ||~v || = 22 + 32 = 13.
~b = h−3, 5, 4i ,
A unit vector in the same direction
would be ~u =
1
2
3
√ < 2, 3 > or the equivalent √ , √
13
13
13
~a = h0, 2, 1i ,
~y = h4, −7, 0i ,
~c = h1, 6, 0i
~z = h1, −3, −1i
A unit vector in the xy-plane perpendicular to v can be
found by exchanging the components of ~u and making
one negative:
1. ~a · ~y
~a · ~y = (0)(4) + (2)(−7) + (1)(0) = −14
−2
3
√ ,√
13
13
−3
2
~n = √ , √
13
13
~n =
2. ~c · ~y
or
~c · ~y = (1)(4) + (6)(−7) + (0)(0) = −38
3. ~a · ~b
The dot product of ~n with ~v would then be zero, indicating they are perpendicular.
~a · ~b = (0)(−3) + (2)(5) + (1)(4) = 14
4. ~a · ~z
10. Which pairs (if any) of vectors from the following list
~a · ~z = (0)(1) + (2)(−3) + (1)(−1) = −7
5. ~a · (~c + ~y )
(a) Are perpendicular?
(b) Are parallel?
~a · (~c + ~y ) = h0, 2, 1i · (h1, 6, 0i + h4, −7, 0i) = h0, 2, 1i ·
h5, −1, 0i = (0)(5) + (2)(−1) + (1)(0) = −2
(c) Have an angle less than π/2 between them?
(d) Have an angle of more than π/2 between
them?
6. ~c · ~a + ~a · ~y
~a = h1, −3, −1i , ~b = h1, 1, 2i ,
~c = h−2, −1, 1i , d~ = h−1, −1, 1i
~c · ~a + ~a · ~y = h1, 6, 0i · h0, 2, 1i + h0, 2, 1i · h4, −7, 0i =
(0 + 12 + 0) + (0 − 14 + 0) = −2
7. (~a · ~b)~a
The angle between the vectors can be related to the
dot product formula ||~a|| ||~b|| cos(θ).
(~a · ~b)~a = (h0, 2, 1i · h−3, 5, 4i) ~a = 14~a = 14 h0, 2, 1i =
|
{z
}
scalar
h0, 28, 14i
• If the dot product is negative, then cos(θ) must
π
be negative, and so θ > ;
2
8. (~a · ~y )(~c · ~z)
(~a·~y )(~c·~z) = (h0, 2, 1i·h4, −7, 0i)(h1, 6, 0i·h1, −3, −1i) =
(−14)(−17) = 238
• if the dot product is positive, θ <
9. Let ~v = h2, 3i. Using only two-dimensional vectors, find a unit vector in the same direction as
~v , and then find another vector perpendicular
to ~v .
π
;
2
• if the dot product equals zero, it means the vectors are perpendicular (since none of the vectors
are the zero vector).
1
~a · ~b = −4
~a · ~c = 0
~a · d~ = 1
angle greater than π/2
13. (a) Give a 2-dimensional vector that is parallel
to, but not equal to, ~v = h4, 3i.
vectors are perpendicular
(b) Give a vector that is perpendicular to ~v .
angle less than π/2
~b · ~c = −1
angle greater than π/2
~b · d~ = 0
vectors are perpendicular
~
~c · d = 4
angle less than π/2
(a) Any multiple of ~v would do: e.g. ~u = h12, 9i = 3~v
(b) We need the dot-product to be zero. The easiest
example is to swap the components of ~v and make
one negative: ~u = h−3, 4i.
Therefore, ~a, d~ and ~c, d~ have positive dot products, and
therefore angles smaller than π/2 between them.
Check: ~u · ~v = h−3, 4i · h4, 3i = −12 + 12 = 0.
Since their dot product is zero, the two vectors
must be perpendicular.
(d) Vectors with an angle of more than π/2 between them
have a negative dot product, so pairs are ~a, ~b and ~b, ~c.
None of the vectors are multiples of each other, so none
are parallel to each other.
√
√
~ ~ ~
~
11. Which
√ pairs of the vectors 3i + j, 3i + 3j,
~i − 3~j are parallel and which are perpendicular?
√ This is easier to see in component format:
3, 1 ,
√ √ 3, 3 , 1, − 3 .
√ The second is a multiple of the first:
3, 3 =
√ √ 3 3, 1 , so they are parallel.
14. For what values of t are ~u = ht, −1, 1i and
~v = ht, t, −2i perpendicular? Are there values
of t for which ~u and ~v are parallel?
For ~u and ~v to be perpendicular, their dot product must
be zero:
The first and third are perpendicular, because their dot
product is zero. Since the first and second are parallel,
this means that the second and third are also perpendicular (which we can also verify by computing the dot
product, which again equals zero).
~u · ~v = ht, −1, 1i · ht, t, −2i
= t2 − t − 2
12. Compute the angle between the vectors ~i+~j + ~k
and ~i − ~j − ~k.
Setting the dot product equal to zero,
Let ~a and ~b be the names of the vectors.
~a · ~b = cos(θ)||~a|| ||~b||,
Since
0 = t2 − t − 2 = (t − 2)(t + 1)
t = 2, −1 will make ~u and ~v perpendicular
~a · ~b
cos(θ) =
||~a|| ||~b||
1−1−1
√ √
3 3
−1
=
3
−1
So θ = arccos
≈ 1.91 radians ≈ 109.5o degrees
3
For the two to be parallel, they must be multiples of
one another. I.e. there must be a multiplier λ such
that ~u = λ~v . We would need λ = 1 for the ~i compo1
nents to be equal (t = λt), and we would need λ = −2
for the ~j components to be equal (1 = λ(−2)). As a
result, regardless of the value of t, the two vectors will
never be parallel.
=
Gradients and the Directional Derivative
2
In Problems 15-27 find the gradient of the given
function; if a point is also given, evaluate the
gradient at that specific point. Assume the variables are restricted to a domain on which the
function is defined.
15. f (x, y) =
19. z = sin(x/y)
∂z
x 1
= cos
∂x
y y
∂z
x −x
= cos
∂y
y y2
x
1
x
−x
so ∇f =
cos
, 2 cos
y
y
y
y
3 5 4 6
x − y
2
7
15 4
x
2
−24 5
fy =
y
7
15 4 ~
−24 5 ~
so ∇f =
x i+
y j
2
7
fx =
20. f (α, β) =
2(2α − 3β) − (2α + 3β)(2)
−12β
=
(2α − 3β)2
(2α − 3β)2
3(2α − 3β) − (2α + 3β)(−3)
12α
fβ =
=
(2α − 3β)2
(2α − 3β)2
−12β
12α
so ∇f =
,
(2α − 3β)2 (2α − 3β)2
or more simply,in component notation,
15 4 −24 5
=
x ,
y
2
7
fα =
16. f (x, y, z) = 1/(x2 + y 2 + z 2 )
fx =
fy =
fz =
So grad f =
2α + 3β
2α − 3β
21. f (x, y, z) = xey + ln(xz)
−2x
2
(x + y 2 + z 2 )2
−2y
(x2 + y 2 + z 2 )2
−2z
(x2 + y 2 + z 2 )2
−2
hx, y, zi
2
(x + y 2 + z 2 )2
fx = ey +
1
z
xz
fy = xey
1
fz =
x
xz
So grad f = ∇f =
17. f (x, y, z) = xey sin z
1
1
e + , xey ,
x
z
y
22. f (x1 , x2 , x3 ) = x21 x32 x43
fx = ey sin z
fy = xey sin z
fx1 = 2x1 x32 x43
fz = xey cos z
So grad f = hey sin z, xey sin z, xey cos zi
18. f (x, y) =
p
fx2 = 3x21 x22 x43
fx3 = 4x21 x32 x33
So grad f = 2x1 x32 x43 , 3x21 x22 x43 , 4x21 x32 x33
x2 + y 2
f (x, y) = (x2 + y 2 )1/2
23. f (x, y, z) = xyz at (1, 2, 3)
1 2
x
(x + y 2 )−1/2 (2x) = p
2
x2 + y 2
y
similarly,
fy = p
x2 + y 2
*
+
x
y
so ∇f = p
,p
x2 + y 2
x2 + y 2
fx =
fx = yz
fy = xz
fz = xy
So grad f = hyz, xz, xyi
and grad f (1, 2, 3) = h6, 3, 2i
3
24. f (x, y, z) = sin(xy) + sin(yz), at (1, π, −1)
28. f (x, y) = 3x − 4y
We note
rthat the vector ~u
ris already a unit vector, since
(−4)2
32
25
+
=
||~u|| =
= 1. This means that we
2
2
5
5
25
can compute the directional derivative using the simple
formula f~u (1, 2) = [∇f (1, 2)] · ~u.
fx = cos(xy) · y
fy = cos(xy) · x + cos(yz) · z
fz = cos(yz) · y
So ∇f = hy cos(xy), x cos(xy) + z cos(yz), y cos(yz)i
and ∇f (1, π, −1) = hπ cos(π), cos(π) − cos(−π), π cos(−π)i
Since cos(π) = cos(−π) = −1,
fx = 3
fy = −4
so
∇f (1, π, −1) = h−π, 0, −πi
So
25. f (x, y) = x2 y + 7xy 3 , at (1, 2)
fx = 2xy + 7y 3
∇f (1, 2) = h3, −4i
f~u (1, 2) = (∇f (1, 2)) · ~u
1
= h3, −4i ·
(3, −4)
5
1
= (9 + 16)
5
=5
fy = x2 + 21xy 2
so at (1, 2),
∇f (1, 2) = (2)(1)(2) + 7(23 ), 12 + 21(1)(22 )
29. f (x, y) = xy + y 3
= h60, 85i
26. f (r, h) = 2πrh + πr2 , at (2, 3)
fx = y
fy = x + 3y 2
so ∇f (1, 2) = 2, 1 + 3(22 ) = h2, 13i
1
So f~u (1, 2) = h2, 13i ·
(3, −4)
5
1
−46
= (6 − 52) =
5
5
fr = 2πh + 2πr = 2π(r + h)
fh = 2πr
so
∇f (2, 3) = h2π(2 + 3), 2π(2)i
= h10π, 4πi
27. f (x, y) = 1/(x2 + y 2 ), at (−1, 3)
In Problems 30-35, use the contour diagram of f (x, y)
shown below to decide if the specified directional
derivative is positive, negative, or approximately zero.
It will help to write f (x, y) = (x2 + y 2 )−1 .
so
fx = −1(x2 + y 2 )−2 (2x)
−2x
= 2
(x + y 2 )2
−2y
fy = 2
(x + y 2 )2
−2(−1) −2(3)
∇f (−1, 3) =
,
(1 + 9)2 (1 + 9)2
2 −6
=
,
100 100
In Problems 28-29, find the directional derivative f~u (1,
2) for the function f with ~u =
3 −4
,
.
5 5
4
To compute the gradient, we find the partial derivatives
30. At the point (−2, 2), in direction ~i.
∂f
= 2x
∂x
∂f
= 2y
∂y
Moving from contour z = 8 towards contour z = 6
means z is decreasing in that direction, so the directional derivative is negative.
∂f
(2, 3) = 4
∂x
∂f
(2, 3) = 6
∂x
31. At the point (0, −2), in direction ~j.
Putting the partial derivatives together in a vector, we
obtain the gradient
Moving from z = 4 towards z = 2, so directional derivative is negative.
~ (2, 3) =< 4, 6 >
∇f
32. At the point (−1, 1), in direction~i + ~j
A diagram of the contours of f , with the gradient vector at (2, 3), is shown below.
Remember: the directional derivative gives the slope
for a very small (infinitesimal) step in the specified
direction.
If we are at the point (−1, 1), the direction ~i+~j is parallel to the contour at that point. A very small step then
keeps us on the contour, meaning our z value would
be unchanging at that instant. If z does not change
for a small step in that direction, then the directional
derivative is zero.
33. At the point (−1, 1), in direction −~i + ~j.
Moving towards higher z values, so the directional
derivative is positive.
34. At the point (0, −2), in direction ~i + 2~j.
Note that the gradient points towards larger f values,
and is perpendicular to the contour it is based on.
37. x2 − y = 1
Moving more in the y direction than x, or towards lower
z values, so the directional derivative is negative.
The function would be f (x, y) = x2 − y, so the point
(2,3) would have function value
35. At the point (0, −2), in direction ~i − 2~j.
Moving towards higher z values, so the directional
derivative is positive.
f (2, 3) = 22 − 3 = 1
and so would lie on the contour f (x, y) = 1.
In Problems 36-37, check that the point (2, 3)
lies on the curve. Then, viewing the curve as a
contour of f (x, y), use ∇f (2, 3) to find a vector
normal to the curve at (2, 3) and an equation
for the tangent line to the curve at (2, 3).
2
The contour, y = x2 − 1, will be a parabola through
the point (0, -1).
To compute the gradient, we find the partial derivatives
∂f
= 2x
∂x
∂f
= −1
∂y
2
36. x + y = 13
The function would be f (x, y) = x2 + y 2 , so the point
(2,3) would have function value
∂f
(2, 3) = 4
∂x
∂f
(2, 3) = −1
∂x
Putting the partial derivatives together in a vector, we
obtain the gradient
f (2, 3) = 22 + 32 = 13
~ (2, 3) =< 4, −1 >
∇f
and so would lie on the contour f (x, y) = 13.
√
The curve will be a circle with radius 13 and centered
at the origin.
A diagram of the contours of f , with the gradient vector at (2, 3), is shown below.
5
∂f
at Q is positive because a small step in the
∂x
positive x direction leads to an increase in f .
∂f
(d)
at Q is negative because a small step in the
∂y
positive y direction leads to a decrease in f .
(c)
39. The temperature at any point in the plane is
given by the function
100
T (x, y) = 2
x + y2 + 1
(a) What shape are the level curves of T ?
(b) Where on the plane is it hottest? What is
the temperature at that point?
Note that the gradient points towards larger f values,
and is perpendicular to the contour it is based on.
(c) Find the direction of the greatest increase
in temperature at the point (3, 2). What is
the magnitude of that greatest increase?
38. The contour diagram below represents the level
curves f (x, y).
(d) Find the direction of the greatest decrease
in temperature at the point (3, 2).
(e) Find a direction at the point (3, 2) in which
the temperature does not increase or decrease.
(a) The level curves of T are circles, since if T is a
constant values, say c:
In each of the following parts, decide whether
the given quantity is positive, negative or zero.
Explain your answer.
100
+ y2 + 1
100
x2 + y 2 + 1 =
c
100
2
2
so x + y =
−1
| c {z }
c=
(a) The value of ∇f · ~i at P .
(b) The value of ∇f · ~j at P .
∂f
at Q.
∂x
∂f
(d)
at Q.
∂y
(c)
x2
r2
which is the formula for a circle in 2D.
Note that this question is more about knowing the definition of directional derivative than about any particular calculation.
(b) The plane will be hottest when the denominator
is smallest. From the form of the denominator,
this will be when x2 and y 2 are smallest, or at
(x, y) = (0, 0). Any other point (x, y) leads to a
smaller temperature.
(a) ∇f · ~i is the x-direction partial derivative of f :
∇f · ~i = D~ f
i
(c) To find the direction of maximum temperature increase at (3, 2), we need the gradient vector.
= slope of surface in direction of ~i
= slope of surface in pos x direction
−200x
(x2 + y 2 + 1)2
−200y
Ty = 2
(x + y 2 + 1)2
−600 −400
∇T (3, 2) =
,
196 196
= fx
Tx =
For a small step in the positive x direction from P ,
the function the function decreases so
fx = ∇f · ~i < 0
or, to see the direction more easily,
200
50
∇T (3, 2) =
h−3, −2i =
h−3, −2i
196
49
(b) Similarly, ∇f ·~j is the y-direction partial derivative
of f . For a small step in the positive y direction
from P , the function the function increases so
fy = ∇f · ~j > 0
6
at a rate of 3.68 degrees per unit distance.
The steepness of the slope in this direction is given
by ||∇T ||:
||∇T (3, 2)|| =
(d) If the direction of maximum temperature increase
is h−3, −2i, then going in the opposite direction,
h3, 2i, will produce the most rapid temperature decrease.
50
50 √
13 ≈ 3.68
|| (−3, −2) || =
49
49
(e) The direction in which the temperature does not
change is perpendicular to gradient, or in the direction h2, −3i or h−2, 3i.
At (3, 2), if you move towards the origin (in the direction of h−3, −2i), the temperature will increase
7