{"id":3929,"date":"2022-04-05T18:48:39","date_gmt":"2022-04-05T18:48:39","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/calculus3\/?post_type=chapter&#038;p=3929"},"modified":"2022-10-29T02:10:07","modified_gmt":"2022-10-29T02:10:07","slug":"directional-derivatives","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/calculus3\/chapter\/directional-derivatives\/","title":{"raw":"Directional Derivatives","rendered":"Directional Derivatives"},"content":{"raw":"<div class=\"textbox learning-objectives\">\r\n<h3>Learning Objectives<\/h3>\r\n<ul>\r\n \t<li><span class=\"os-abstract-content\">Determine the directional derivative in a given direction for a function of two variables.<\/span><\/li>\r\n<\/ul>\r\n<\/div>\r\nWe start with the graph of a surface defined by the equation [latex]z=f(x, y)[\/latex]. Given a point [latex](a, b)[\/latex] in the domain of [latex]f[\/latex], we choose a direction to travel from that point. We measure the direction using an angle [latex]\\theta[\/latex] which is measured counterclockwise in the [latex]x, y[\/latex]-plane, starting at zero from the positive [latex]x[\/latex]-axis (Figure 1). The distance we travel is [latex]h[\/latex] and the direction we travel is given by the unit vector [latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Therefore, the [latex]z[\/latex]-coordinate of the second point on the graph is given by\u00a0[latex]z=f(a+h\\cos\\theta,\\,b+h\\sin\\theta)[\/latex].\r\n\r\n[caption id=\"attachment_1256\" align=\"aligncenter\" width=\"728\"]<img class=\"size-full wp-image-1256\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010025\/4-6-1.jpeg\" alt=\"A shape in xyz space with point (a, b, f(a, b)). From the point, there is an arrow that represents the directional derivative. On the xy plane, the point (a, b) is marked and an angle of size \u03b8 is made between the projection of the directional derivative onto the plane and a line parallel to the x axis.\" width=\"728\" height=\"621\" \/> Figure 1. Finding the directional derivative at a point on the graph of [latex]z=f(x,y)[\/latex]. The slope of the black arrow on the graph indicates the value of the directional derivative at that point.[\/caption]We can calculate the slope of the secant line by dividing the difference in [latex]z[\/latex]-values by the length of the line segment connecting the two points in the domain. The length of the line segment is [latex]h[\/latex]. Therefore, the slope of the secant line is\r\n<p style=\"text-align: center;\">[latex]\\LARGE{m_{\\text{sec}}=\\frac{f(a+h\\cos\\theta,\\,b+h\\sin\\theta)-f(a,\\,b)}{h}}[\/latex]<\/p>\r\nTo find the slope of the tangent line in the same direction, we take the limit as\u00a0[latex]h[\/latex] approaches zero.\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\">Definition<\/h3>\r\n\r\n<hr \/>\r\n\r\nSuppose\u00a0[latex]z=f(x, y)[\/latex] is a function of two variables with a domain of\u00a0[latex]D[\/latex]. Let\u00a0[latex](a,b)\\in{D}[\/latex] and define\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Then the <strong>directional derivative<\/strong> of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex] is given by\r\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(a,b)=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h}},[\/latex]<\/p>\r\nprovided the limit exists.\r\n\r\n<\/div>\r\nThe directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]\u00a0provides a formal definition of the directional derivative that can be used in many cases to calculate a directional derivative.\r\n<div class=\"textbox exercises\">\r\n<h3>Example: finding the Directional derivative from the definition<\/h3>\r\nLet\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]. Find the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. What is\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex]?\r\n\r\n[reveal-answer q=\"223676598\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"223676598\"]\r\n\r\nFirst of all, since [latex]\\cos\\theta=3\/5[\/latex] and\u00a0[latex]\\theta[\/latex] is acute, this implies\r\n<p style=\"text-align: center;\">[latex]\\large{\\sin\\theta=\\sqrt{1-\\left(\\frac35\\right)^2}=\\sqrt{\\frac{16}{25}}=\\frac45}[\/latex]<\/p>\r\nUsing\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex], we first calculate\u00a0[latex]f(x+h\\cos\\theta,y+h\\sin\\theta)[\/latex]:\r\n\r\n[latex]\\begin{align}\r\n\r\nf(x+h\\cos\\theta,y+h\\sin\\theta)&amp;=(x+h\\cos\\theta)^2-(x+h\\cos\\theta)(y+h\\sin\\theta)+3(y+h\\sin\\theta)^2 \\\\\r\n\r\n&amp;=x^2+2xh\\cos\\theta+h^2\\cos^2\\theta-xy-xh\\sin\\theta-yh\\cos\\theta-h^2\\sin\\theta\\cos\\theta+3y^2 \\\\\r\n\r\n&amp;\\;\\;\\;+6yh\\sin\\theta+3h^2\\sin^2\\theta \\\\\r\n\r\n&amp;=x^2+2xh\\left(\\frac35\\right)+\\frac{9h^2}{25}-xy-\\frac{4xh}5-\\frac{3yh}5-\\frac{12h^2}{25}+3y^2 +6yh\\left(\\frac45\\right)+3h^2\\left(\\frac{16}{25}\\right) \\\\\r\n\r\n&amp;=x^2-xy+3y^2+\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5.\r\n\r\n\\end{align}[\/latex]\r\n\r\nWe substitute this expression into\u00a0the directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]:\r\n\r\n[latex]\\hspace{4cm}\\begin{align}\r\n\r\nD_{\\bf{u}}f(a,b)&amp;=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h} \\\\\r\n\r\n&amp;=\\displaystyle\\lim_{h\\to0}\\frac{(x^2-xy+3y^2+\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5)-(x^2-xy+3y^2)}{h} \\\\\r\n\r\n&amp;=\\displaystyle\\lim_{h\\to0}\\frac{\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5}{h} \\\\\r\n\r\n&amp;=\\displaystyle\\lim_{h\\to0}\\frac{2x}5+\\frac{9h}5+\\frac{21y}5 \\\\\r\n\r\n&amp;=\\frac{2x+21y}5.\r\n\r\n\\end{align}[\/latex]\r\n\r\nTo calculate\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex], we substitute\u00a0[latex]x=-1[\/latex] and\u00a0[latex]y=2[\/latex] into this answer:\r\n\r\n[latex]\\hspace{4cm}\\begin{align}\r\n\r\nD_{\\bf{u}}f(-1,2)&amp;=\\frac{2(-1)+21(2)}5 \\\\\r\n\r\n&amp;=\\frac{-2+42}5 \\\\\r\n\r\n&amp;= 8.\r\n\r\n\\end{align}[\/latex]\r\n\r\n(See the following figure.)\r\n\r\n[caption id=\"attachment_1258\" align=\"aligncenter\" width=\"773\"]<img class=\"size-full wp-image-1258\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010205\/4-6-2.jpeg\" alt=\"The shape f(x, y) = x2 \u2013 xy + 3y2 in xyz space with tangent plane at point (\u20131, 2, 15). There are two arrows from the point, one seemingly along the surface of the shape and the other in a direction on the plane. The one that corresponds to the plane is marked u = 3\/5 i + 4\/5 j.\" width=\"773\" height=\"541\" \/> Figure 2.\u00a0Finding the directional derivative in a given direction [latex]\\small{\\bf{u}}[\/latex]\u00a0at a given point on a surface. The plane is tangent to the surface at the given point [latex]\\small{(-1,2,15)}[\/latex][\/caption][\/hidden-answer]<\/div>\r\nAnother approach to calculating a directional derivative involves partial derivatives, as outlined in the following theorem.\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\">Theorem: Directional derivative of a function of two variables<\/h3>\r\n\r\n<hr \/>\r\n\r\nLet\u00a0[latex]z=f(x, y)[\/latex] be a function of two variables\u00a0[latex]x[\/latex] and\u00a0[latex]y[\/latex], and assume that\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex] exist. Then the directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=\\cos\\theta{\\bf{i}}+\\sin\\theta\\bf{j}[\/latex] is given by\r\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(x,y)=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta}.[\/latex]<\/p>\r\n\r\n<\/div>\r\n<h2 data-type=\"title\">Proof<\/h2>\r\n<p id=\"fs-id1167793938547\">The directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]\u00a0states that the directional derivative of [latex]f[\/latex] in the direction of [latex]{\\bf{u}}=\\cos\\theta{\\bf{i}}+\\sin\\theta\\bf{j}[\/latex] is given by<\/p>\r\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(a,b)=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h}[\/latex]<\/p>\r\nLet [latex]x=a+t\\cos\\theta[\/latex] and [latex]y=b+t\\sin\\theta[\/latex], and define [latex]g(t)=f(x, y)[\/latex]. Since [latex]f_x[\/latex] and [latex]f_y[\/latex] both exist, and therefore [latex]f[\/latex] is differentiable, we can use the chain rule for functions of two variables to calculate\u00a0[latex]{g}'(t)[\/latex]:\r\n\r\n[latex]\\hspace{8.5cm}\\begin{align}\r\n\r\ng'(t)&amp;=\\frac{\\partial f}{\\partial x}\\frac{dx}{dt}+\\frac{\\partial f}{\\partial y}\\frac{dy}{dt} \\\\\r\n\r\n&amp;=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta.\r\n\r\n\\end{align}[\/latex]\r\n\r\nIf\u00a0[latex]t=0[\/latex], then\u00a0[latex]x=x_0(=a)[\/latex] and\u00a0[latex]y=y_0(=b)[\/latex], so\r\n<p style=\"text-align: center;\">[latex]g'(0)=f_x(x_0,y_0)\\cos\\theta+f_y(x_0,y_0)\\sin\\theta[\/latex]<\/p>\r\nBy the definition of\u00a0[latex]{g}'(t)[\/latex], it is also true that\r\n\r\n[latex]\r\n\r\n\\hspace{8.5cm}\\begin{align}\r\n\r\ng'(0)&amp;=\\displaystyle\\lim_{t\\to0}\\frac{g(t)-g(0)}t \\\\\r\n\r\n&amp;=\\displaystyle\\lim_{t\\to0}\\frac{f(x_0+t\\cos\\theta,y_0+t\\sin\\theta)-f(x_0,y_0)}t.\r\n\r\n\\end{align}[\/latex]\r\n\r\nTherefore,\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta[\/latex].\r\n\r\n[latex]_\\blacksquare[\/latex]\r\n<div class=\"textbox exercises\">\r\n<h3>Example: Finding a directional derivative: Alternative Method<\/h3>\r\nLet\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]. Find the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. What is\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex]?\r\n\r\n[reveal-answer q=\"547112905\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"547112905\"]\r\n\r\nFirst we must calculate the partial derivatives of\u00a0[latex]f[\/latex]:\r\n<p style=\"text-align: center;\">[latex]f_x=2x-y[\/latex]<\/p>\r\n<p style=\"text-align: center;\">[latex]f_y=-x+6y[\/latex],<\/p>\r\nThen we use\u00a0the Directional Derivative of a Function of Two Variables\u00a0with\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]:\r\n\r\n[latex]\\hspace{8.5cm}\\begin{align}\r\n\r\nD_{\\bf{u}}f(x,y)&amp;=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta \\\\\r\n\r\n&amp;=(2x-y)\\frac35+(-x+6y)\\frac45 \\\\\r\n\r\n&amp;=\\frac{6x}5-\\frac{3y}5-\\frac{4x}5+\\frac{24y}5 \\\\\r\n\r\n&amp;=\\frac{2x+21y}5.\r\n\r\n\\end{align}[\/latex]\r\n\r\nTo calculate\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex], let\u00a0[latex]x=-1[\/latex] and\u00a0[latex]y=2[\/latex]:\r\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(-1,2)=\\large{\\frac{2(-1)+21(2)}5}=\\large{\\frac{-2+42}5}=8.[\/latex]<\/p>\r\nThis is the same answer obtained in\u00a0the Example: Finding a Directional Derivative from the Definition.\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try it<\/h3>\r\nFind the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=3x^2y-4xy^3+3y^2-4x[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\frac{\\pi}3){\\bf{i}}+(\\sin\\frac{\\pi}3)\\bf{j}[\/latex] using\u00a0the Directional Derivative of a Function of Two Variables. What is\u00a0[latex]D_{\\bf{u}}f(3,4)[\/latex]?\r\n\r\n[reveal-answer q=\"541286411\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"541286411\"]\r\n\r\n[latex]\\hspace{5cm}\\begin{align}\r\n\r\nD_{\\bf{u}}f(x,y)&amp;=\\frac{(6xy-4y^3-4)(1)}2+\\frac{(3x^2-12xy^2+6y)\\sqrt3}2 \\\\\r\n\r\nD_{\\bf{u}}f(3,4)&amp;=\\frac{72-256-4}2+\\frac{(27-576+24)\\sqrt3}2=-94-\\frac{525\\sqrt3}2.\r\n\r\n\\end{align}[\/latex]\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n\r\n[caption]Watch the following video to see the worked solution to the above Try It[\/caption]\r\n\r\n<center><iframe src=\"\/\/plugin.3playmedia.com\/show?mf=8186163&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=wPZAE8M5F6k&amp;video_target=tpm-plugin-kevk5ynk-wPZAE8M5F6k\" width=\"800px\" height=\"450px\" frameborder=\"0\" marginwidth=\"0px\" marginheight=\"0px\"><\/iframe><\/center><center>You can view the <a href=\"https:\/\/course-building.s3.us-west-2.amazonaws.com\/Calculus+3\/Calc+3+transcripts\/CP4.28_transcript.html\">transcript for \u201cCP 4.28\u201d here (opens in new window).<\/a><\/center>If the vector that is given for the direction of the derivative is not a unit vector, then it is only necessary to divide by the norm of the vector. For example, if we wished to find the directional derivative of the function in\u00a0Example: Finding a Directional Derivative: Alternative Method\u00a0in the direction of the vector [latex]\\langle-5,12\\rangle[\/latex] we would first divide by its magnitude to get [latex]\\bf{u}[\/latex]. This gives us [latex]{\\bf{u}}=\\langle-(5\/13),12\/13\\rangle[\/latex]. Then\r\n\r\n[latex]\\hspace{8.5cm}\\begin{align}\r\n\r\nD_{\\bf{u}}f(x,y)&amp;=\\nabla{f}(x,y)\\cdot\\bf{u} \\\\\r\n\r\n&amp;=-\\frac5{13}(2x-y)+\\frac{12}{13}(-x+6y) \\\\\r\n\r\n&amp;=-\\frac{22}{13}x+\\frac{17}{13}y.\r\n\r\n\\end{align}[\/latex]","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning Objectives<\/h3>\n<ul>\n<li><span class=\"os-abstract-content\">Determine the directional derivative in a given direction for a function of two variables.<\/span><\/li>\n<\/ul>\n<\/div>\n<p>We start with the graph of a surface defined by the equation [latex]z=f(x, y)[\/latex]. Given a point [latex](a, b)[\/latex] in the domain of [latex]f[\/latex], we choose a direction to travel from that point. We measure the direction using an angle [latex]\\theta[\/latex] which is measured counterclockwise in the [latex]x, y[\/latex]-plane, starting at zero from the positive [latex]x[\/latex]-axis (Figure 1). The distance we travel is [latex]h[\/latex] and the direction we travel is given by the unit vector [latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Therefore, the [latex]z[\/latex]-coordinate of the second point on the graph is given by\u00a0[latex]z=f(a+h\\cos\\theta,\\,b+h\\sin\\theta)[\/latex].<\/p>\n<div id=\"attachment_1256\" style=\"width: 738px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1256\" class=\"size-full wp-image-1256\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010025\/4-6-1.jpeg\" alt=\"A shape in xyz space with point (a, b, f(a, b)). From the point, there is an arrow that represents the directional derivative. On the xy plane, the point (a, b) is marked and an angle of size \u03b8 is made between the projection of the directional derivative onto the plane and a line parallel to the x axis.\" width=\"728\" height=\"621\" \/><\/p>\n<p id=\"caption-attachment-1256\" class=\"wp-caption-text\">Figure 1. Finding the directional derivative at a point on the graph of [latex]z=f(x,y)[\/latex]. The slope of the black arrow on the graph indicates the value of the directional derivative at that point.<\/p>\n<\/div>\n<p>We can calculate the slope of the secant line by dividing the difference in [latex]z[\/latex]-values by the length of the line segment connecting the two points in the domain. The length of the line segment is [latex]h[\/latex]. Therefore, the slope of the secant line is<\/p>\n<p style=\"text-align: center;\">[latex]\\LARGE{m_{\\text{sec}}=\\frac{f(a+h\\cos\\theta,\\,b+h\\sin\\theta)-f(a,\\,b)}{h}}[\/latex]<\/p>\n<p>To find the slope of the tangent line in the same direction, we take the limit as\u00a0[latex]h[\/latex] approaches zero.<\/p>\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\">Definition<\/h3>\n<hr \/>\n<p>Suppose\u00a0[latex]z=f(x, y)[\/latex] is a function of two variables with a domain of\u00a0[latex]D[\/latex]. Let\u00a0[latex](a,b)\\in{D}[\/latex] and define\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Then the <strong>directional derivative<\/strong> of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex] is given by<\/p>\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(a,b)=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h}},[\/latex]<\/p>\n<p>provided the limit exists.<\/p>\n<\/div>\n<p>The directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]\u00a0provides a formal definition of the directional derivative that can be used in many cases to calculate a directional derivative.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example: finding the Directional derivative from the definition<\/h3>\n<p>Let\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]. Find the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. What is\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex]?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q223676598\">Show Solution<\/span><\/p>\n<div id=\"q223676598\" class=\"hidden-answer\" style=\"display: none\">\n<p>First of all, since [latex]\\cos\\theta=3\/5[\/latex] and\u00a0[latex]\\theta[\/latex] is acute, this implies<\/p>\n<p style=\"text-align: center;\">[latex]\\large{\\sin\\theta=\\sqrt{1-\\left(\\frac35\\right)^2}=\\sqrt{\\frac{16}{25}}=\\frac45}[\/latex]<\/p>\n<p>Using\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex], we first calculate\u00a0[latex]f(x+h\\cos\\theta,y+h\\sin\\theta)[\/latex]:<\/p>\n<p>[latex]\\begin{align}    f(x+h\\cos\\theta,y+h\\sin\\theta)&=(x+h\\cos\\theta)^2-(x+h\\cos\\theta)(y+h\\sin\\theta)+3(y+h\\sin\\theta)^2 \\\\    &=x^2+2xh\\cos\\theta+h^2\\cos^2\\theta-xy-xh\\sin\\theta-yh\\cos\\theta-h^2\\sin\\theta\\cos\\theta+3y^2 \\\\    &\\;\\;\\;+6yh\\sin\\theta+3h^2\\sin^2\\theta \\\\    &=x^2+2xh\\left(\\frac35\\right)+\\frac{9h^2}{25}-xy-\\frac{4xh}5-\\frac{3yh}5-\\frac{12h^2}{25}+3y^2 +6yh\\left(\\frac45\\right)+3h^2\\left(\\frac{16}{25}\\right) \\\\    &=x^2-xy+3y^2+\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5.    \\end{align}[\/latex]<\/p>\n<p>We substitute this expression into\u00a0the directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]:<\/p>\n<p>[latex]\\hspace{4cm}\\begin{align}    D_{\\bf{u}}f(a,b)&=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h} \\\\    &=\\displaystyle\\lim_{h\\to0}\\frac{(x^2-xy+3y^2+\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5)-(x^2-xy+3y^2)}{h} \\\\    &=\\displaystyle\\lim_{h\\to0}\\frac{\\frac{2xh}5+\\frac{9h^2}5+\\frac{21yh}5}{h} \\\\    &=\\displaystyle\\lim_{h\\to0}\\frac{2x}5+\\frac{9h}5+\\frac{21y}5 \\\\    &=\\frac{2x+21y}5.    \\end{align}[\/latex]<\/p>\n<p>To calculate\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex], we substitute\u00a0[latex]x=-1[\/latex] and\u00a0[latex]y=2[\/latex] into this answer:<\/p>\n<p>[latex]\\hspace{4cm}\\begin{align}    D_{\\bf{u}}f(-1,2)&=\\frac{2(-1)+21(2)}5 \\\\    &=\\frac{-2+42}5 \\\\    &= 8.    \\end{align}[\/latex]<\/p>\n<p>(See the following figure.)<\/p>\n<div id=\"attachment_1258\" style=\"width: 783px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1258\" class=\"size-full wp-image-1258\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010205\/4-6-2.jpeg\" alt=\"The shape f(x, y) = x2 \u2013 xy + 3y2 in xyz space with tangent plane at point (\u20131, 2, 15). There are two arrows from the point, one seemingly along the surface of the shape and the other in a direction on the plane. The one that corresponds to the plane is marked u = 3\/5 i + 4\/5 j.\" width=\"773\" height=\"541\" \/><\/p>\n<p id=\"caption-attachment-1258\" class=\"wp-caption-text\">Figure 2.\u00a0Finding the directional derivative in a given direction [latex]\\small{\\bf{u}}[\/latex]\u00a0at a given point on a surface. The plane is tangent to the surface at the given point [latex]\\small{(-1,2,15)}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Another approach to calculating a directional derivative involves partial derivatives, as outlined in the following theorem.<\/p>\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\">Theorem: Directional derivative of a function of two variables<\/h3>\n<hr \/>\n<p>Let\u00a0[latex]z=f(x, y)[\/latex] be a function of two variables\u00a0[latex]x[\/latex] and\u00a0[latex]y[\/latex], and assume that\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex] exist. Then the directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=\\cos\\theta{\\bf{i}}+\\sin\\theta\\bf{j}[\/latex] is given by<\/p>\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(x,y)=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta}.[\/latex]<\/p>\n<\/div>\n<h2 data-type=\"title\">Proof<\/h2>\n<p id=\"fs-id1167793938547\">The directional derivative of\u00a0[latex]f[\/latex] in the direction of\u00a0[latex]\\bf{u}[\/latex]\u00a0states that the directional derivative of [latex]f[\/latex] in the direction of [latex]{\\bf{u}}=\\cos\\theta{\\bf{i}}+\\sin\\theta\\bf{j}[\/latex] is given by<\/p>\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(a,b)=\\displaystyle\\lim_{h\\to0}\\frac{f(a+h\\cos\\theta,b+h\\sin\\theta)-f(a,b)}{h}[\/latex]<\/p>\n<p>Let [latex]x=a+t\\cos\\theta[\/latex] and [latex]y=b+t\\sin\\theta[\/latex], and define [latex]g(t)=f(x, y)[\/latex]. Since [latex]f_x[\/latex] and [latex]f_y[\/latex] both exist, and therefore [latex]f[\/latex] is differentiable, we can use the chain rule for functions of two variables to calculate\u00a0[latex]{g}'(t)[\/latex]:<\/p>\n<p>[latex]\\hspace{8.5cm}\\begin{align}    g'(t)&=\\frac{\\partial f}{\\partial x}\\frac{dx}{dt}+\\frac{\\partial f}{\\partial y}\\frac{dy}{dt} \\\\    &=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta.    \\end{align}[\/latex]<\/p>\n<p>If\u00a0[latex]t=0[\/latex], then\u00a0[latex]x=x_0(=a)[\/latex] and\u00a0[latex]y=y_0(=b)[\/latex], so<\/p>\n<p style=\"text-align: center;\">[latex]g'(0)=f_x(x_0,y_0)\\cos\\theta+f_y(x_0,y_0)\\sin\\theta[\/latex]<\/p>\n<p>By the definition of\u00a0[latex]{g}'(t)[\/latex], it is also true that<\/p>\n<p>[latex]\\hspace{8.5cm}\\begin{align}    g'(0)&=\\displaystyle\\lim_{t\\to0}\\frac{g(t)-g(0)}t \\\\    &=\\displaystyle\\lim_{t\\to0}\\frac{f(x_0+t\\cos\\theta,y_0+t\\sin\\theta)-f(x_0,y_0)}t.    \\end{align}[\/latex]<\/p>\n<p>Therefore,\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta[\/latex].<\/p>\n<p>[latex]_\\blacksquare[\/latex]<\/p>\n<div class=\"textbox exercises\">\n<h3>Example: Finding a directional derivative: Alternative Method<\/h3>\n<p>Let\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]. Find the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. What is\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex]?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q547112905\">Show Solution<\/span><\/p>\n<div id=\"q547112905\" class=\"hidden-answer\" style=\"display: none\">\n<p>First we must calculate the partial derivatives of\u00a0[latex]f[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]f_x=2x-y[\/latex]<\/p>\n<p style=\"text-align: center;\">[latex]f_y=-x+6y[\/latex],<\/p>\n<p>Then we use\u00a0the Directional Derivative of a Function of Two Variables\u00a0with\u00a0[latex]\\theta=\\arccos(3\/5)[\/latex]:<\/p>\n<p>[latex]\\hspace{8.5cm}\\begin{align}    D_{\\bf{u}}f(x,y)&=f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta \\\\    &=(2x-y)\\frac35+(-x+6y)\\frac45 \\\\    &=\\frac{6x}5-\\frac{3y}5-\\frac{4x}5+\\frac{24y}5 \\\\    &=\\frac{2x+21y}5.    \\end{align}[\/latex]<\/p>\n<p>To calculate\u00a0[latex]D_{\\bf{u}}f(-1,2)[\/latex], let\u00a0[latex]x=-1[\/latex] and\u00a0[latex]y=2[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(-1,2)=\\large{\\frac{2(-1)+21(2)}5}=\\large{\\frac{-2+42}5}=8.[\/latex]<\/p>\n<p>This is the same answer obtained in\u00a0the Example: Finding a Directional Derivative from the Definition.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try it<\/h3>\n<p>Find the directional derivative\u00a0[latex]D_{\\bf{u}}f(x,y)[\/latex] of\u00a0[latex]f(x,y)=3x^2y-4xy^3+3y^2-4x[\/latex] in the direction of\u00a0[latex]{\\bf{u}}=(\\cos\\frac{\\pi}3){\\bf{i}}+(\\sin\\frac{\\pi}3)\\bf{j}[\/latex] using\u00a0the Directional Derivative of a Function of Two Variables. What is\u00a0[latex]D_{\\bf{u}}f(3,4)[\/latex]?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q541286411\">Show Solution<\/span><\/p>\n<div id=\"q541286411\" class=\"hidden-answer\" style=\"display: none\">\n<p>[latex]\\hspace{5cm}\\begin{align}    D_{\\bf{u}}f(x,y)&=\\frac{(6xy-4y^3-4)(1)}2+\\frac{(3x^2-12xy^2+6y)\\sqrt3}2 \\\\    D_{\\bf{u}}f(3,4)&=\\frac{72-256-4}2+\\frac{(27-576+24)\\sqrt3}2=-94-\\frac{525\\sqrt3}2.    \\end{align}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>Watch the following video to see the worked solution to the above Try It<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"\/\/plugin.3playmedia.com\/show?mf=8186163&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=wPZAE8M5F6k&amp;video_target=tpm-plugin-kevk5ynk-wPZAE8M5F6k\" width=\"800px\" height=\"450px\" frameborder=\"0\" marginwidth=\"0px\" marginheight=\"0px\"><\/iframe><\/div>\n<div style=\"text-align: center;\">You can view the <a href=\"https:\/\/course-building.s3.us-west-2.amazonaws.com\/Calculus+3\/Calc+3+transcripts\/CP4.28_transcript.html\">transcript for \u201cCP 4.28\u201d here (opens in new window).<\/a><\/div>\n<p>If the vector that is given for the direction of the derivative is not a unit vector, then it is only necessary to divide by the norm of the vector. For example, if we wished to find the directional derivative of the function in\u00a0Example: Finding a Directional Derivative: Alternative Method\u00a0in the direction of the vector [latex]\\langle-5,12\\rangle[\/latex] we would first divide by its magnitude to get [latex]\\bf{u}[\/latex]. This gives us [latex]{\\bf{u}}=\\langle-(5\/13),12\/13\\rangle[\/latex]. Then<\/p>\n<p>[latex]\\hspace{8.5cm}\\begin{align}    D_{\\bf{u}}f(x,y)&=\\nabla{f}(x,y)\\cdot\\bf{u} \\\\    &=-\\frac5{13}(2x-y)+\\frac{12}{13}(-x+6y) \\\\    &=-\\frac{22}{13}x+\\frac{17}{13}y.    \\end{align}[\/latex]<\/p>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-3929\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Original<\/div><ul class=\"citation-list\"><li>CP 4.28. <strong>Authored by<\/strong>: Ryan Melton. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>Calculus Volume 3. <strong>Authored by<\/strong>: Gilbert Strang, Edwin (Jed) Herman. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/openstax.org\/books\/calculus-volume-3\/pages\/1-introduction\">https:\/\/openstax.org\/books\/calculus-volume-3\/pages\/1-introduction<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/\">CC BY-NC-SA: Attribution-NonCommercial-ShareAlike<\/a><\/em>. <strong>License Terms<\/strong>: Access for free at https:\/\/openstax.org\/books\/calculus-volume-3\/pages\/1-introduction<\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":349141,"menu_order":25,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Calculus Volume 3\",\"author\":\"Gilbert Strang, Edwin (Jed) Herman\",\"organization\":\"OpenStax\",\"url\":\"https:\/\/openstax.org\/books\/calculus-volume-3\/pages\/1-introduction\",\"project\":\"\",\"license\":\"cc-by-nc-sa\",\"license_terms\":\"Access for free at https:\/\/openstax.org\/books\/calculus-volume-3\/pages\/1-introduction\"},{\"type\":\"original\",\"description\":\"CP 4.28\",\"author\":\"Ryan Melton\",\"organization\":\"\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-3929","chapter","type-chapter","status-publish","hentry"],"part":22,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/users\/349141"}],"version-history":[{"count":12,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3929\/revisions"}],"predecessor-version":[{"id":5914,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3929\/revisions\/5914"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/parts\/22"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3929\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/media?parent=3929"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapter-type?post=3929"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/contributor?post=3929"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/license?post=3929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}