% 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}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}

\usepackage{graphicx}
\usepackage[makeroom]{cancel}

% 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}

% Here's where you edit the Class, Exam, Date, etc.
\newcommand{\class}{Math 1441}
\newcommand{\term}{Fall 2018}
\newcommand{\examnum}{Practice Midterm 1}
\newcommand{\examdate}{February 2019}
\newcommand{\timelimit}{75} % 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

\begin{document}

% 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{tabular}{@{}l c r@{}}
	\textbf{Name:} &  &\hspace{3.25in} \textbf{\class} \textbf{\examnum}\\
	%\textbf{\term} &&\\
	%\textbf{\examdate} &&\\
\end{tabular}

\vspace{0.2cm}

\rule[1ex]{\textwidth}{0.5pt}

You have \timelimit\ minutes to finish the exam.
This exam contains \numpages\ pages (including this cover page)
and \numquestions\ problems.  Check to see if any pages are missing.
Print your name on the top of this page, and put your initials
on the top of every page, in case the pages become separated.\\

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

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

\begin{minipage}[t]{3.8in}
	\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.
		
	\end{itemize}
	
	Do not write in the table to the right.
\end{minipage}
\hfill
\begin{minipage}[t]{2.3in}
	\vspace{0pt}
	%\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}

\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}

% Basic question
\addpoints
\question Let $$f(x)=
\begin{cases}
0   & \text{if }\ x\le 0 \\
x^2 & \text{if }\ 0<x<1\\
2 & \text{if }\ x=1\\
1   & \text{if }\ x> 1.
\end{cases}$$

\begin{parts}

\part[2] Sketch the graph of $f$.\\[1cm]

\includegraphics[scale=0.7]{piecewise.png}\\[1cm]

\part[3] Determine the values of $c$ at which $\lim_{x\rightarrow c} f(x)$ exists.\\[0cm]

\emph{\color{blue}
	All real numbers.}\\[0cm]

\part[3] Determine the values of $c$ at which $f$ is continuous.\\[0cm]

\emph{\color{blue}
	All real numbers except $c=1$.}\\[0cm]

\part[2] Find the horizontal asymptote(s).\\[0cm]

\emph{\color{blue}
	$y=0$ and $y=1$.}\\[0cm]

%\part[2] Find the derivative of $f(f(x))$ at $x=-2$.
\end{parts}

% Question with parts
\newpage
\addpoints
\question Find the limit, if it exists.
\begin{parts}
\part[3]
$$\lim_{x\rightarrow -2}\,\frac{x^2+1}{x+1}$$

\emph{\color{blue}
	\textit{\underline{Solution}.} This is a rational function, therefore is continuous on its domain. Since $-2$ is in the domain, we can do direct substitution with $x=-2$ to get
	$$\lim_{x\rightarrow -2}\,\frac{x^2+1}{x+1}=\frac{(-2)^2+1}{(-2)+1}=\boxed{-5}.$$
	}\\[0cm]

\part[3]
$$\lim_{x\rightarrow 3}\,(2x+1)(x-1)^2$$

\emph{\color{blue}
	\textit{\underline{Solution}.} This is a polynomial (which can be seen by multiplying out the product), therefore is continuous on the real line. In particular, we can do direct substitution with $x=3$ to get
	$$\lim_{x\rightarrow 3}\,(2x+1)(x-1)^2=(2\cdot 3+1)(3-1)^2=\boxed{28}.$$
	}\\[0cm]

\part[4]
$$\lim_{x\rightarrow 1} \frac{x}{\sqrt{4-x^2}}$$

\emph{\color{blue}
	\textit{\underline{Solution}.} Applying the Distributive Law to the quotient, and then to the square root, we get
	$$\lim_{x\rightarrow 1} \frac{x}{\sqrt{4-x^2}}
	=\frac{\lim_{x\rightarrow 1} x}{\sqrt{\lim_{x\rightarrow 1} (4-x^2)}}
	=\frac{1}{\sqrt{4-1^2}}=\boxed{\frac{1}{\sqrt{3}}}.$$}\\[0cm]
\end{parts}

\newpage
\addpoints
\question Evaluate the limit.
\begin{parts}
\part[5]
$$\lim_{x\rightarrow 10}\,\frac{9x^2-900}{x^2-11x+10}$$

\emph{\color{blue}
	\textit{\underline{Solution}.}
	\begin{align*}
	\lim_{x\rightarrow 10}\,\frac{9x^2-900}{x^2-11x+10}
	&=\lim_{x\rightarrow 10}\,\frac{9(x^2-100)}{x^2-11x+10}
		&\hspace{-1cm}(\text{factor out 9})\\
	&=\lim_{x\rightarrow 10}\,\frac{9(x^2-10^2)}{{(x-10)}(x-1)}
		&\hspace{-1cm}(\text{factor the denominator})\\
	&=\lim_{x\rightarrow 10}\,\frac{9\cancel{(x-10)}(x+10)}{\cancel{(x-10)}(x-1)}
		&\hspace{-1cm}(\text{factor the numinator})\\
	&=\lim_{x\rightarrow 10}\,\frac{9(x+10)}{x-1}
		&\hspace{-1cm}(\text{simplify})\\
	&=\frac{9(10+10)}{10-1}
		&\hspace{-1cm}(\text{direct substitution})\\
	&=\boxed{20}
	\end{align*}}\\[0cm]
\part[5]
$$\lim_{x\rightarrow -\infty}\frac{6x^4+3x^2+2x}{2x^4+2x^3-x}$$

\emph{\color{blue}
	\textit{\underline{Solution}.}
	\begin{align*}
	\lim_{x\rightarrow -\infty}
	\frac{6x^4+3x^2+2x}{2x^4+2x^3-x}
	&=\lim_{x\rightarrow -\infty}
	\frac{\frac{6x^4}{x^4}+\frac{3x^2}{x^4}+\frac{2x}{x^4}}
	{\frac{2x^4}{x^4}+\frac{2x^3}{x^4}-\frac{x}{x^4}}
		&\hspace{-0cm}(\text{divide through by $x^4$})\\
	&=\lim_{x\rightarrow -\infty}
	\frac{6+\frac{3}{x^2}+\frac{2}{x^3}}{2+\frac{2}{x}-\frac{1}{x^3}}
		&\hspace{-0cm}(\text{simplify})\\
	&=\frac{6+\frac{3}{(-\infty)^2}+\frac{2}{(-\infty)^3}}
	{2+\frac{2}{(-\infty)}-\frac{1}{(-\infty)^3}}
		&\hspace{-0cm}(\text{direct substitution})\\
	&=\frac{6+\frac{3}{\infty}+\frac{2}{-\infty}}
	{2+\frac{2}{-\infty}-\frac{1}{-\infty}}\\
	&=\frac{6+0+0}{2+0-0}\\
	&=\boxed{3}
	\end{align*}}\\[0cm]
\end{parts}

\newpage
\addpoints
\question Find the limit, if it exists. Otherwise explain why the limit does not exist.
\begin{parts}
\part[3]
$$\lim_{x\rightarrow 2^-}\,\frac{x-3}{x-2}$$

\emph{\color{blue}
	\textit{\underline{Solution}.}
	\begin{align*}
	\lim_{x\rightarrow 2^-}\,\frac{x-3}{x-2}
	&=\frac{2^--3}{2^--2}
		&\hspace{-1cm}(\text{direct substitution})\\
	&=\frac{-1}{0^-}
		&\hspace{-1cm}(\text{using } c^--c=0^-)\\
	&=-\frac{1}{0^-}\\
	&=-(-\infty)
		&\hspace{-1cm}(\text{using } \frac{1}{0^-}=-\infty)\\
	&=\boxed{\infty}
	\end{align*}}\\[-1cm]

\part[3]
$$\lim_{x\rightarrow 0}\,\frac{1}{x^3}$$

\emph{\color{blue}
	\textit{\underline{Solution}.} Direct substitution gives $\frac{1}{0}$ (indeterminate). So we need to examine the one-sided limits. For the right-hand limit, we have
	$$\lim_{x\rightarrow 0^+}\,\frac{1}{x^3}=\frac{1}{(0^+)^3}
	=\frac{1}{0^+}
	={\infty};$$
	for the left-hand limit, we have 
	$$\lim_{x\rightarrow 0^-}\,\frac{1}{x^3}=\frac{1}{(0^-)^3}
 	=\frac{1}{0^-}
 	={-\infty}.$$
 	Since the left/right-hand limits disagree, the two-sided limit \boxed{DNE}.}\\[0cm]

\part[4]
$$\lim_{x\rightarrow 3}\,\frac{1}{(x-3)^2}$$

\emph{\color{blue}
	\textit{\underline{Solution}.} Again, direct substitution gives $\frac{1}{0}$. For the one-sided limits, we have
	$$\lim_{x\rightarrow 3^+}\,\frac{1}{(x-3)^2}
	=\frac{1}{(3^+-3)^2}
	=\frac{1}{(0^+)^2}
	=\frac{1}{0^+}
	={\infty},$$
	$$\lim_{x\rightarrow 3^-}\,\frac{1}{(x-3)^2}
	=\frac{1}{(3^--3)^2}
	=\frac{1}{(0^-)^2}
	=\frac{1}{0^+}
	={\infty}.$$
	Since the left/right-hand limits are both equal to $\infty$, the two-sided limit 
	$$\lim_{x\rightarrow 3}\,\frac{1}{(x-3)^2}=\boxed{\infty}.$$}
\end{parts}

\newpage
\addpoints
\question[10] Find the horizontal and vertical asymptotes. Justify your answers.
$$y=\frac{x-1}{x^2-1}$$

\emph{\color{blue}
	\textit{\underline{Solution}.} (i) To find the horizontal asymptote(s), we need to find
	$$\lim_{x\rightarrow \infty}\frac{x-1}{x^2-1}
	\quad\text{ and }\quad \lim_{x\rightarrow -\infty}\frac{x-1}{x^2-1}.$$
	For the limit at $\infty$, we have
	\begin{align*}
	\lim_{x\rightarrow \infty}\frac{x-1}{x^2-1}
	&=\lim_{x\rightarrow \infty}\frac{\frac{x}{x^2}-\frac{1}{x^2}}{\frac{x^2}{x^2}-\frac{1}{x^2}}
		&\hspace{-0cm}(\text{divide through by $x^2$})\\
	&=\lim_{x\rightarrow \infty}\frac{\frac{1}{x}-\frac{1}{x^2}}{1-\frac{1}{x^2}}
		&\hspace{-0cm}(\text{simplify})\\
	&=\frac{\frac{1}{\infty}-\frac{1}{\infty^2}}{1-\frac{1}{\infty^2}}
		&\hspace{-0cm}(\text{direct substitution})\\
	&=\frac{0-0}{1-0}\\
	&=\boxed{0}.
	\end{align*}
	Since $\frac{x-1}{x^2-1}$ is a rational function, the limit at $-\infty$ must equal 0 as well. Therefore there is only one horizontal asymptote: $\boxed{y=0}.$\\[0.5cm]
	\null\quad(ii) To find the vertical asymptote(s), it is useful to notice that
	$$\frac{x-1}{x^2-1}=\frac{x-1}{(x-1)(x+1)}=\frac{1}{x+1}.$$
	The function $\frac{1}{x+1}$ is continuous except at $x=-1$ (where it is undefined). To see if $x=-1$ is a vertical asymptote, we need to examine
	$$\lim_{x\rightarrow -1^+}\frac{1}{x+1}\quad \text{and/or}\quad \lim_{x\rightarrow -1^-}\frac{1}{x+1}.$$
	For the right-hand limit, we have
	$$\lim_{x\rightarrow -1^+}\frac{1}{x+1}
	=\frac{1}{-1^++1}=\frac{1}{(-1)^+-(-1)}=\frac{1}{0^+}=\infty.$$
	Thus $\boxed{x=-1}$ is a indeed vertical asymptote, and is the only vertical asymptote.}
\end{questions}
\end{document}
