3. (8 points).
Let F(x,y,z) := (y + cos(x))i + (x-1) j

a) Is this vector field exact ?

Answer. Yes, because

In[7]:=

  D[y + Cos[x], y] == D[x-1, x]

Out[7]=

  True

b) Evaluate the integral of F . dx along C_1, where
where C_1 is the closed loop given by x(t) = cos(t),
y = t^2 - 2 pi t, 0 <= t <= 2 pi.

Because the vector field is exact, the integral around any closed loop is 0,
It is not necessary to parametrize.

c) Evaluate the integral of F . dx,
where C_2 is the non-closed curve given by x(t) = cos(t), y = t^2 - 2 pi t, 0 <= t <= pi

Because the vector field is exact, the vector field is the gradient of a scalar
function f[x,y], and the integral is just f[end point] - f[ starting point]. I
will solve this by finding the scalar function f. Another valid possibility
is to use the path-independence property, and do the integral directly
along a straight linefrom (1,0) to (-1,- pi^2).

To find x, integrate the components of the vector field and compare terms
to fix the "constants" of integration, by which I mean the arbitrary
functions of one variable alone . I will write them explicitly:

In[8]:=

  f[x, y] = Integrate[y + Cos[x], x] + C1[y]

Out[8]=

  x y + C1[y] + Sin[x]

In[9]:=

  f[x, y] = Integrate[x - 1, y] + C2[x]

Out[9]=

  (-1 + x) y + C2[x]

In[10]:=

  % == %%

Out[10]=

  (-1 + x) y + C2[x] == x y + C1[y] + Sin[x]

Evidently, we can take C1[y] = -y and C2[x] = Sin[x], so

In[11]:=

  Clear[f]

In[12]:=

  f[x_,y_] = x y + Sin[x] - y

Out[12]=

  -y + x y + Sin[x]

Checking:

In[13]:=

  {D[f[x,y], x], D[f[x,y], y]}

Out[13]=

  {y + Cos[x], -1 + x}

The value of the integral is

In[14]:=

  (%% /.{x -> -1, y -> - Pi^2}) - (%% /.{x -> 1, y -> 0})

Out[14]=

      2
  2 Pi  - 2 Sin[1]

Up to Solutions to Test 4