next up previous contents
Next: Line Integrals Up: Computational Labs in Mathematica Previous: Polar Coordinates

Change of Variables

Objectives

In this lab you will explore how Mathematica can be used to work with change of variables.

Change of variables, spherical

To verify that tex2html_wrap_inline400 is the incremental volume element in spherical coordinates, we can use the change of variable formulas and calculate the Jacobian. First define the change of variable formulas,

      x = p Sin[u] Cos[v];
      y = p Sin[u] Sin[v];
      z = p Cos[u];
Here we use tex2html_wrap_inline402 , tex2html_wrap_inline404 and tex2html_wrap_inline406 . A vector in Mathematica is a list and a matrix is a list of lists, so the Jacobian matrix for this change of variables is given by,
      jac = {{D[x,p],D[x,u],D[x,v]},
             {D[y,p],D[y,u],D[y,v]},
             {D[z,p],D[z,u],D[z,v]}};
      MatrixForm[jac]
The MatrixForm command is used to display lists of lists in the usual form for a matrix. We now can use the Det command to find the determinate of this Jacobian matrix,
      detjac = Simplify[Det[jac]]
and we should get tex2html_wrap_inline408 .

Change of variables, sample problem

Find the volume bounded by the graphs of tex2html_wrap_inline410 and z=100.

First look at a graph,

       Clear[x,y,z]
       f[x_,y_] = 9 (x - y)^2 + 4 (x + y)^2
       Plot3D[f[x,y],{x,-5,5},{y,-5,5},PlotRange -> {0,100},
              ClipFill -> None, PlotPoints -> 40]
       ContourPlot[f[x,y],{x,-5,5},{y,-5,5},PlotPoints -> 40,
                   Contours -> {5,10,20,35,60,100},
                   ContourShading -> False]
The Clear command erases the definitions we used above. We then can look at a surface plot and a contour plot to see what the region looks like. In this case, contour lines look like ellipses whose major and minor axes or on the lines tex2html_wrap_inline414 . Our domain for limits of integration are not easily described as functions of x and y, so a change of variables is probably the best way to go. Based on the form of the function, try
       u = 3 (x-y);
       v = 2 (x+y);
The new area element is then found by
       detjac = Simplify[Det[{{D[u,x],D[u,y]},{D[v,x],D[v,y]}}]]
Which means that tex2html_wrap_inline420 or tex2html_wrap_inline422 . To see how this simplifies the geometry, first solve for x and y in terms of u and v,
       Clear[u,v,x,y]
       Simplify[Solve[{u == 3 (x - y), v == 2 (x + y)},{x,y}]]
Then graph the function f in terms of these new variables,
       Plot3D[f[u/6+v/4,v/4-u/6],{u,-10,10},{v,-10,10},
              PlotRange -> {0,100},ClipFill -> None, PlotPoints -> 40
       ContourPlot[f[u/6+v/4,v/4-u/6],{u,-10,10},{v,-10,10},
                   PlotPoints -> 40,Contours -> {5,10,20,35,60,100},
                   ContourShading -> False]
To see our function in terms of the new variables,
       z=Simplify[f[u/6+v/4,v/4-u/6]]
which would lead us to make another (more familiar) change of variables to polar coordinates (for u and v). Thus to calculate the volume we would
       Clear[z]
       vol = Integrate[Integrate[Integrate[r/detjac,{z,r^2,100}],
               {r,0,10}],{theta,0,2 Pi}]
where the integration in z has a lower limit of the bottom surface and an upper limit of 100, and the integration over x and y is change (twice) to an integration in polar coordinates of a circle of radius 10 (in the (u,v) domain).

Finally

Rework problem 26 on page 938 (section 15.4): Find tex2html_wrap_inline448 of the ellipse tex2html_wrap_inline450 . Try using the change of variables tex2html_wrap_inline452 and tex2html_wrap_inline454 . Investigate how this change of variables simplifies the domain and thus, the limits of integration. Then convert the integral,

displaymath446

into the new variables and integrate.


next up previous contents
Next: Line Integrals Up: Computational Labs in Mathematica Previous: Polar Coordinates

James Powell
Fri Feb 14 12:47:33 MST 1997