Chapter 4: Partial Differentiation
Section 4.5: Gradient Vector
Example 4.5.10
If u=x4+2⁢x2⁢y2+y4−1x2+y2+2⁢y+1⁢x2+y2−2⁢y+1 and v=4⁢x⁢yx2+y2+2⁢y+1⁢x2+y2−2⁢y+1, show both graphically and analytically that their level curves are mutually orthogonal.
Solution
Mathematical Solution
Figure 4.5.10(a) shows the level curves of u in black, and the level curves of v in red. From the figure, it appears that these sets of level curves intersect at right angles.
Analytically, the orthogonality of these sets of level curves is established if ∇u·∇v=0, which would show that the respective gradient vectors are orthogonal. Since these gradient vectors are themselves orthogonal to vectors tangent to the level curves, the sets of level curves are then orthogonal to each other. However, in this example the gradient vectors are large expressions in x and y, as seen in the calculation below.
use plots in module() local u,v,d,p1,p2,p3; d:=(x^2+y^2+2*y+1)*(x^2+y^2-2*y+1); u:=(x^4+2*x^2*y^2+y^4-1)/d; v:=4*x*y/d; p1:=contourplot(u,x=-1..1,y=-2..2,color=black,contours=[-4,-3,-2,-1,1,2,3,4],grid=[150,150]); p2:=contourplot(v,x=-1..1,y=-2..2,color=red,contours=[-4,-3,-2,-1,1,2,3,4]); p3:=display(p1,p2,scaling=constrained); print(p3); end module: end use:
Figure 4.5.10(a) Level curves of u and v
∇u·∇v = 4⁢x⁢x4−2⁢x2⁢y2−3⁢y4+2⁢x2+2⁢y2+1x2+y2+2⁢y+12⁢x2+y2−2⁢y+124⁢y⁢3⁢x4+2⁢x2⁢y2−y4+2⁢x2+2⁢y2−1x2+y2+2⁢y+12⁢x2+y2−2⁢y+12·−4⁢y⁢3⁢x4+2⁢x2⁢y2−y4+2⁢x2+2⁢y2−1x2+y2+2⁢y+12⁢x2+y2−2⁢y+124⁢x⁢x4−2⁢x2⁢y2−3⁢y4+2⁢x2+2⁢y2+1x2+y2+2⁢y+12⁢x2+y2−2⁢y+12=0
Maple Solution - Interactive
Initialize
Tools≻Load Package: Student Multivariate Calculus
Loading Student:-MultivariateCalculus
Obtain ∇u
Control-drag expression for u.
Context Panel: Student Multivariate Calculus≻Differentiate≻Gradient
Context Panel: Simplify≻Simplify
Context Panel: Assign to a Name≻Gu
x4+2⁢x2⁢y2+y4−1x2+y2+2⁢y+1⁢x2+y2−2⁢y+1→gradient4⁢x3+4⁢x⁢y2x2+y2+2⁢y+1⁢x2+y2−2⁢y+1−2⁢x4+2⁢x2⁢y2+y4−1⁢xx2+y2+2⁢y+12⁢x2+y2−2⁢y+1−2⁢x4+2⁢x2⁢y2+y4−1⁢xx2+y2+2⁢y+1⁢x2+y2−2⁢y+124⁢x2⁢y+4⁢y3x2+y2+2⁢y+1⁢x2+y2−2⁢y+1−x4+2⁢x2⁢y2+y4−1⁢2⁢y+2x2+y2+2⁢y+12⁢x2+y2−2⁢y+1−x4+2⁢x2⁢y2+y4−1⁢2⁢y−2x2+y2+2⁢y+1⁢x2+y2−2⁢y+12= simplify 4⁢−3⁢y4+−2⁢x2+2⁢y2+x2+12⁢xx2+y2+2⁢y+12⁢x2+y2−2⁢y+12−4⁢y5+8⁢x2+8⁢y3+12⁢x4+8⁢x2−4⁢yx2+y2+2⁢y+12⁢x2+y2−2⁢y+12→assign to a nameGu
Obtain ∇v
Control-drag expression for v.
Context Panel: Assign to a Name≻Gv
4⁢x⁢yx2+y2+2⁢y+1⁢x2+y2−2⁢y+1→gradient4⁢yx2+y2+2⁢y+1⁢x2+y2−2⁢y+1−8⁢x2⁢yx2+y2+2⁢y+12⁢x2+y2−2⁢y+1−8⁢x2⁢yx2+y2+2⁢y+1⁢x2+y2−2⁢y+124⁢xx2+y2+2⁢y+1⁢x2+y2−2⁢y+1−4⁢x⁢y⁢2⁢y+2x2+y2+2⁢y+12⁢x2+y2−2⁢y+1−4⁢x⁢y⁢2⁢y−2x2+y2+2⁢y+1⁢x2+y2−2⁢y+12= simplify 4⁢y5+−8⁢x2−8⁢y3+−12⁢x4−8⁢x2+4⁢yx2+y2+2⁢y+12⁢x2+y2−2⁢y+124⁢−3⁢y4+−2⁢x2+2⁢y2+x2+12⁢xx2+y2+2⁢y+12⁢x2+y2−2⁢y+12→assign to a nameGv
Show ∇u·∇v=0
Common Symbols palette: Dot product operator
Context Panel: Evaluate and Display Inline
Gu·Gv = 4⁢−3⁢y4+−2⁢x2+2⁢y2+x2+12⁢x⁢4⁢y5+−8⁢x2−8⁢y3+−12⁢x4−8⁢x2+4⁢yx2+y2+2⁢y+14⁢x2+y2−2⁢y+14+4⁢−4⁢y5+8⁢x2+8⁢y3+12⁢x4+8⁢x2−4⁢y⁢−3⁢y4+−2⁢x2+2⁢y2+x2+12⁢xx2+y2+2⁢y+14⁢x2+y2−2⁢y+14= simplify 0
Use the to generate Figure 4.5.10(a)
At the present time, the Plot Builder in the Context Panel does not allow for specifying exactly which contours are to be drawn. Therefore, it will not reproduce Figure 4.5.10(a).
The Interactive Plot Builder can be used to draw Figure 4.5.10(a), but the figure so generated cannot be saved to the document. It can only be Previewed.
Figure 4.5.10(a) is best drawn with the code hidden behind the graph in the Mathematical Solution, or by the code in the Coded Solution.
Set the main panel of the Plot Builder as per Figure 4.5.10(b).
In the Options panel, select a function (topmost drop-down box) to set its color and to change the default list of contours to −4,−3,−2,−1,1,2,3,4.
Select "Global Defaults & Settings" in the topmost drop-down box, and check "Constrained Scaling" (lower-left in the "View" section of the Options panel). See Figure 4.5.10(c).
Figure 4.5.10(b) Interactive Plot Builder: 2-D contour plot
Figure 4.5.10(c) Options pane in Interactive Plot Builder
Maple Solution - Coded
Install the Student MultivariateCalculus package.
Define u.
u≔x4+2⁢x2⁢y2+y4−1x2+y2+2⁢y+1⁢x2+y2−2⁢y+1:
Define v.
v≔4⁢x⁢yx2+y2+2⁢y+1⁢x2+y2−2⁢y+1:
Use the Gradient and DotProduct commands.
simplifyDotProductGradientu,x,y,Gradientv,x,y = 0
Obtain Figure 4.5.10(a)
The contourplot and display commands from the plots package will produce Figure 4.5.10(a), as illustrated by the following code. Simply remove the colon from the last line and execute.
p1≔plots:-contourplotu,x=−1..1,y=−2..2,color=black,contours=−4,−3,−2,−1,1,2,3,4,grid=150,150:p2≔plots:-contourplotv,x=−1..1,y=−2..2,color=red,contours=−4,−3,−2,−1,1,2,3,4:plots:-displayp1,p2,scaling=constrained:
<< Previous Example Section 4.5 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document