Physics 4392: Professor Olness  Fall 2001

HOMEWORK SET #2:Due Tuesday Sept.11 at 5pm.Griffiths,3rd edition:Problems:Chapt. #1:  26, 27, 31, 43, 44, 49, 52, 55, 56 

You can do some in Mathematics,but I want to see you compute
at least 1 Grad,Div,and Curl by hand.

Turn of some anoying features

Off[General::"spell1"] ; Off[
        General::"spell"] ;

Load the needed packages:

<<Graphics`PlotField`

<<Graphics`PlotField3D`

<<Calculus`VectorAnalysis`

SetCoordinates[Cartesian[x,y,z]];

SetCoordinates[Cartesian[x, y, z]];

Problem 1.26:

This is a good way to clear things between problems:

Clear["Global`*"]

{fx[x, y, z], fy[x, y, z], 
        fz[x, y, z]} //Curl

{fx[x, y, z], fy[x, y, z], fz[x, y, z]}  // Curl  // 
      Div

Problem 1.27:

This is a good way to clear things between problems:

Clear["Global`*"]

f[x, y, z] // Grad

f[x, y, z] // Grad//Curl

Problem 1.31:

This is a good way to clear things between problems:

Clear["Global`*"]

t = (x^2) +  4 x y  +  2 y (z^3);

Grad[t]

total1 = 
(      Integrate[
            Grad[t] . {1, 0, 0}  /. {y -> 0,  z -> 0}, {x, 0, 
              1}]
 + 
          Integrate[
            Grad[t] . {0, 1, 0}  /. {x -> 1,  z -> 0}, {y, 0, 
              1}]
 + 
          Integrate[
            Grad[t] . {0, 0, 1}  /. {x -> 1,  y -> 1}, {z, 0, 
              1}]
)

total2 = 
(      Integrate[
            Grad[t] . {0, 0, 1}  /. {x -> 0,  y -> 0}, {z, 0, 
              1}]
 + 
          Integrate[
            Grad[t] . {0, 1, 0}  /. {x -> 0,  z -> 1}, {y, 0, 
              1}]
 + 
          Integrate[
            Grad[t] . {1, 0, 0}  /. {y -> 1,  z -> 1}, {x, 0, 
              1}]
)

integrand = Grad[t] . {dx, dy, dz}

integrand = 
      integrand  //. {z ->  (x^2), dz ->  2 x dx,  
            y -> x,  dy -> dx}   // Simplify

Integrate[integrand /dx, {x, 0, 1}]

Problem 1.43:

This is a good way to clear things between problems:

Clear["Global`*"]

?DiracDelta

a)

Integrate[ (3 (x^2) -  2 x  -  1)  DiracDelta[x - 3], {x, 2, 
        6}]

(3 (x^2) -  2 x  -  1)   /. {x -> 3}

b)

Integrate[ Cos[x] DiracDelta[x - π], {x, 0, 5}]

Cos[x] /. {x -> π}

c)

Integrate[ (x^3)  DiracDelta[x + 1], {x, 0, 3}]

d)

Integrate[ 
      Log[x + 3] DiracDelta[
          x + 2], {x, -∞, +∞}]

Log[x + 3]  /. {x -> -2}

Problem 1.44:

This is a good way to clear things between problems:

Clear["Global`*"]

?DiracDelta

a)

Integrate[ (2 x + 3)  DiracDelta[3 x], {x, -2, 
        2}]

(2 x + 3) (1/3)   /. {x -> 0}

b)

Integrate[ ((x^3) +  3 x  +  2) DiracDelta[x - 1], {x, 0, 
        2}]

((x^3) +  3 x  +  2) /. {x -> 1}

c)

Integrate[ 9  (x^2)  DiracDelta[3 x + 1], {x, -1, 1}]

9  (x^2)   (1/3)  /. {x -> -1/3}

d)

tmp =  
      Integrate[  DiracDelta[x - b], {x, -∞, a}]

tmp  /. {a -> 1,  b -> 2}

tmp  /. {a -> 2,  b -> 1}

Plot[UnitStep[x], {x, -2, 2},  
        AxesOrigin -> {0, -0.2}];

Problem 1.49:

This is a good way to clear things between problems:

Clear["Global`*"]

a)

f1 = {0, 0, (x^2)};
f2 = {x, y, z};

Div[f1]

Curl[f1]

Div[f2]

Curl[f2]

a-1) Show f2 is the grad of some function

eqs =  Grad[g[x, y, z]] == f2  // Thread

xSol =  DSolve[eqs[[1]], {g[x, y, z]}, {x, y, z}]

ySol =  DSolve[eqs[[2]], {g[x, y, z]}, {x, y, z}]

zSol =  DSolve[eqs[[3]], {g[x, y, z]}, {x, y, z}]

f = (1/2) (x^2) + (1/2) (y^2) + (1/2) 
            (z^2);
Grad[f]

Note, we can always add something a constant.

test =  f + 12345

Grad[test]

a-2) Show f1 is the curl of some function

f1

h = {0, a (x^b), 0};
Curl[h]

eqs = Curl[h] == 
          f1 //Thread

eqs2 =  eqs[[3]]  /. x -> {1, 2}  // Thread

sol =  Solve[eqs2, {a, b}]  // Flatten

h = h  /. sol

Curl[h]

Note, we can always add something that has zero Divergence.

h = h  +  Grad[(x^2) (y^3) (z^4)]

Curl[h]

b) Show f3

f3 = {y z,  z x,  x y};

Div[f3]

Curl[f3]

Integrate[ f3[[1]], x]

test =  x y z;
Grad[test]

test2 =  {x (y^2 - z^2), y (z^2 - x^2), 
            z (x^2 - y^2)} (-1/4);
Curl[test2]  // Simplify

f3 == Curl[test2]  // Simplify

Problem 1.52:

This is a good way to clear things between problems:

Clear["Global`*"]

va = {(x^2), 3 x (z^2),  -2 x z};
vb = {x y,  2 y z,  3 z x};
vc = {(y^2),  2 x y  +  (z^2), 2 y z };

a)

Curl[va]

Curl[vb]

Curl[vc]

f = x (y^2) +  y (z^2);
Grad[f]

vc  ==  Grad[f]

b)

Div[va]

va

f = {x (z^3) , - x^2 z , 0};
Curl[f]

Curl[f]==va

Div[vb]

Div[vc]

Problem 1.55:

This is a good way to clear things between problems:

Clear["Global`*"]

v = {6,  y (z^2), 3 y  +  z};

Curl[v]

a) Surface Integral

zRule = Solve[2 y  +  z  ==  2, {z}]  // Flatten

integrand =  Curl[v] . {1, 0, 0} /.{x -> 
            0}

total1 = Integrate[integrand, {y, 0, 1}, {z, 0, 2 - 2  y}]

b) Line Integral

part1 = 
      Integrate[
        v . {0, 1, 0}  /. {x -> 0, z -> 0}, {y, 0, 1}]

integrand2 =  
      v . {0, dy, dz}  /. {x -> 0, z -> 2 - 2  y,  
            dz -> -2 dy}  // Simplify

part2 = Integrate[integrand2/dy, {y, 1, 0}]

part3 = 
      Integrate[
        v . {0, 0, 1}  /. {x -> 0, y -> 0}, {z, 2, 0}]

total2 = part1 + part2 + part3

Problem 1.56:

This is a good way to clear things between problems:

Clear["Global`*"]

SetCoordinates[Spherical[r, θ, ϕ]];

v = {r Cos[θ]^2, - r Cos[θ] Sin[θ],  
          3 r};

In Spherical Coordinates:             dℓ={ 1, r ,  r Sin[θ] }

Curl[v]

Curl[v] . {0, - dθ, 0}

integrand1 =  
      Curl[v] . {0, -1, 
              0 } r Sin[θ]  /. {θ -> π/
              2}

part1 = 
      Integrate[integrand1 , {r, 0, 1}, {ϕ, 0, π/2}]

integrand2 = Curl[v] . {0, 0 , -1}  r

part2 = 
      Integrate[
        integrand2/dθ, {r, 0, 1}, {ϕ, 0, π/2}]

total1 = part1 + part2

LINE INTEGRAL

integrand1 =  
      v . {dr, 0, 0}  /. {θ -> π/2,  ϕ -> 
            0}

part1 = Integrate[integrand1/dr, {r, 0, 1}]

integrand2 =  
      v . {0, 0, r Sin[θ] dϕ} /. {r -> 
            1,  θ -> π/2}

part2 = Integrate[integrand2/dϕ, {ϕ, 0, π/2}]

integrand3 =  
      v . {dr, r dθ, 0} /. {r -> 
              1/Sin[θ],  ϕ -> π/2,  
            dr -> D[1/Sin[θ], θ] dθ}  // 
        Simplify

r0 = Sqrt[(1^2) + (2^2)];
θ0 = ArcSin[1/r0]

part3 = 
      Integrate[
        integrand3/dθ, {θ, π/2, θ0}]

integrand4  =  v . {dr, 0, 
            0}/.{ ϕ -> π/
              2,  θ -> θ0}

part4 = Integrate[integrand4/dr, {r, r0, 0}]

total2 = part1 + part2 + part3 + part4  // Simplify