{"id":3931,"date":"2022-04-05T18:49:35","date_gmt":"2022-04-05T18:49:35","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/calculus3\/?post_type=chapter&#038;p=3931"},"modified":"2022-10-29T02:11:11","modified_gmt":"2022-10-29T02:11:11","slug":"gradient","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/calculus3\/chapter\/gradient\/","title":{"raw":"Gradient","rendered":"Gradient"},"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 gradient vector of a given real-valued function.<\/span><\/li>\r\n \t<li><span class=\"os-abstract-content\">Explain the significance of the gradient vector with regard to direction of change along a surface.<\/span><\/li>\r\n \t<li><span class=\"os-abstract-content\">Use the gradient to find the tangent to a level curve of a given function.<\/span><\/li>\r\n<\/ul>\r\n<\/div>\r\nThe right-hand side of\u00a0the Directional Derivative of a Function of Two Variables\u00a0is equal to\u00a0[latex]f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta[\/latex], which can be written as the dot product of two vectors. Define the first vector as\u00a0[latex]\\nabla{f}(x,y)=f_x(x,y){\\bf{i}}+f_y(x,y)\\bf{j}[\/latex] and the second vector as\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Then the\u00a0right-hand side of the equation can be written as the dot product of these two vectors:\r\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(x,y)=\\nabla{f}(x,y)\\cdot\\bf{u}.[\/latex]<\/p>\r\nThe first vector in\u00a0the previous equation\u00a0has a special name: the gradient of the function\u00a0[latex]f[\/latex]. The symbol\u00a0[latex]\\nabla[\/latex] is called\u00a0<em>nabla<\/em> and the vector\u00a0[latex]\\nabla{f}[\/latex] is read \"del\u00a0[latex]f[\/latex]\".\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\">Definition<\/h3>\r\n\r\n<hr \/>\r\n\r\nLet\u00a0[latex]z=f(x, y)[\/latex] be a function of\u00a0[latex]x[\/latex] and\u00a0[latex]x[\/latex] such that\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex] exist. The vector\u00a0[latex]\\nabla{f}(x,y)[\/latex] is called the <strong>gradient<\/strong> of\u00a0[latex]f[\/latex] and is defined as\r\n<p style=\"text-align: center;\">[latex]\\nabla{f}(x,y)=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}}.[\/latex]<\/p>\r\nThe vector\u00a0[latex]\\nabla{f}(x,y)[\/latex] is also written as \"grad\u00a0[latex]f[\/latex]\".\r\n\r\n<\/div>\r\n<div class=\"textbox exercises\">\r\n<h3>Example: finding gradients<\/h3>\r\nFind the gradient\u00a0[latex]\\nabla{f}(x,y)[\/latex] of each of the following functions:\r\n\r\na.\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex]\r\n\r\nb.\u00a0[latex]f(x,y)=\\sin{3x}\\cos{3y}[\/latex]\r\n\r\n[reveal-answer q=\"131344589\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"131344589\"]\r\n\r\nFor both parts a. and b., we first calculate the partial derivatives\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex], then use\u00a0the gradient of [latex]f[\/latex].\r\n\r\na.\r\n\r\n[latex]\\hspace{1cm}\\begin{align}\r\n\r\nf_x(x,y)&amp;=2x-y\\text{ and }f_x(x,y)=-x+6y,\\text{ so} \\\\\r\n\r\n\\nabla{f}(x,y)&amp;=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}} \\\\\r\n\r\n&amp;=(2x-y){\\bf{i}}+(-x+6y){\\bf{j}}.\r\n\r\n\\end{align}[\/latex]\r\n\r\nb.\r\n\r\n[latex]\\hspace{1cm}\\begin{align}\r\n\r\nf_x(x,y)&amp;=3\\cos{3x}\\cos{3y}\\text{ and }f_x(x,y)=-3\\sin{3x}\\sin{3y},\\text{ so} \\\\\r\n\r\n\\nabla{f}(x,y)&amp;=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}} \\\\\r\n\r\n&amp;=(3\\cos{3x}\\cos{3y}){\\bf{i}}-(3\\sin{3x}\\sin{3y}){\\bf{j}}.\r\n\r\n\\end{align}\r\n\r\n[\/latex]\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 gradient\u00a0[latex]\\nabla{f}(x,y)[\/latex] of\u00a0[latex]f(x,y)=(x^2-3y^2)\/(2x+y)[\/latex].\r\n\r\n[reveal-answer q=\"985372461\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"985372461\"]\r\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(x,y)=\\frac{2x^2+2xy+6y^2}{(2x+y)^2}{\\bf{i}}-\\frac{x^2+12xy+3y^2}{(2x+y)^2}{\\bf{j}}}[\/latex]<\/p>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n[ohm_question]72867[\/ohm_question]\r\n\r\n<\/div>\r\nThe gradient has some important properties. We have already seen one formula that uses the gradient: the formula for the directional derivative. Recall from\u00a0<a href=\"https:\/\/courses.lumenlearning.com\/calculus3\/chapter\/introduction-to-the-dot-product\/\" data-page-slug=\"2-3-the-dot-product\" data-page-uuid=\"7110f9df-6aa8-4c5b-adf0-ee8ed66ad26f\" data-page-fragment=\"page_7110f9df-6aa8-4c5b-adf0-ee8ed66ad26f\">The Dot Product<\/a>\u00a0that if the angle between two vectors [latex]\\bf{a}[\/latex] and [latex]\\bf{b}[\/latex] is\u00a0[latex]\\varphi[\/latex], then\u00a0[latex]{\\bf{a}}\\cdot{\\bf{b}}=\\|{\\bf{a}}\\|\\|{\\bf{b}}\\|\\cos\\varphi[\/latex]. Therefore, if the angle between\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] and\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta){\\bf{j}}[\/latex] is\u00a0[latex]\\varphi[\/latex], we have\r\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(x_0,y_0)=\\nabla{f}(x_0,y_0)\\cdot{\\bf{u}}=\\|\\nabla{f}(x_0,y_0)\\|\\|{\\bf{u}}\\|\\cos\\varphi=\\|\\nabla{f}(x_0,y_0)\\|\\cos\\varphi}[\/latex]<\/p>\r\nThe\u00a0[latex]\\|{\\bf{u}}\\|[\/latex]\u00a0disappears because [latex]\\bf{u}[\/latex] is a unit vector. Therefore, the directional derivative is equal to the magnitude of the gradient evaluated at\u00a0[latex](x_0, y_0)[\/latex], multiplied by\u00a0[latex]\\cos\\varphi[\/latex]. Recall that\u00a0[latex]\\cos\\varphi[\/latex] ranges from\u00a0[latex]-1[\/latex] to\u00a0[latex]1[\/latex]. If\u00a0[latex]\\varphi=0[\/latex], then\u00a0[latex]\\cos\\varphi=1[\/latex] and\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] and\u00a0[latex]\\bf{u}[\/latex] point in opposite directions. In the first case, the value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is maximized; in the second case, the value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is minimized. If\u00a0[latex]\\nabla{f}(x_0,y_0)=0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=\\nabla{f}(x_0,y_0)\\cdot{\\bf{u}}=0[\/latex] for any vector\u00a0[latex]\\bf{u}[\/latex]<strong>.<\/strong> These cases are outlined in the following theorem.\r\n<div><\/div>\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\">Theorem: properties of the gradient<\/h3>\r\n\r\n<hr \/>\r\n\r\nSuppose the function\u00a0[latex]z=f(x, y)[\/latex] is differentiable at\u00a0[latex](x_0, y_0)[\/latex] (Figure 3).\r\n\r\ni. If\u00a0[latex]\\nabla{f}(x_0,y_0)=0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=0[\/latex] for any unit vector\u00a0[latex]\\bf{u}[\/latex].\r\n\r\nii. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne 0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is maximized when\u00a0[latex]\\bf{u}[\/latex] points in the same direction as\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex]. The maximum value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is\u00a0[latex]\\|\\nabla{f}(x_0,y_0)\\|[\/latex].\r\n\r\niii. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne 0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is minimized when\u00a0[latex]\\bf{u}[\/latex] points in the opposite direction from\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex]. The minimum value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is\u00a0[latex]-\\|\\nabla{f}(x_0,y_0)\\|[\/latex].\r\n\r\n<\/div>\r\n\r\n[caption id=\"attachment_1260\" align=\"aligncenter\" width=\"607\"]<img class=\"size-full wp-image-1260\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010542\/4-6-3.jpeg\" alt=\"An upward facing paraboloid in xyz space with point P0 (x0, y0, z0). From this point, there are arrows going up, down, and around the paraboloid. On the xy plane, the point (x0, y0) is marked, and the corresponding arrows are drawn onto the plane: the down arrow corresponds to \u2212\u2207f (most rapid decrease in f), the up arrow corresponds to \u2207f (most rapid increase in f), and the arrows around correspond to no change in f. The up\/down arrows are perpendicular to the around arrows in their projection on the plane.\" width=\"607\" height=\"588\" \/> Figure 1. The gradient indicates the maximum and minimum values of the directional derivative at a point.[\/caption]\r\n\r\n<div class=\"textbox exercises\">\r\n<h3>Example: finding a maximum directional derivative<\/h3>\r\nFind the direction for which the directional derivative of [latex]f(x, y)=3x^{2}-4xy+2y^{2}[\/latex] at [latex](-2, 3)[\/latex] is a maximum. What is the maximum value?\r\n\r\n[reveal-answer q=\"721568432\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"721568432\"]\r\n\r\nThe maximum value of the directional derivative occurs when [latex]\\nabla{f}[\/latex] and the unit vector point in the same direction. Therefore, we start by calculating\u00a0[latex]\\nabla{f}(x,y)[\/latex]:\r\n\r\n[latex]\\hspace{6cm}\\large{\\begin{align}\r\n\r\nf_x(x,y)&amp;=6x-4y\\text{ and }f_y(x,y)=-4x+4y,\\text{ so} \\\\\r\n\r\n\\nabla{f}(x,y)&amp;=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}}=(6x-4y){\\bf{i}}+(-4x+4y){\\bf{j}}.\r\n\r\n\\end{align}}[\/latex]\r\n\r\nNext, we evaluate the gradient at\u00a0[latex](-2,3)[\/latex]:\r\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(-2,3)=(6(-2)-4(3)){\\bf{i}}+(-4(-2)+3(3)){\\bf{j}}=-24{\\bf{i}}+20{\\bf{j}}}.[\/latex]<\/p>\r\nWe need to find a unit vector that points in the same direction as [latex]\\nabla{f}(-2,3)[\/latex]<span style=\"font-size: 0.9em;\">,<\/span>\u00a0so the next step is to divide [latex]\\nabla{f}(-2,3)[\/latex] by its magnitude, which is\u00a0[latex]\\sqrt{(-24)^2+(20)^2}=\\sqrt{976}=4\\sqrt{61}[\/latex]. Therefore,\r\n<p style=\"text-align: center;\">[latex]\\large{\\frac{\\nabla{f}(-2,3)}{\\|\\nabla{f}(-2,3)\\|}=\\frac{-24}{4\\sqrt{61}}{\\bf{i}}+\\frac{20}{4\\sqrt{61}}{\\bf{j}}=\\frac{-6\\sqrt{61}}{61}{\\bf{i}}+\\frac{5\\sqrt{61}}{61}{\\bf{j}}}.[\/latex]<\/p>\r\nThis is the unit vector that points in the same direction as [latex]\\nabla{f}(-2,3)[\/latex]. To find the angle corresponding to this unit vector, we solve the equations\r\n<p style=\"text-align: center;\">[latex]\\large{\\cos\\theta=\\frac{-6\\sqrt{61}}{61}}[\/latex] and\u00a0[latex]\\large{\\sin\\theta=\\frac{5\\sqrt{61}}{61}}.[\/latex]<\/p>\r\nfor\u00a0[latex]\\theta[\/latex].\u00a0Since cosine is negative and sine is positive, the angle must be in the second quadrant. Therefore,\r\n\r\n[latex]\\theta=\\pi-\\arcsin{((5\\sqrt{61})\/61)}\\approx2.45\\text{ rad}.[\/latex]\r\n\r\nThe maximum value of the directional derivative at\u00a0[latex](-2, 3)[\/latex] is\u00a0[latex]\\|\\nabla{f}(-2,3)\\|=4\\sqrt{61}[\/latex] (see the following figure).\r\n\r\n[caption id=\"attachment_1262\" align=\"aligncenter\" width=\"523\"]<img class=\"size-full wp-image-1262\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010640\/4-6-4.jpeg\" alt=\"An upward facing paraboloid f(x, y) = 3x2 \u2013 4xy + 2y2 with tangent plane at the point (\u20132, 3, 54). The tangent plane has equation z = \u201324x + 20y \u2013 54.\" width=\"523\" height=\"340\" \/> Figure 2.\u00a0The maximum value of the directional derivative at [latex]\\small{(-2,3)}[\/latex]\u00a0is in the direction of the gradient.[\/caption][\/hidden-answer]<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try it<\/h3>\r\nFind the direction for which the directional derivative of\u00a0[latex]g(x, y)=4x-xy+2y^{2}[\/latex] at [latex](-2, 3)[\/latex] is a maximum. What is the maximum value?\r\n\r\n[reveal-answer q=\"161657349\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"161657349\"]\r\n\r\nThe gradient of [latex]g[\/latex] at\u00a0[latex](-2,3)[\/latex] is\u00a0[latex]\\nabla{g}(-2,3)={\\bf{i}}+14{\\bf{j}}[\/latex]. The unit vector that points in the same direction as\u00a0[latex]\\nabla{g}(-2,3)[\/latex] is\u00a0[latex]\\frac{\\nabla{g}(-2,3)}{\\|\\nabla{g}(-2,3)\\|}=\\frac{1}{\\sqrt{197}}{\\bf{i}}+\\frac{14}{\\sqrt{197}}{\\bf{j}}=\\frac{\\sqrt{197}}{197}{\\bf{i}}+\\frac{14\\sqrt{197}}{197}{\\bf{j}}[\/latex], which gives an angle of\u00a0[latex]\\theta=\\arcsin((14\\sqrt{197})\/197\\approx1.499\\text{ rad}[\/latex]. The maximum value of the directional derivative is\u00a0[latex]\\nabla{g}(-2,3)\\approx\\sqrt{197}[\/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.\r\n\r\n<center><iframe src=\"\/\/plugin.3playmedia.com\/show?mf=8186164&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=n8TmTVwACTM&amp;video_target=tpm-plugin-rpwvmbgw-n8TmTVwACTM\" 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.30_transcript.html\">transcript for \u201cCP 4.30\u201d here (opens in new window).<\/a><\/center>Figure 5 shows a portion of the graph of the function [latex]f(x,y)=3+\\sin x\\sin y[\/latex]. Given a point [latex](a, b)[\/latex] in the domain of [latex]f[\/latex], the maximum value of the gradient at that point is given by [latex]\\|\\nabla{f}(a,b)\\|[\/latex]. This would equal the rate of greatest ascent if the surface represented a topographical map. If we went in the opposite direction, it would be the rate of greatest descent.\r\n\r\n[caption id=\"attachment_1265\" align=\"aligncenter\" width=\"724\"]<img class=\"size-full wp-image-1265\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010758\/4-6-5.jpeg\" alt=\"An surface in xyz space with point at f(a, b). There is an arrow in the direction of greatest descent.\" width=\"724\" height=\"637\" \/> Figure 3. A typical surface in [latex]\\mathbb{R}^{3}[\/latex].\u00a0Given a point on the surface, the directional derivative can be calculated using the gradient.[\/caption]When using a topographical map, the steepest slope is always in the direction where the contour lines are closest together (see\u00a0Figure 6). This is analogous to the contour map of a function, assuming the level curves are obtained for equally spaced values throughout the range of that function.\r\n\r\n[caption id=\"attachment_1266\" align=\"aligncenter\" width=\"267\"]<img class=\"size-full wp-image-1266\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23011025\/4-6-6.jpeg\" alt=\"Two crossing dashed lines that pass through the origin and a series of curved lines approaching the crosses dashed lines as if they are asymptotes.\" width=\"267\" height=\"272\" \/> Figure 4.\u00a0Contour map for the function [latex]\\small{f(x,y)=x^{2}-y^{2}}[\/latex]\u00a0using level values between\u00a0[latex]\\small{-5}[\/latex] and\u00a0[latex]\\small{5}[\/latex].[\/caption]\r\n<h2 data-type=\"title\">Gradients and Level Curves<\/h2>\r\nRecall that if a curve is defined parametrically by the function pair [latex](x(t), y(t))[\/latex], then the vector [latex]x'(t){\\bf{i}}+y'(t){\\bf{j}}[\/latex] is tangent to the curve for every value of [latex]t[\/latex] in the domain. Now let\u2019s assume [latex]z=f(x, y)[\/latex] is a differentiable function of [latex]x[\/latex] and [latex]y[\/latex], and [latex](x_0, y_0)[\/latex] is in its domain. Let\u2019s suppose further that [latex]x_0=x(t_0)[\/latex] and [latex]y_0=y(t_0)[\/latex] for some value of [latex]t[\/latex], and consider the level curve [latex]f(x, y)=k[\/latex]. Define [latex]g(t)=f(x(t), y(t))[\/latex] and calculate [latex]{g}'(t)[\/latex] on the level curve. By the Chain Rule,\r\n<p style=\"text-align: center;\">[latex]\\large{g'(t)=f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)}.[\/latex]<\/p>\r\nBut\u00a0[latex]g'(t)=0[\/latex] because\u00a0[latex]g(t)=k[\/latex] for all\u00a0[latex]t[\/latex]. Therefore, on the one hand,\r\n<p style=\"text-align: center;\">[latex]\\large{f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)=0};[\/latex]<\/p>\r\non the other hand,\r\n<p style=\"text-align: center;\">[latex]\\large{f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)=\\nabla{f}(x,y)\\cdot\\langle{x}'(t),y'(t)\\rangle}.[\/latex]<\/p>\r\nTherefore,\r\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(x,y)\\cdot\\langle{x}'(t),y'(t)\\rangle=0}.[\/latex]<\/p>\r\nThus, the dot product of these vectors is equal to zero, which implies they are orthogonal. However, the second vector is tangent to the level curve, which implies the gradient must be normal to the level curve, which gives rise to the following theorem.\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\">Theorem: Gradient is normal to the level curve<\/h3>\r\n\r\n<hr \/>\r\n\r\nSuppose the function\u00a0[latex]z=f(x, y)[\/latex] has continuous first-order partial derivatives in an open disk centered at a point\u00a0[latex](x_0, y_0)[\/latex]. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne0[\/latex], then\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] is normal to the level curve of\u00a0[latex]f[\/latex] at\u00a0[latex](x_0, y_0)[\/latex].\r\n\r\n<\/div>\r\nWe can use this theorem to find tangent and normal vectors to level curves of a function.\r\n<div class=\"textbox exercises\">\r\n<h3>Example: Finding Tangents to level curves<\/h3>\r\nFor the function\u00a0[latex]f(x, y)=2x^{2}-3xy+8y^{2}+2x-4y+4[\/latex], find a tangent vector to the level curve at point\u00a0[latex](-2, 1)[\/latex]. Graph the level curve corresponding to\u00a0[latex]f(x, y)=18[\/latex] and draw in\u00a0[latex]\\nabla{f}(-2,1)[\/latex] and a tangent vector.\r\n\r\n[reveal-answer q=\"345812399\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"345812399\"]\r\n\r\nFirst, we must calculate [latex]\\nabla{f}(x,y)[\/latex]:\r\n<p style=\"text-align: center;\">[latex]f_x(x,y)=4x-3y+2[\/latex] and\u00a0[latex]f_y=-3x+16y-4[\/latex] so\u00a0[latex]\\nabla{f}(x,y)=(4x-3y+2){\\bf{i}}+(-3x+16y-4){\\bf{j}}.[\/latex]<\/p>\r\nNext, we evaluate\u00a0[latex]\\nabla{f}(x,y)[\/latex] at\u00a0[latex](-2,1)[\/latex]:\r\n<p style=\"text-align: center;\">[latex]\\nabla{f}(-2,1)=(4(-2)-3(1)+2){\\bf{i}}+(-3(-2)+16(1)-4){\\bf{j}}=-9{\\bf{i}}+18{\\bf{j}}.[\/latex]<\/p>\r\nThis vector is orthogonal to the curve at point [latex](-2, 1)[\/latex]. We can obtain a tangent vector by reversing the components and multiplying either one by [latex]-1[\/latex]. Thus, for example, [latex]-18{\\bf{i}}-9{\\bf{j}}[\/latex] is a tangent vector (see the following graph).\r\n\r\n[caption id=\"attachment_1272\" align=\"aligncenter\" width=\"304\"]<img class=\"size-full wp-image-1272\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23133555\/4-6-7.jpeg\" alt=\"A rotated ellipse with equation f(x, y) = 10. At the point (\u20132, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked \u2207f(\u20132, 1) and is perpendicular to the tangent vector.\" width=\"304\" height=\"272\" \/> Figure 5. A rotated ellipse with equation [latex]\\small{f(x,y)=18}[\/latex]. At the point [latex]\\small{(-2,1)}[\/latex] on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked [latex]\\small{\\nabla{f(-2,1)}}[\/latex] and is perpendicular to the tangent vector.[\/caption][\/hidden-answer]<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try it<\/h3>\r\nFor the function\u00a0[latex]f(x,y)=x^2-2xy+5y^2+3x-2y+4[\/latex],\u00a0<span style=\"white-space: nowrap;\">f<\/span><span style=\"font-size: 1rem; text-align: initial;\">ind the tangent to the level curve at point [latex](1, 1)[\/latex]. Draw the graph of the level curve corresponding to [latex]f(x, y)=8[\/latex] and draw [latex]\\nabla{f}(1,1)[\/latex] and a tangent vector.<\/span>\r\n\r\n[reveal-answer q=\"833476002\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"833476002\"]\r\n\r\n[latex]\\nabla{f}(x,y)=(2x-2y+3){\\bf{i}}+(-2x+10y-2){\\bf{j}}[\/latex]\r\n\r\n[latex]\\nabla{f}(1,1)=3{\\bf{i}}+6{\\bf{j}}[\/latex]\r\n\r\nTangent vector:\u00a0[latex]6{\\bf{i}}-6{\\bf{j}}[\/latex] or [latex]-6{\\bf{i}}+3{\\bf{j}}[\/latex]\r\n\r\n[caption id=\"attachment_1274\" align=\"aligncenter\" width=\"342\"]<img class=\"size-full wp-image-1274\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23133904\/4-6-tryitans1.jpeg\" alt=\"A rotated ellipse with equation f(x, y) = 8. At the point (1, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked \u2207f(1, 1) and is perpendicular to the tangent vector.\" width=\"342\" height=\"347\" \/> Figure 6.[\/caption]\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning Objectives<\/h3>\n<ul>\n<li><span class=\"os-abstract-content\">Determine the gradient vector of a given real-valued function.<\/span><\/li>\n<li><span class=\"os-abstract-content\">Explain the significance of the gradient vector with regard to direction of change along a surface.<\/span><\/li>\n<li><span class=\"os-abstract-content\">Use the gradient to find the tangent to a level curve of a given function.<\/span><\/li>\n<\/ul>\n<\/div>\n<p>The right-hand side of\u00a0the Directional Derivative of a Function of Two Variables\u00a0is equal to\u00a0[latex]f_x(x,y)\\cos\\theta+f_y(x,y)\\sin\\theta[\/latex], which can be written as the dot product of two vectors. Define the first vector as\u00a0[latex]\\nabla{f}(x,y)=f_x(x,y){\\bf{i}}+f_y(x,y)\\bf{j}[\/latex] and the second vector as\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta)\\bf{j}[\/latex]. Then the\u00a0right-hand side of the equation can be written as the dot product of these two vectors:<\/p>\n<p style=\"text-align: center;\">[latex]D_{\\bf{u}}f(x,y)=\\nabla{f}(x,y)\\cdot\\bf{u}.[\/latex]<\/p>\n<p>The first vector in\u00a0the previous equation\u00a0has a special name: the gradient of the function\u00a0[latex]f[\/latex]. The symbol\u00a0[latex]\\nabla[\/latex] is called\u00a0<em>nabla<\/em> and the vector\u00a0[latex]\\nabla{f}[\/latex] is read &#8220;del\u00a0[latex]f[\/latex]&#8220;.<\/p>\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\">Definition<\/h3>\n<hr \/>\n<p>Let\u00a0[latex]z=f(x, y)[\/latex] be a function of\u00a0[latex]x[\/latex] and\u00a0[latex]x[\/latex] such that\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex] exist. The vector\u00a0[latex]\\nabla{f}(x,y)[\/latex] is called the <strong>gradient<\/strong> of\u00a0[latex]f[\/latex] and is defined as<\/p>\n<p style=\"text-align: center;\">[latex]\\nabla{f}(x,y)=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}}.[\/latex]<\/p>\n<p>The vector\u00a0[latex]\\nabla{f}(x,y)[\/latex] is also written as &#8220;grad\u00a0[latex]f[\/latex]&#8220;.<\/p>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example: finding gradients<\/h3>\n<p>Find the gradient\u00a0[latex]\\nabla{f}(x,y)[\/latex] of each of the following functions:<\/p>\n<p>a.\u00a0[latex]f(x,y)=x^2-xy+3y^2[\/latex]<\/p>\n<p>b.\u00a0[latex]f(x,y)=\\sin{3x}\\cos{3y}[\/latex]<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q131344589\">Show Solution<\/span><\/p>\n<div id=\"q131344589\" class=\"hidden-answer\" style=\"display: none\">\n<p>For both parts a. and b., we first calculate the partial derivatives\u00a0[latex]f_x[\/latex] and\u00a0[latex]f_y[\/latex], then use\u00a0the gradient of [latex]f[\/latex].<\/p>\n<p>a.<\/p>\n<p>[latex]\\hspace{1cm}\\begin{align}    f_x(x,y)&=2x-y\\text{ and }f_x(x,y)=-x+6y,\\text{ so} \\\\    \\nabla{f}(x,y)&=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}} \\\\    &=(2x-y){\\bf{i}}+(-x+6y){\\bf{j}}.    \\end{align}[\/latex]<\/p>\n<p>b.<\/p>\n<p>[latex]\\hspace{1cm}\\begin{align}    f_x(x,y)&=3\\cos{3x}\\cos{3y}\\text{ and }f_x(x,y)=-3\\sin{3x}\\sin{3y},\\text{ so} \\\\    \\nabla{f}(x,y)&=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}} \\\\    &=(3\\cos{3x}\\cos{3y}){\\bf{i}}-(3\\sin{3x}\\sin{3y}){\\bf{j}}.    \\end{align}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try it<\/h3>\n<p>Find the gradient\u00a0[latex]\\nabla{f}(x,y)[\/latex] of\u00a0[latex]f(x,y)=(x^2-3y^2)\/(2x+y)[\/latex].<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q985372461\">Show Solution<\/span><\/p>\n<div id=\"q985372461\" class=\"hidden-answer\" style=\"display: none\">\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(x,y)=\\frac{2x^2+2xy+6y^2}{(2x+y)^2}{\\bf{i}}-\\frac{x^2+12xy+3y^2}{(2x+y)^2}{\\bf{j}}}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"ohm72867\" class=\"resizable\" src=\"https:\/\/ohm.lumenlearning.com\/multiembedq.php?id=72867&theme=oea&iframe_resize_id=ohm72867&show_question_numbers\" width=\"100%\" height=\"150\"><\/iframe><\/p>\n<\/div>\n<p>The gradient has some important properties. We have already seen one formula that uses the gradient: the formula for the directional derivative. Recall from\u00a0<a href=\"https:\/\/courses.lumenlearning.com\/calculus3\/chapter\/introduction-to-the-dot-product\/\" data-page-slug=\"2-3-the-dot-product\" data-page-uuid=\"7110f9df-6aa8-4c5b-adf0-ee8ed66ad26f\" data-page-fragment=\"page_7110f9df-6aa8-4c5b-adf0-ee8ed66ad26f\">The Dot Product<\/a>\u00a0that if the angle between two vectors [latex]\\bf{a}[\/latex] and [latex]\\bf{b}[\/latex] is\u00a0[latex]\\varphi[\/latex], then\u00a0[latex]{\\bf{a}}\\cdot{\\bf{b}}=\\|{\\bf{a}}\\|\\|{\\bf{b}}\\|\\cos\\varphi[\/latex]. Therefore, if the angle between\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] and\u00a0[latex]{\\bf{u}}=(\\cos\\theta){\\bf{i}}+(\\sin\\theta){\\bf{j}}[\/latex] is\u00a0[latex]\\varphi[\/latex], we have<\/p>\n<p style=\"text-align: center;\">[latex]\\large{D_{\\bf{u}}f(x_0,y_0)=\\nabla{f}(x_0,y_0)\\cdot{\\bf{u}}=\\|\\nabla{f}(x_0,y_0)\\|\\|{\\bf{u}}\\|\\cos\\varphi=\\|\\nabla{f}(x_0,y_0)\\|\\cos\\varphi}[\/latex]<\/p>\n<p>The\u00a0[latex]\\|{\\bf{u}}\\|[\/latex]\u00a0disappears because [latex]\\bf{u}[\/latex] is a unit vector. Therefore, the directional derivative is equal to the magnitude of the gradient evaluated at\u00a0[latex](x_0, y_0)[\/latex], multiplied by\u00a0[latex]\\cos\\varphi[\/latex]. Recall that\u00a0[latex]\\cos\\varphi[\/latex] ranges from\u00a0[latex]-1[\/latex] to\u00a0[latex]1[\/latex]. If\u00a0[latex]\\varphi=0[\/latex], then\u00a0[latex]\\cos\\varphi=1[\/latex] and\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] and\u00a0[latex]\\bf{u}[\/latex] point in opposite directions. In the first case, the value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is maximized; in the second case, the value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is minimized. If\u00a0[latex]\\nabla{f}(x_0,y_0)=0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=\\nabla{f}(x_0,y_0)\\cdot{\\bf{u}}=0[\/latex] for any vector\u00a0[latex]\\bf{u}[\/latex]<strong>.<\/strong> These cases are outlined in the following theorem.<\/p>\n<div><\/div>\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\">Theorem: properties of the gradient<\/h3>\n<hr \/>\n<p>Suppose the function\u00a0[latex]z=f(x, y)[\/latex] is differentiable at\u00a0[latex](x_0, y_0)[\/latex] (Figure 3).<\/p>\n<p>i. If\u00a0[latex]\\nabla{f}(x_0,y_0)=0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)=0[\/latex] for any unit vector\u00a0[latex]\\bf{u}[\/latex].<\/p>\n<p>ii. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne 0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is maximized when\u00a0[latex]\\bf{u}[\/latex] points in the same direction as\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex]. The maximum value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is\u00a0[latex]\\|\\nabla{f}(x_0,y_0)\\|[\/latex].<\/p>\n<p>iii. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne 0[\/latex], then\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is minimized when\u00a0[latex]\\bf{u}[\/latex] points in the opposite direction from\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex]. The minimum value of\u00a0[latex]D_{\\bf{u}}f(x_0,y_0)[\/latex] is\u00a0[latex]-\\|\\nabla{f}(x_0,y_0)\\|[\/latex].<\/p>\n<\/div>\n<div id=\"attachment_1260\" style=\"width: 617px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1260\" class=\"size-full wp-image-1260\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010542\/4-6-3.jpeg\" alt=\"An upward facing paraboloid in xyz space with point P0 (x0, y0, z0). From this point, there are arrows going up, down, and around the paraboloid. On the xy plane, the point (x0, y0) is marked, and the corresponding arrows are drawn onto the plane: the down arrow corresponds to \u2212\u2207f (most rapid decrease in f), the up arrow corresponds to \u2207f (most rapid increase in f), and the arrows around correspond to no change in f. The up\/down arrows are perpendicular to the around arrows in their projection on the plane.\" width=\"607\" height=\"588\" \/><\/p>\n<p id=\"caption-attachment-1260\" class=\"wp-caption-text\">Figure 1. The gradient indicates the maximum and minimum values of the directional derivative at a point.<\/p>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example: finding a maximum directional derivative<\/h3>\n<p>Find the direction for which the directional derivative of [latex]f(x, y)=3x^{2}-4xy+2y^{2}[\/latex] at [latex](-2, 3)[\/latex] is a maximum. What is the maximum value?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q721568432\">Show Solution<\/span><\/p>\n<div id=\"q721568432\" class=\"hidden-answer\" style=\"display: none\">\n<p>The maximum value of the directional derivative occurs when [latex]\\nabla{f}[\/latex] and the unit vector point in the same direction. Therefore, we start by calculating\u00a0[latex]\\nabla{f}(x,y)[\/latex]:<\/p>\n<p>[latex]\\hspace{6cm}\\large{\\begin{align}    f_x(x,y)&=6x-4y\\text{ and }f_y(x,y)=-4x+4y,\\text{ so} \\\\    \\nabla{f}(x,y)&=f_x(x,y){\\bf{i}}+f_y(x,y){\\bf{j}}=(6x-4y){\\bf{i}}+(-4x+4y){\\bf{j}}.    \\end{align}}[\/latex]<\/p>\n<p>Next, we evaluate the gradient at\u00a0[latex](-2,3)[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(-2,3)=(6(-2)-4(3)){\\bf{i}}+(-4(-2)+3(3)){\\bf{j}}=-24{\\bf{i}}+20{\\bf{j}}}.[\/latex]<\/p>\n<p>We need to find a unit vector that points in the same direction as [latex]\\nabla{f}(-2,3)[\/latex]<span style=\"font-size: 0.9em;\">,<\/span>\u00a0so the next step is to divide [latex]\\nabla{f}(-2,3)[\/latex] by its magnitude, which is\u00a0[latex]\\sqrt{(-24)^2+(20)^2}=\\sqrt{976}=4\\sqrt{61}[\/latex]. Therefore,<\/p>\n<p style=\"text-align: center;\">[latex]\\large{\\frac{\\nabla{f}(-2,3)}{\\|\\nabla{f}(-2,3)\\|}=\\frac{-24}{4\\sqrt{61}}{\\bf{i}}+\\frac{20}{4\\sqrt{61}}{\\bf{j}}=\\frac{-6\\sqrt{61}}{61}{\\bf{i}}+\\frac{5\\sqrt{61}}{61}{\\bf{j}}}.[\/latex]<\/p>\n<p>This is the unit vector that points in the same direction as [latex]\\nabla{f}(-2,3)[\/latex]. To find the angle corresponding to this unit vector, we solve the equations<\/p>\n<p style=\"text-align: center;\">[latex]\\large{\\cos\\theta=\\frac{-6\\sqrt{61}}{61}}[\/latex] and\u00a0[latex]\\large{\\sin\\theta=\\frac{5\\sqrt{61}}{61}}.[\/latex]<\/p>\n<p>for\u00a0[latex]\\theta[\/latex].\u00a0Since cosine is negative and sine is positive, the angle must be in the second quadrant. Therefore,<\/p>\n<p>[latex]\\theta=\\pi-\\arcsin{((5\\sqrt{61})\/61)}\\approx2.45\\text{ rad}.[\/latex]<\/p>\n<p>The maximum value of the directional derivative at\u00a0[latex](-2, 3)[\/latex] is\u00a0[latex]\\|\\nabla{f}(-2,3)\\|=4\\sqrt{61}[\/latex] (see the following figure).<\/p>\n<div id=\"attachment_1262\" style=\"width: 533px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1262\" class=\"size-full wp-image-1262\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010640\/4-6-4.jpeg\" alt=\"An upward facing paraboloid f(x, y) = 3x2 \u2013 4xy + 2y2 with tangent plane at the point (\u20132, 3, 54). The tangent plane has equation z = \u201324x + 20y \u2013 54.\" width=\"523\" height=\"340\" \/><\/p>\n<p id=\"caption-attachment-1262\" class=\"wp-caption-text\">Figure 2.\u00a0The maximum value of the directional derivative at [latex]\\small{(-2,3)}[\/latex]\u00a0is in the direction of the gradient.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try it<\/h3>\n<p>Find the direction for which the directional derivative of\u00a0[latex]g(x, y)=4x-xy+2y^{2}[\/latex] at [latex](-2, 3)[\/latex] is a maximum. What is the maximum value?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q161657349\">Show Solution<\/span><\/p>\n<div id=\"q161657349\" class=\"hidden-answer\" style=\"display: none\">\n<p>The gradient of [latex]g[\/latex] at\u00a0[latex](-2,3)[\/latex] is\u00a0[latex]\\nabla{g}(-2,3)={\\bf{i}}+14{\\bf{j}}[\/latex]. The unit vector that points in the same direction as\u00a0[latex]\\nabla{g}(-2,3)[\/latex] is\u00a0[latex]\\frac{\\nabla{g}(-2,3)}{\\|\\nabla{g}(-2,3)\\|}=\\frac{1}{\\sqrt{197}}{\\bf{i}}+\\frac{14}{\\sqrt{197}}{\\bf{j}}=\\frac{\\sqrt{197}}{197}{\\bf{i}}+\\frac{14\\sqrt{197}}{197}{\\bf{j}}[\/latex], which gives an angle of\u00a0[latex]\\theta=\\arcsin((14\\sqrt{197})\/197\\approx1.499\\text{ rad}[\/latex]. The maximum value of the directional derivative is\u00a0[latex]\\nabla{g}(-2,3)\\approx\\sqrt{197}[\/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<p>.<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"\/\/plugin.3playmedia.com\/show?mf=8186164&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=n8TmTVwACTM&amp;video_target=tpm-plugin-rpwvmbgw-n8TmTVwACTM\" 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.30_transcript.html\">transcript for \u201cCP 4.30\u201d here (opens in new window).<\/a><\/div>\n<p>Figure 5 shows a portion of the graph of the function [latex]f(x,y)=3+\\sin x\\sin y[\/latex]. Given a point [latex](a, b)[\/latex] in the domain of [latex]f[\/latex], the maximum value of the gradient at that point is given by [latex]\\|\\nabla{f}(a,b)\\|[\/latex]. This would equal the rate of greatest ascent if the surface represented a topographical map. If we went in the opposite direction, it would be the rate of greatest descent.<\/p>\n<div id=\"attachment_1265\" style=\"width: 734px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1265\" class=\"size-full wp-image-1265\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23010758\/4-6-5.jpeg\" alt=\"An surface in xyz space with point at f(a, b). There is an arrow in the direction of greatest descent.\" width=\"724\" height=\"637\" \/><\/p>\n<p id=\"caption-attachment-1265\" class=\"wp-caption-text\">Figure 3. A typical surface in [latex]\\mathbb{R}^{3}[\/latex].\u00a0Given a point on the surface, the directional derivative can be calculated using the gradient.<\/p>\n<\/div>\n<p>When using a topographical map, the steepest slope is always in the direction where the contour lines are closest together (see\u00a0Figure 6). This is analogous to the contour map of a function, assuming the level curves are obtained for equally spaced values throughout the range of that function.<\/p>\n<div id=\"attachment_1266\" style=\"width: 277px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1266\" class=\"size-full wp-image-1266\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23011025\/4-6-6.jpeg\" alt=\"Two crossing dashed lines that pass through the origin and a series of curved lines approaching the crosses dashed lines as if they are asymptotes.\" width=\"267\" height=\"272\" \/><\/p>\n<p id=\"caption-attachment-1266\" class=\"wp-caption-text\">Figure 4.\u00a0Contour map for the function [latex]\\small{f(x,y)=x^{2}-y^{2}}[\/latex]\u00a0using level values between\u00a0[latex]\\small{-5}[\/latex] and\u00a0[latex]\\small{5}[\/latex].<\/p>\n<\/div>\n<h2 data-type=\"title\">Gradients and Level Curves<\/h2>\n<p>Recall that if a curve is defined parametrically by the function pair [latex](x(t), y(t))[\/latex], then the vector [latex]x'(t){\\bf{i}}+y'(t){\\bf{j}}[\/latex] is tangent to the curve for every value of [latex]t[\/latex] in the domain. Now let\u2019s assume [latex]z=f(x, y)[\/latex] is a differentiable function of [latex]x[\/latex] and [latex]y[\/latex], and [latex](x_0, y_0)[\/latex] is in its domain. Let\u2019s suppose further that [latex]x_0=x(t_0)[\/latex] and [latex]y_0=y(t_0)[\/latex] for some value of [latex]t[\/latex], and consider the level curve [latex]f(x, y)=k[\/latex]. Define [latex]g(t)=f(x(t), y(t))[\/latex] and calculate [latex]{g}'(t)[\/latex] on the level curve. By the Chain Rule,<\/p>\n<p style=\"text-align: center;\">[latex]\\large{g'(t)=f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)}.[\/latex]<\/p>\n<p>But\u00a0[latex]g'(t)=0[\/latex] because\u00a0[latex]g(t)=k[\/latex] for all\u00a0[latex]t[\/latex]. Therefore, on the one hand,<\/p>\n<p style=\"text-align: center;\">[latex]\\large{f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)=0};[\/latex]<\/p>\n<p>on the other hand,<\/p>\n<p style=\"text-align: center;\">[latex]\\large{f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)=\\nabla{f}(x,y)\\cdot\\langle{x}'(t),y'(t)\\rangle}.[\/latex]<\/p>\n<p>Therefore,<\/p>\n<p style=\"text-align: center;\">[latex]\\large{\\nabla{f}(x,y)\\cdot\\langle{x}'(t),y'(t)\\rangle=0}.[\/latex]<\/p>\n<p>Thus, the dot product of these vectors is equal to zero, which implies they are orthogonal. However, the second vector is tangent to the level curve, which implies the gradient must be normal to the level curve, which gives rise to the following theorem.<\/p>\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\">Theorem: Gradient is normal to the level curve<\/h3>\n<hr \/>\n<p>Suppose the function\u00a0[latex]z=f(x, y)[\/latex] has continuous first-order partial derivatives in an open disk centered at a point\u00a0[latex](x_0, y_0)[\/latex]. If\u00a0[latex]\\nabla{f}(x_0,y_0)\\ne0[\/latex], then\u00a0[latex]\\nabla{f}(x_0,y_0)[\/latex] is normal to the level curve of\u00a0[latex]f[\/latex] at\u00a0[latex](x_0, y_0)[\/latex].<\/p>\n<\/div>\n<p>We can use this theorem to find tangent and normal vectors to level curves of a function.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example: Finding Tangents to level curves<\/h3>\n<p>For the function\u00a0[latex]f(x, y)=2x^{2}-3xy+8y^{2}+2x-4y+4[\/latex], find a tangent vector to the level curve at point\u00a0[latex](-2, 1)[\/latex]. Graph the level curve corresponding to\u00a0[latex]f(x, y)=18[\/latex] and draw in\u00a0[latex]\\nabla{f}(-2,1)[\/latex] and a tangent vector.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q345812399\">Show Solution<\/span><\/p>\n<div id=\"q345812399\" class=\"hidden-answer\" style=\"display: none\">\n<p>First, we must calculate [latex]\\nabla{f}(x,y)[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]f_x(x,y)=4x-3y+2[\/latex] and\u00a0[latex]f_y=-3x+16y-4[\/latex] so\u00a0[latex]\\nabla{f}(x,y)=(4x-3y+2){\\bf{i}}+(-3x+16y-4){\\bf{j}}.[\/latex]<\/p>\n<p>Next, we evaluate\u00a0[latex]\\nabla{f}(x,y)[\/latex] at\u00a0[latex](-2,1)[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]\\nabla{f}(-2,1)=(4(-2)-3(1)+2){\\bf{i}}+(-3(-2)+16(1)-4){\\bf{j}}=-9{\\bf{i}}+18{\\bf{j}}.[\/latex]<\/p>\n<p>This vector is orthogonal to the curve at point [latex](-2, 1)[\/latex]. We can obtain a tangent vector by reversing the components and multiplying either one by [latex]-1[\/latex]. Thus, for example, [latex]-18{\\bf{i}}-9{\\bf{j}}[\/latex] is a tangent vector (see the following graph).<\/p>\n<div id=\"attachment_1272\" style=\"width: 314px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1272\" class=\"size-full wp-image-1272\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23133555\/4-6-7.jpeg\" alt=\"A rotated ellipse with equation f(x, y) = 10. At the point (\u20132, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked \u2207f(\u20132, 1) and is perpendicular to the tangent vector.\" width=\"304\" height=\"272\" \/><\/p>\n<p id=\"caption-attachment-1272\" class=\"wp-caption-text\">Figure 5. A rotated ellipse with equation [latex]\\small{f(x,y)=18}[\/latex]. At the point [latex]\\small{(-2,1)}[\/latex] on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked [latex]\\small{\\nabla{f(-2,1)}}[\/latex] and is perpendicular to the tangent vector.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try it<\/h3>\n<p>For the function\u00a0[latex]f(x,y)=x^2-2xy+5y^2+3x-2y+4[\/latex],\u00a0<span style=\"white-space: nowrap;\">f<\/span><span style=\"font-size: 1rem; text-align: initial;\">ind the tangent to the level curve at point [latex](1, 1)[\/latex]. Draw the graph of the level curve corresponding to [latex]f(x, y)=8[\/latex] and draw [latex]\\nabla{f}(1,1)[\/latex] and a tangent vector.<\/span><\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q833476002\">Show Solution<\/span><\/p>\n<div id=\"q833476002\" class=\"hidden-answer\" style=\"display: none\">\n<p>[latex]\\nabla{f}(x,y)=(2x-2y+3){\\bf{i}}+(-2x+10y-2){\\bf{j}}[\/latex]<\/p>\n<p>[latex]\\nabla{f}(1,1)=3{\\bf{i}}+6{\\bf{j}}[\/latex]<\/p>\n<p>Tangent vector:\u00a0[latex]6{\\bf{i}}-6{\\bf{j}}[\/latex] or [latex]-6{\\bf{i}}+3{\\bf{j}}[\/latex]<\/p>\n<div id=\"attachment_1274\" style=\"width: 352px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1274\" class=\"size-full wp-image-1274\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/23133904\/4-6-tryitans1.jpeg\" alt=\"A rotated ellipse with equation f(x, y) = 8. At the point (1, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked \u2207f(1, 1) and is perpendicular to the tangent vector.\" width=\"342\" height=\"347\" \/><\/p>\n<p id=\"caption-attachment-1274\" class=\"wp-caption-text\">Figure 6.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-3931\">\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.30. <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":26,"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.30\",\"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-3931","chapter","type-chapter","status-publish","hentry"],"part":22,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3931","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\/3931\/revisions"}],"predecessor-version":[{"id":5915,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/3931\/revisions\/5915"}],"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\/3931\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/media?parent=3931"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapter-type?post=3931"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/contributor?post=3931"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/license?post=3931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}