Math 225: Calculus III   Solution 9

Initialization

<<Calculus`Math225`

i = {1, 0, 0}; j = {0, 1, 0}; k = {0, 0, 1};

Problem 1

Compute the Jacobian determinant of the following coordinate transformations. Note that you must first solve for x and y as functions of u and v (use
Solve[{u==..., v==...},{u,v}]), then apply D[] and Det[] in an appropriate way. Finally compute the Jacobian using J[].
a) u == x + y, v == x^2 - y^2
b) u == 3x - y + z, v == x + 2y + z, w == -x + y + z

Solution

a)

Solve[{u == x + y, v == x^2 - y^2}, {x,y}]

The Jacobian is the detrminant of the partial derivatives:

Det[{{D[(1/2)(u + v/u),u], D[(1/2)(u + v/u),v]},
     {D[(1/2)(u - v/u),u], D[(1/2)(u - v/u),v]}}]

Using J[]:

J[(1/2)(u + v/u), (1/2)(u - v/u), {u,v}]

b)

soln=Solve[{u==3x-y+z,v==x+2y+z,w==-x+y+z},
{x,y,z}]//Simplify

These expressions are rather large, so let's redefine x, y, and z. sol[[1]] picks out the first item in the list. In this case the list has only one element, so this simply gets rid of the extra pair of braces.)

x = x /. soln[[1]];
y = y /. soln[[1]];
z = z /. soln[[1]];

Det[{{D[x,u], D[x,v], D[x,w]},
     {D[y,u], D[y,v], D[y,w]},
     {D[z,u], D[z,v], D[z,w]}}]

J[x,y,z,{u,v,w}]

Clear[x,y,z]

Problem 2

Plot the following vector fields using VectorField[F,{x,-5,5},{y,-5,5}].
a) F = { 0.2 x, 0.1 y}
b) F = { 0.1 y, 0.2 x}
c) F = {-0.1 y, 0.2 x}

Solution

a)

F = {0.2 x, 0.1 y};
VectorField[F,{x,-5,5},{y,-5,5}]

b)

F = {0.1 y, 0.2 x};
VectorField[F,{x,-5,5},{y,-5,5}]

c)

F = {-0.1 y, 0.2 x};
VectorField[F,{x,-5,5},{y,-5,5}]

Problem 3

Let C be the curve defined by
    r[t_] = t(t^2-1) i + 2t j - t^2 k
for -1<= t <= 2.
Integrate the function f[x_,y_,z_] = z^2 - x y over C by using the appropriate formula with NIntegrate[]. Compare the result with LineIntegrate[]//N.

Solution

r[t_] = t(t^2-1) i + 2t j - t^2 k

f[x_,y_,z_] = z^2 - x y

First, substitute for x, y, and z, the appropriate function of t (from r[t]):

g[t_] = f[x,y,z] /.
        {x->r[t][[1]], y->r[t][[2]], z->r[t][[3]]} //
        Simplify

Next, multiply by Norm[r'[t]] and integrate:

g[t] Norm[r'[t]] //Simplify

NIntegrate[%, {t,-1,2}]

LineIntegrate[f[x,y,z], r[t], {t,-1,2}]//N

The numerical calculation in this case leaves a tiny imaginary number which can be eliminated with:

Chop[%]

Problem 4

Use cylindrical coordinates and ParamtericPlot3D[] to plot the surfaces
a) z = theta, 0 <= theta <= 2Pi, -2 <= r <= 2
b) z = E^(-r^2/4)Cos[Pi r], 0 <= theta <= 2Pi, 0 <= r <= 3

Solution

a) Use t for theta.

cyl = {x,y,z} /. {x->r Cos[t], y-> r Sin[t]}

v = cyl /. {z->t}

ParametricPlot3D[Evaluate[v], {t,0,2Pi}, {r,-2,2}]

b)

v = cyl /. {z->E^(-r^2/4)Cos[Pi r]}

ParametricPlot3D[Evaluate[v], {t,0,2Pi}, {r,0,3}]

Problem 5

Use spherical coordinates and ParamtericPlot3D[] to plot the surface
rho = 1/(phi^2(phi-Pi)^2), Pi/4 <= phi <=3Pi/4,
0 <= theta <= 2Pi.

Solution

Use r for rho, t for theta and p for phi.

sph = {x,y,z} /.
    {x-> rho Cos[theta] Sin[phi],
     y-> rho Sin[theta] Sin[phi],
     z-> rho Cos[phi]}

v = sph /. {rho-> 1/(phi^2(phi-Pi)^2)}

ParametricPlot3D[Evaluate[v],{theta,0,2Pi},
{phi,Pi/4,3Pi/4}]