%% AMS-LaTeX Created with the Wolfram Language : www.wolfram.com

\documentclass{article}
\usepackage{amsmath, amssymb, graphics, setspace}

\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}

\newcounter{mathematicapage}
\begin{document}

\section*{Lab 09 - Vector Line Integrals\\
[Names]}

Writing a force field as \(\overset{\rightharpoonup }{F}=P \hat{i}+Q\hat{j}\), the vector line integral over some path \(C\) can be written in at
least two ways:

\(\begin{array}{c}
 \int _C\overset{\rightharpoonup }{F}\cdot d\overset{\rightharpoonup }{r}=\int _CPdx+\int _CQdy \\
\end{array}\)

\(\begin{array}{c}
 
\begin{array}{c}
 
\begin{array}{c}
 \int _C\overset{\rightharpoonup }{F}\cdot d\overset{\rightharpoonup }{r}=\int _C\overset{\rightharpoonup }{F}(x(t),y(t))\cdot \overset{\rightharpoonup
}{r}'dt \\
\end{array}
 \\
\end{array}
 \\
\end{array}\)

where \(\overset{\rightharpoonup }{r}'=\left\langle \frac{\partial x}{\partial t},\frac{\partial y}{\partial t}\right\rangle\). { }Use whichever
of these expressions is most useful in evaluating the following line integrals. Write down the answers you get here in your \textit{ Mathematica}
notebook, but attach paper showing your work (and labelled according to question number) to a printout of the notebook. { } 

1.) Consider the force field \(\overset{\rightharpoonup }{F}_1=\overset{\rightharpoonup }{r}-2\hat{i}=x\hat{i}+y\hat{j}-2\hat{i}=(x-2)\hat{i}+y\hat{j}\).
Evaluate the vector line integral of this force field along the path \(C_1\): the straight line from (-1,0) to (0,1). \\
\\
[\pmb{ Hint: }It{'}s probably easiest to do this using the first relation above.] 

\begin{doublespace}
\noindent\(\pmb{\text{C1}=\text{ParametricPlot}[\{x,x+1\},\{x,-1,0\}]}\)
\end{doublespace}

\includegraphics{Lab09-VectorLineIntegrals_gr1.eps}

2.) Evaluate the vector line integral of the same force field, \(\overset{\rightharpoonup }{F}_1,\) but this time along the path \(C_2\): the portion
of a radius one circle, traversed in counterclockwise direction from (-1,0) to (0,1). \\
\\
[\pmb{ Hint: }It{'}s probably easiest to do this one using the \textit{ second} relation above, and using the parameter $\theta $ instead of \(t\).
You can use \textit{ Mathematica} to evaluate any trig-function-containing integrals you come up with.] 

\begin{doublespace}
\noindent\(\pmb{\text{C2}=\text{ParametricPlot}[\{\text{Cos}[\theta ],\text{Sin}[\theta ]\},\{\theta ,-\pi ,+\pi /2\}]}\)
\end{doublespace}

\includegraphics{Lab09-VectorLineIntegrals_gr2.eps}

3.) Plot the vector field \(\overset{\rightharpoonup }{F}_1\) (use red arrows, see Lab 08) together with the integration paths \(C_1\)and \(C_2\).
{ }Do the *signs* of your vector line integrals match your visual estimation of their signs?

4.) Could \(\overset{\rightharpoonup }{F}_1\)be the gradient of some potential function \(f_1(x,y)\)? { }Carry out the curl test to decide. (Show
the results of your test). { }Investigate how to use \textit{ Mathematica}{'}s Curl[....] function to confirm. Would you have guessed this result
(well, whether it{'}s positive, zero or negative) by looking at the graph of the vector field arrows? If the field is {``}irrotational{''}, find
a potential function \(f_1\)such that \(\overset{\rightharpoonup }{F}_1=\overset{\rightharpoonup }{\nabla }f_1\) and make a plot which includes the
integration paths, the vector field of arrows *and* a ContourPlot[...] of \(f_1\)-- all together in the same figure.

5.) If the potential function exists, calculate the surface height difference \(f_1(0,1)-\)\(f_1(-1,0)\).

\begin{doublespace}
\noindent\(\pmb{\text{Show}[\text{c1},\text{c2}]}\)
\end{doublespace}

\includegraphics{Lab09-VectorLineIntegrals_gr3.eps}

6-10.) Repeat the sections 1-5.) with the same curves \(C_1\)and \(C_2\), but this time with the vector field \(\overset{\rightharpoonup }{F}_2=\left(-y-\frac{1}{2}\right)\hat{i}+x^3\hat{j}\).
{ }(And try to find a potential called \(f_2\) if possible.)

11.) Back to the first vector field, \(\overset{\rightharpoonup }{F}_1\): { }Carry out a vector line integration of this vector field from the origin
to a point with coordinates \(\left(x_0,y_0\right)\) along a path with two segments: { }\\
\\
First go along the \(x\) axis from (0,0) to \(\left(x_0,0\right)\). { }\\
\\
Next go from (\(x_0\),0) to \(\left(x_0,y_0\right)\). { }This second path is parallel to the \(y\) axis. \\
\\
Now, replace \(x_0\rightarrow x\) and \(y_0\rightarrow y\). { }Comment on the result.

\end{document}
