Test 1 for serial number : 1

Exercise 1

We define the verctor field F(x,y,z)=(P,Q,R) using curly braces in the definition in such a way that later we can apply F to a parameterization r for a suitable curve

P[x_,y_,z_]:=-y z(3x y z-x)Sin[x y z]+(3y z-1)Cos[x y z]+4x-3y;
Q[x_,y_,z_]:=-x z(3x y z-x)Sin[x y z]+3x z Cos[x y z]-3x;
R[x_,y_,z_]:=3x y Cos[x y z]-x y(3x y z-x)Sin[x y z];
F[{x_,y_,z_}]:={P[x,y,z],Q[x,y,z],R[x,y,z]}

Technique 1

If ϕ(x,y,z) is a potential function for F then 
F=(P,Q,R)=(((∂ϕ)/(∂x)),((∂ϕ)/(∂y)),((∂ϕ)/(∂z)))⇒ ({{{, ({{P=((∂ϕ)/(∂x)),  }, {Q=((∂ϕ)/(∂y)),  }, {R=((∂ϕ)/(∂z)),  }})}})
 and  ϕ(x,y,z) could be computed by integrating the components, P, Q, R, of F. Since the simplest component is the last one we start integrating that one for its variable ,
R=((∂ϕ)/(∂z))⇒ϕ=∫Rdz+c(x,y),
and we insert an integration constant that will be independent of the integrating variable z (therefore, that constant will depend on the rest of variables, x and y)

ϕ=∫R[x,y,z]\[DifferentialD]z+c[x,y];

Now we compute the integration constant by differentiating for the rest of variables. First we calculate the derivative for y and the result has to coincide with the second component of F,   (((∂ϕ)/(∂y))=Q).

Simplify[(∂_y)ϕ==Q[x,y,z]]

From here
Derivative[0,1][c][x,y]==-3x
Derivative[0,1][c] is the notation that Mathematica uses to denote the partial derivative of order 1 for the second variable (Derivative[0,1][c]=((∂c)/(∂(x^0)∂(y^1)))) and we can integrate to compute c[x,y]:

∫(-3x)\[DifferentialD]y+c[x]

So we can actualize the value for ϕ with the new result that we have for c

ϕ=-3 x y+c[x]-x Cos[x y z]+3 x y z Cos[x y z];

Finally we compute the derivative for x that has to coincide with P

Simplify[(∂_x)ϕ==P[x,y,z]]

Therefore c(x) will be

∫4x\[DifferentialD]x+c

And we finally have

ϕ=-3 x y+c+2 (x^2)-x Cos[x y z]+3 x y z Cos[x y z];

To compute c we know that the potential at the origin is ϕ(0,0,0)=-3 and therefore

(ϕ/.{x->0,y->0,z->0})==-3

And finally

ϕ=-3 x y-3+2 (x^2)-x Cos[x y z]+3 x y z Cos[x y z];

The potential at (1,-7,2) will be

ϕ/.{x->1,y->-7,z->2}

That is to say, the correct option is 2)

Technique 2

As we have a conservative field and ϕ is a potential function, for any curve, r : [a, b] -> (R^3), we have that (∫_(r))F=ϕ(r(b))-ϕ((r(a)). We take any curve from the origin to the point where we want to compute the potential (1,-7,2), for instance r : [0, 1] -> (R^3)

r[t_]:=t{1,-7,2}

For this curve r(0)=(0,0,0) and r(1)=(1,-7,2) and therefore (∫_(r))F=ϕ(1,-7,2)-ϕ(0,0,0). As we know that ϕ(0,0,0)=-3, we only need to compute (∫_r)F to obtain ϕ(1,-7,2).

(∫_0^1)F[r[t]].r'[t]\[DifferentialD]t

And finally ϕ(1,-7,2) will be ϕ(0,0,0)+(∫_(r))F, that is to say,

-3+23-43 Cos[14]

Exercise 2

We have the curve

r[t_]:={((Cos[t] (9+8 Cos[t]) (-((-1+(Sqrt[3]))/(2 (Sqrt[2])))-(((1+(Sqrt[3])) Sin[t])/(2 (Sqrt[2])))))/(1+((Sin[t])^2))),((Cos[t] (9+8 Cos[t]) (((1+(Sqrt[3]))/(2 (Sqrt[2])))-(((-1+(Sqrt[3])) Sin[t])/(2 (Sqrt[2])))))/(1+((Sin[t])^2)))}

Let us represent the curve

ParametricPlot[r[t],{t,0,2π}]

We observe that it has an intersection point. We can consider two parts of the curve, the first part can be parameterized with r(t) for -(π/2)≤ t≤ (π/2) and the second one for (π/2)≤ t≤ ((3π)/2).

ParametricPlot[r[t],{t,((-π)/2),(π/2)}]

ParametricPlot[r[t],{t,(π/2),((3π)/2)}]

We have to compute the area inside these two domains in a separate way since the line integral and Green’s Theorem provide the area with sign. As the orientations of each part of the curve are different the areas could compesate if we compute it with a single line integral. Therefore we compute the area for both parts in a separate way. To use the Theorem of Green we introduce a vector field with constant curl. For instance

F[{x_,y_}]:={-y,x}

Curl[F[{x,y}],{x,y}]

By means of Green’s Theorem we know that (∫_D)curl(F)=(∫_r)F and as curl(F)=2 we finally have that area(D)=(1/2)(∫_r)F.

Therefore, for the first part of the curve

area1=N[(1/2)(∫_((-π)/2)^(π/2))F[r[t]].r'[t]\[DifferentialD]t]

And for the second part:

area2=N[(1/2)(∫_(π/2)^((3π)/2))F[r[t]].r'[t]\[DifferentialD]t]

As we can see, the sing is different so we have to change the sing of the negative one to obtain the real total area as

area1-area2

And the correct option is option 2).

Exercise 3

We have the vector field

F[{x_,y_,z_}]:={(E^(-(z^2)))+3 x-7 y z,x z+2 x y z+Cos[(z^2)],y z+Cos[2 (y^2)]}

The surface "S≡(\!\(\*FractionBox[\(\!\(\*RowBox[{\"2\", \"+\", \"x\"}]\)\), \(\!\(\*RowBox[{\"1\"}]\)\)]\)\!\(\*SuperscriptBox[\()\), \(2\)]\)+(\!\(\*FractionBox[\(\!\(\*RowBox[{RowBox[{\"-\", \"2\"}], \"+\", \"y\"}]\)\), \(\!\(\*RowBox[{\"3\"}]\)\)]\)\!\(\*SuperscriptBox[\()\), \(2\)]\)+(\!\(\*FractionBox[\(\!\(\*RowBox[{\"3\", \"+\", \"z\"}]\)\), \(\!\(\*RowBox[{\"3\"}]\)\)]\)\!\(\*SuperscriptBox[\()\), \(2\)]\)=1" is an ellipsoid and therefore is a closed surface. 
The general form of the ellipsoid centered at p=(p1,p2,p3) with radius r1, r2 and r3 for the axis x,y,z, resp., has general form

S≡(((((x-p1)/r1)))^2)+(((((x-p2)/r2)))^2)+(((((x-p3)/r3)))^2)=1

Therefore, we have an ellipsoid centered at p=(-2,2,-3) with radius 1, 3 and 3

We need to compute the surface integral (∫_S)F but if we use Stokes’ Theorem we know that (∫_S)F=(∫_Ω)div(F), where Ω is the interior domain of the considered surface. In principle it would be valid to  compute any of these two integral. Of course we should choose the most simple one. In the formula of F we appreciate functions like (e^(-(x^2)))  for which to compute the integral is difficult. On the other hand, if we compute the divergence of the vector field we have

Div[F[{x,y,z}],{x,y,z}]

We can define the function divF to store the divergence in the following way

divF[{x_,y_,z_}]:=3+y+2 x z

And we observe that the formula that we obtain is much more simple than the initial components that the field had. So we will compute (∫_Ω)div(F) to solve the problem.

We need a suitable change of variable to compute the volume integral over the ellipsoid. The change of variable is very similar to the spheric change but we have to adapt it to the shape of the ellipsoid. We consider the transformation T:[0,2π]×[0,π]×[0,1]-->(R^3) given by

T[θ_,ϕ_,r_]:=r{r1 Cos[θ]Sin[ϕ],r2 Sin[θ]Sin[ϕ],r3 Cos[ϕ]}+{p1,p2,p3}

As we know the values for p=(-2,2,-3) and the radius r1=1, r2=3, r3=3, the final form for the transformation is

T[θ_,ϕ_,r_]:=r{Cos[θ]Sin[ϕ],3Sin[θ]Sin[ϕ],3Cos[ϕ]}+{-2,2,-3}

The Jacobian determinant for this transformation is

Simplify[Det[Grad[T[θ,ϕ,r],{r,θ,ϕ}]]]

And we take this determinant with absolute value to apply the formula of change of variable for the integral (∫_Ω)div(F). We have to recall that the formula of change of variable for the integral is (∫_(SuperStar[Ω]))dif(F)(T(θ,ϕ,r))det(T'(θ,ϕ,r))dθdϕdr and (SuperStar[Ω])=[0,2π]×[0,π]×[0,1]. Therefore

(∫_0^(2π))(∫_0^π)(∫_0^1)divF[T[θ,ϕ,r]]9 (r^2) Sin[ϕ]\[DifferentialD]r\[DifferentialD]ϕ\[DifferentialD]θ

N[%]

Test 1 for serial number : 5

Exercise 1

In this case, we do not have two possible techniques since we have to compute the integral of the potential function over a 3-dimensional domain a we then need to compute the explicit expression for the potential. Therefore the only valid technique is what we called before Technique 1.

The vector field is

P[x_,y_,z_]:=-2 x y z+y  z(3z-2x)-2(y^2)+2y;
Q[x_,y_,z_]:=-4x y+x z(3z-2x)+2x;
R[x_,y_,z_]:=3x y z+x y(3z-2x);
F[{x_,y_,z_}]:={P[x,y,z],Q[x,y,z],R[x,y,z]};

In this case, we start computing the integral for x: ϕ=∫Pdx

ϕ=∫P[x,y,z]\[DifferentialD]x+c[y,z]

We compute de derivative for y to compare with Q

Simplify[(∂_y)ϕ==Q[x,y,z]]

Therefore, c(y,z)=c(z) and

ϕ=y (2 x-2 x y-2 (x^2) z+3 x (z^2))+c[z]

And we finally compute the derivative for z to compare with R

Simplify[(∂_z)ϕ==R[x,y,z]]

So we have that c[z]=c and

ϕ=y (2 x-2 x y-2 (x^2) z+3 x (z^2))+c;

The potential at the origin is ϕ(0,0,0)=1 so that

(ϕ/.{x->0,y->0,z->0})==1

And the final formula for the potential is

ϕ=y (2 x-2 x y-2 (x^2) z+3 x (z^2))+1;

We compute now the integral over the domain (([0,1])^3). If the formula for ϕ is very complex, we use  the instruction NIntegrate to obtain a numeric approximation for the integral

NIntegrate[ϕ,{x,0,1},{y,0,1},{z,0,1}]

Anyway, in this case we could have used also the usual definite integral since the formula for ϕ is not specially difficult.

(∫_0^1)(∫_0^1)(∫_0^1)ϕ\[DifferentialD]x\[DifferentialD]y\[DifferentialD]z

N[%]

The correct result is option 3).

Exercise 2

The curve is r:[0,π]-->R with

r[t_]:={(7t+5)Sin[2t](6Cos[5t]+6),(7t+6)Sin[t]}

We represent the curve

ParametricPlot[r[t],{t,0,π}]

and we can appreciate that it has no intersection point so we do not need to divide the curve in different parts and we can compute the area by means of Green’s Theorem with only one integral. We consider again a vector field with constant curl, say

F[{x_,y_}]:={-y,x}

For which we know that curl(F)=2. And the area=(1/2)(∫_r)F

(1/2)(∫_0^π)F[r[t]].r'[t]\[DifferentialD]t

N[%]

And the correct option is option 3)

Exercise 3

The vector field is now

F[{x_,y_,z_}]:={4(x^2),-9(x^2)y (z^2),-7}

The surface is again an ellipsoid with center p=(3,-5,1) and radius 8, 7 and 2.

As well, we can compute any of the integrals of Stokes’ Theorem: (∫_S)F=(∫_Ω)div(F). In this case, as the formula for the field is simple, both of them are easily computable so we have two valid options.

Option 1

We frist remove the value for variables that we used before:

ϕ=.

We compute (∫_S)F. We then need a parameterization for the ellipsoid surface. In general, for the ellipsoid with center p=(p1,p2,p3) and raius r1,r2,r3 a valid parameterization is X:[0,2π]×[0,π]->(R^3)

X[θ_,ϕ_]:={r1 Cos[θ]Sin[ϕ]+p1,r2 Sin[θ]Sin[ϕ]+p2,r3 Cos[ϕ]+p3}

So that in our case the parameterization is

X[θ_,ϕ_]:={8 Cos[θ]Sin[ϕ]+3,7Sin[θ]Sin[ϕ]-5,2 Cos[ϕ]+1}

We compute now the normal vector

Simplify[(∂_θ)X[θ,ϕ]\[Cross](∂_ϕ)X[θ,ϕ]]

And the surface integral is

(∫_0^(2π))(∫_0^π)F[X[θ,ϕ]].{-14 Cos[θ] ((Sin[ϕ])^2),-16 Sin[θ] ((Sin[ϕ])^2),-28 Sin[2 ϕ]}\[DifferentialD]ϕ\[DifferentialD]θ

N[%]

If we take into account that the parameterization X that we chose is negative oriented, we have to change the sign of the final result so the correct answer is option 1)

Option 2

We compute the divergence

Div[F[{x,y,z}],{x,y,z}]

And we define a function to store it

DivF[{x_,y_,z_}]:=8 x-9 (x^2) (z^2)

To compute the volume integral over the ellipsoid we need the change of variable given by the transformation

T[θ_,ϕ_,r_]:=r{r1 Cos[θ]Sin[ϕ],r2 Sin[θ]Sin[ϕ],r3 Cos[ϕ]}+{p1,p2,p3}

which in our case is

T[θ_,ϕ_,r_]:=r{8 Cos[θ]Sin[ϕ],7 Sin[θ]Sin[ϕ],2Cos[ϕ]}+{3,-5,1}

The Jacobian determinant is

Simplify[Det[Grad[T[θ,ϕ,r],{θ,ϕ,r}]]]

Therefore the  volume integral is

(∫_0^1)(∫_0^(2π))(∫_0^π)DivF[T[θ,ϕ,r]]112 (r^2) Sin[ϕ]\[DifferentialD]ϕ\[DifferentialD]θ\[DifferentialD]r

N[%]