% Exam Template for UMTYMP and Math Department courses
%
% Using Philip Hirschhorn's exam.cls: http://www-math.mit.edu/~psh/#ExamCls
%
% run pdflatex on a finished exam at least three times to do the grading table on front page.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% These lines can probably stay unchanged, although you can remove the last
% two packages if you're not making pictures with tikz.
\documentclass[11pt]{exam-lu}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}

% By default LaTeX uses large margins.  This doesn't work well on exams; problems
% end up in the "middle" of the page, reducing the amount of space for students
% to work on them.
\usepackage[margin=1in]{geometry}

\usepackage{xcolor}
\newcommand{\cquestion}{\question}

\usepackage{mdframed}


\definecolor{blue(pigment)}{rgb}{0.2, 0.2, 0.6}
\definecolor{brightmaroon}{rgb}{0.76, 0.13, 0.28}
\definecolor{darkgreen}{rgb}{0.0, 0.2, 0.13}
\definecolor{ao(english)}{rgb}{0.0, 0.5, 0.0}
\definecolor{lavenderblue}{rgb}{0.8, 0.8, 1.0}

% Here's where you edit the Class, Exam, Date, etc.
\newcommand{\class}{\color{blue(pigment)}Math 162A}
\newcommand{\term}{\color{blue(pigment)}Winter 2021}
\newcommand{\examnum}{\color{blue(pigment)}\emph{Practice} Midterm}
\newcommand{\examdate}{\color{brightmaroon}2/1/2021, 12pm-12:50pm}
\newcommand{\timelimit}{\color{brightmaroon}50 Minutes}

% For an exam, single spacing is most appropriate
\singlespacing
% \onehalfspacing
% \doublespacing

% For an exam, we generally want to turn off paragraph indentation
\parindent 0ex



\renewcommand{\questionlabel}{\colorbox{red} {\huge{\textbf{\color{white}~\thequestion.}}}}

\renewcommand{\partlabel}{\colorbox{red} {\large{\textbf{\color{white}(\thepartno)}}}}

\renewenvironment{TheSolution}{\begin{mdframed}[skipabove=\baselineskip,innertopmargin=\baselineskip,innerbottommargin=\baselineskip, linewidth=3pt,
   linecolor=ao(english),  topline=false,
   rightline=false,
   bottomline=false]
  \textbf{\color{red}Solution:}\enspace\ignorespaces}{\end{mdframed}}

\begin{document} 

\printanswers

% These commands set up the running header on the top of the exam pages
\pagestyle{head}
\firstpageheader{}{}{}
\runningheader{\class}{\examnum\ - Page \thepage\ of \numpages}{\examdate}
\runningheadrule

\begin{flushright}
\begin{tabular}{p{2.8in} r l}
\textbf{\class} & \textbf{\color{brightmaroon}Name (Print):} & \makebox[2in]{\hrulefill}\\
\textbf{\term} &&\\
\textbf{\examnum} &&\\
\textbf{\examdate} &&\\
\textbf{\color{brightmaroon}Time Limit: \timelimit} & \color{brightmaroon}Teaching Assistant & \makebox[2in]{\hrulefill}
\end{tabular}\\
\end{flushright}
\rule[1ex]{\textwidth}{.1pt}

\color{black}
This exam contains \numpages\ pages (including this cover page) and
\numquestions\ problems.  Check to see if any pages are missing.  Enter
all requested information on the top of this page, and put your initials
on the top of every page, in case the pages become separated.\\

\color{brightmaroon} You may \textit{not} use your books, notes, or any calculator on this exam. \color{black}\\

\color{black}
You are required to show your work on each problem on this exam.  The following rules apply:\\

\begin{minipage}[t]{3.7in}
\vspace{0pt}
\begin{itemize}

\item \textbf{If you use a ``fundamental theorem'' you must indicate this} and explain
why the theorem may be applied.

\item \textbf{Organize your work}, in a reasonably neat and coherent way, in
the space provided. Work scattered all over the page without a clear ordering will 
receive very little credit.  

\item \textbf{Mysterious or unsupported answers will not receive full
credit}.  A correct answer, unsupported by calculations, explanation,
or algebraic work will receive no credit; an incorrect answer supported
by substantially correct calculations and explanations might still receive
partial credit.


\item If you need more space, use the back of the pages; clearly indicate when you have done this.

\item Upload your answers in pdf format to the Canvas after you finish it. 
\end{itemize}

Do not write in the table to the right.
\end{minipage}
\hfill
\begin{minipage}[t]{2.3in}\color{darkgreen}
\vspace{7pt}
%\cellwidth{3em}
\gradetablestretch{2}
\vqword{Problem}
\addpoints % required here by exam.cls, even though questions haven't started yet.	
\gradetable[v]%[pages]  % Use [pages] to have grading table by page instead of question

\end{minipage}
\color{black}
\newpage % End of cover page

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% See http://www-math.mit.edu/~psh/#ExamCls for full documentation, but the questions
% below give an idea of how to write questions [with parts] and have the points
% tracked automatically on the cover page.
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{questions}
\pointformat{\textcolor{red}{(\thepoints)}}
\newcommand{\R}{\mathbb R}
% Basic question
\addpoints
\question[25] Let $\alpha=\alpha(s)$ be a plane curve such that all the tangent lines of $\alpha$ pass through a fixed point $p_0\in\R^2$. Show that $\alpha$ must be a straight line passing through that point $p_0$.
% Question with parts
\begin{solution}
The tangent line of $\alpha(t)$ at point $t$ can be written as $\alpha(t)+s\alpha'(t)$. The fact that it must pass a fixed point $p_0$ means that there is a function $s=s(t)$ such that 
\[
\alpha(t)+s(t)\alpha'(t)=p_0.
\]
We try to solve this ODE: observe that 
\[
\left(e^{\int\frac{1}{s(t)} dt}(\alpha(t)-p_0)\right)'=0.
\]
Thus there is a constant vector ${\bf c}$ such that 
\[
e^{\int\frac{1}{s(t)} dt}(\alpha(t)-p_0)={\bf c}.
\]
Thus
\[
\alpha(t)=p_0+e^{-\int\frac{1}{s(t)} dt}{\bf c},
\]
which is a straight line. 
\end{solution}
\newpage
\addpoints
\question[25] Let
\[
u(t)=(u_1(t), u_2(t), u_3(t)),\qquad v(t)=(v_1(t), v_2(t), v_3(t))
\]
be differential maps from the interval (a,b) into $\R^3$. If the derivatives $u'(t)$ and $v'(t)$ satisfies the conditions 
\[
u'(t)=au(t)+bv(t),\qquad v'(t)=cu(t)-av(t),
\]
where $a,b$ and $c$ are constants. Show that $u(t)\wedge v(t)$ is a constant vector.

\begin{solution}
We have
\begin{align*}
&
(u(t)\wedge v(t))'=u'(t)\wedge v(t)+u(t)\wedge v'(t)\\
&=(au(t)+bv(t))\wedge v(t)+u(t)\wedge (cu(t)-av(t))=0.
\end{align*}
\end{solution}
% If you want the total number of points for a question displayed at the top,
% as well as the number of points for each part, then you must turn off the point-counter
% or they will be double counted.
\newpage
\addpoints
\question[25] 
Let 
\[
\alpha=dx_1\wedge dx_2+dx_3\wedge dx_4
\]
in $\R^4$. Calculate $d\alpha$ and $\alpha\wedge\alpha$.

\begin{solution}
\[
d\alpha=0,
\]
and
\begin{align*}
&
\alpha\wedge\alpha=(dx_1\wedge dx_2+dx_3\wedge dx_4)\wedge(dx_1\wedge dx_2+dx_3\wedge dx_4)\\
&=2dx_1\wedge dx_2\wedge dx_3\wedge dx_4.
\end{align*}
\end{solution}

\newpage
\addpoints
\question[25] On $\R^3$, Let $K$ be a real number.
Let
\[
A=1+\frac K4\sum x_k^2.
\]
and let $A_j=\frac{\partial A}{\partial x_j}$. We take 
\[
\omega_i=\frac{dx_i}{A}.
\]
Let
\[
\omega_{ij}=\frac{1}{A}(A_i\,dx_j-A_j\,dx_i).
\]
Prove that 
\[
d\omega_j+\omega_i\wedge\omega_{ij}=0.
\]
and 
\[
d\omega_{ij}+\omega_{is}\wedge\omega_{sj}=K\,\omega_i\wedge\omega_j.
\]
\end{questions}

\begin{solution}
We have
\[
d\omega_j=d\frac{1}{A}\wedge dx_j=-\frac{1}{A^2} dA\wedge dx_j=-\frac{A_i}{A^2}dx_i\wedge dx_j.
\]
Thus
\[
\omega_i\wedge\omega_{ij}=\omega_i\wedge \frac{1}{A}(A_i\,dx_j-A_j\,dx_i)=\frac{A_i}{A}\omega_i\wedge dx_j.
\]
Thus
\[
d\omega_j+\omega_i\wedge\omega_{ij}=0.
\]
Moreover, 
\[
d\omega_{ij}=\frac{1}{A}(A_{ik} dx_k\wedge dx_j-A_{jk} dx_k\wedge dx_i)-\frac{1}{A^2} A_k dx_k\wedge (A_i\,dx_j-A_j\,dx_i).
\]

We have
\[
\frac{1}{A}(A_{ik} dx_k\wedge dx_j-A_{jk} dx_k\wedge dx_i)=\frac{K}{A} dx_i\wedge dx_j,
\]
and
\[
\omega_{is}\wedge \omega_{sj}=\frac{1}{A^2}A_s dx_s(A_idx_j-AA_j dx_i)-A_s^2dx_i\wedge dx_j.
\]
Thus
\[
d\omega_{ij}+\omega_{is}\wedge\omega_{sj}=\left(\frac{K}{A}-\frac{A_s^2}{A^2}\right)dx_i\wedge dx_j=\frac{K}{A^2} dx_i\wedge dx_j=K\omega_i\wedge \omega_j.
\]
\end{solution}
\end{document}