% Simplified version of an UMTYMP template.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% If the text is too small, change 10pt to 12pt
\documentclass[11pt]{article}
\RequirePackage{amsmath,amsthm,amssymb,latexsym,amsthm,verbatim,xspace,amstext,xspace,setspace}

% Here's where you edit the class, section and title information

% Set a fixed margin along all sides
\usepackage[margin=1.2in, nohead, pdftex]{geometry}
\usepackage{enumerate,graphicx}
% Re-adjust the top margin if desired
\topmargin -0.2in
% These packages used for spacing in the header and throughout



% Uncomment one of the following to set the spacing to single, 1.5 or double spacing
\singlespacing
%\onehalfspacing
%\doublespacing

% This prevents paragraphs from begin indented.  Comment it out to have indentation.
\parindent 0ex
\setlength{\textheight}{9.5in}

\newcounter{num}
% Finally we start!
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is the "header" at the top.  You shouldn't have to edit these lines!
% Instead, chance the Class, Section and Title above.
\begin{center}{ \Large{Lab worksheet}  \\\large{10/24/2017} }\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% At this point, you might have some introductory text, or jump straight
% into an ``enumerate'' environment for the problem statements.
\bigskip
\begin{enumerate}
\item There are several ways to plot a surface over a region (instead of a rectangle as we usually do). One way is to use Plot3D with some modification in the range. For example, to plot the surface $z=xy^3$ over the circle $x^2+y^2=1$, we write
\[{\rm Plot3D[xy^3,~\{x,0,1\},~\{y,-\sqrt{1-x^2},\sqrt{1-x^2}\}]}\]
Another way is to use the option \emph{RegionFunction} inside Plot3D. For example, the above graph can be plotted by
\[{\rm Plot3D[xy^3,~\{x,0,1\},~\{y,0,1\},~~RegionFunction\to Function[\{x,y\},~x^2+y^2\le 1]}\]
If you add the option $Filling\to Bottom$, it will even look nicer.

\textbf{Practice}
\begin{enumerate}
\item Plot the surface $z=xy^2$ over the annulus centered at (0,0) with inner radius 1 and outer radius 2.\vspace{.9in}
\item Plot the same function over the ellipse $(x-1)^2+4(y-1)^2=9$.
\vspace{.93in}
\end{enumerate}
\item To compute gradient, divergence, and curl of a vector field, use the commands \emph{Grad}, \emph{Div} and \emph{Curl} respectively. For example,\\
Grad[F(x,y,z),\{x,y,z\}]\\
Div[F(x,y),\{x,y\}]\\
Curl[F(x,y,z),\{x,y,z\}]\\
\ldots\\
A remark before practice: usually we only define curl for a 3-variable vector field. However, given a 2-variable vector field, we still have a way define the curl. For example, let $F(x,y)=\langle f(x,y),g(x,y)\rangle$. This function can be thought as $\tilde F(x,y,z)=\langle f(x,y),g(x,y),0\rangle$, whose curl is \[\left\langle 0,0,\frac{\partial g}{\partial x}-\frac{\partial f}{\partial y}\right\rangle\] Thus, the curl of $F$ can be defined as \[\textrm{curl}~ F=\frac{\partial g}{\partial x}-\frac{\partial f}{\partial y},\]
which is a scalar.\\\\
\textbf{Practice}
\begin{enumerate}
\item Compute the divergence and gradient of $F(x,y,z)=\langle xy^2,yz^2,zx^2\rangle$.\vspace{1.2in}
\item Let $F(x,y)=\langle x,y\rangle$. Plot vector field $F$. (\emph{You will need the VectorPlot command. Press F1 to look up the syntax if you forget}). Explain intuitively based on the plot why the divergence at (0,0) and at (1,1) must be positive.
\vspace{1.2in}
\item Let $F(x,y)=\langle -y,x\rangle$. Plot vector field $F$. Explain intuitively based on the plot why the divergence at (1,1), and why curl at (0,0) must be positive.\vspace{1.2in}
\item Let $F(x,y)=\langle -x,-x\rangle$. Plot vector field $F$. Explain intuitively based on the plot why the curl at (1,1) must be negative.
\vspace{1.2in}
\item Let $f(x,y)=xy^2$. Plot the gradient vector field of $f$. Explain intuitively based on the plot why the curl of the gradient must be zero.
\end{enumerate}
\end{enumerate}
\end{document}











