\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}

% key.sty (Mark W. Johnson, Sept. 8, 2000)
% A LaTeX style (used with the article class) for typing
% tests.
% Use with article.cls by inserting \usepackage{test}.




%%%%% Multiple Choice Question formats
%%%%% 	Each of the following commands takes five arguments, namely
%%%%%	the five answers to a multiple choice question.  They differ
%%%%%	in how the answers are formatted, with letters automatically
%%%%%	added.  If formatting problems arise, one need only change
%%%%%	the brief command to switch to a different format.

\newcommand{\Answers}[5]{\begin{center}(a) #1\hfil(b) #2\hfil(c) #3
\hfil(d) #4\hfil(e) #5 \end{center}}
%%%%%	Simply places all five answers on one line.  (short answers)

\newcommand{\Answerm}[5]{\begin{center}(a) $#1$\hfil(b) $#2$\hfil(c) $#3$
\hfil(d) $#4$\hfil(e) $#5$ \end{center}}
%%%%%	Simply places all five answers on one line, in math mode.

\newcommand{\threetwo}[5]{\begin{center}(a) $#1$\hfil(b) $#2$\hfil(c) $#3$ \\
\vspace{10pt}(d) $#4$\hfil(e) $#5$\end{center}}
%%%%%	Three answers on the first line, with two on the second, math mode.

\newcommand{\twothree}[5]{\begin{center}(a) $#1$\hfil(b) $#2$ \\
\vspace{10pt}(c) $#3$\hfil(d) $#4$\hfil(e) $#5$\end{center}}
%%%%%	Two answers on the first line, and three on the second, math mode. 

\newcommand{\twotwoone}[5]{\begin{center}(a) $#1$\hfil(b) $#2$ \\
\vspace{10pt}(c) $#3$ \hfil(d) $#4$ \\ \vspace{10pt}(e) $#5$\end{center}}
%%%%%	Two answers on each of the first two lines, with a single
%%%%%	answer on the third, math mode.

\newcounter{lett}
\newcommand{\singles}[5]{\begin{list}{(\alph{lett})}
{\usecounter{lett}} \item#1\item#2\item#3\item#4\item#5
\end{list}}
%%%%%	A simple list with one answer on each line.  (left-aligned)

\newcounter{lette}
\newcommand{\singlem}[5]{\begin{list}{(\alph{lette})}
{\usecounter{lette}} \item$#1$\item$#2$\item$#3$\item$#4$\item$#5$
\end{list}}
%%%%%	A simple list with one answer on each line, math mode.  (left-aligned)




%%%%% Essay Question formats

\newenvironment{halfpage}{\begin{list}{\textbf{\arabic{numb}.}}
{\setlength{\itemsep}{200pt plus 10pt minus 10pt}
\setlength{\topsep}{60pt plus 10pt minus 10pt}\usecounter{numb}}}
{\end{list}}
%%%%%	Partial credit problem in a (roughly) half-page format.

\newcommand{\half}[2]{\begin{halfpage}\setcounter{numb}{#1}#2\end{halfpage}}
%%%%%	The short command for the (roughly) half-page environment.
%%%%%	The first argument
%%%%%	indicates how many questions have gone before, in order
%%%%%	to number problems correctly.

\newenvironment{thirdpage}{\begin{list}{\textbf{\arabic{numb}.}}
{\setlength{\itemsep}{155pt plus 10pt minus 10pt}
\setlength{\topsep}{155pt plus 10pt minus 10pt}\usecounter{numb}}}
{\end{list}}
%%%%%	Partial credit problem in a (roughly) third of a page format.

\newcommand{\third}[2]{\begin{thirdpage}\setcounter{numb}{#1}#2
	\end{thirdpage}}
%%%%%	Short command for the third of a page format.  The first argument
%%%%%	indicates how many questions have gone before, in order
%%%%%	to number problems correctly.





%%%%% Now some standard test formatting commands.

\newenvironment{tops}{\begin{center}\bfseries}{\end{center}\vspace{20pt}}
%%%%% 	A header environment.

\newcommand{\blank}[1]{\makebox[#1]{\hrulefill}}
%%%%%	A generic blank line, with length argument.

\newcommand{\Name}[1][2.5in]{\textbf{Name:}\blank{#1}}
\newcommand{\Instructor}[1][2.5in]{\textbf{Instructor:}\blank{#1}}
\newcommand{\Section}[1][1in]{\textbf{Section:}\blank{#1}}
%%%%%	Name, Instructor or Section blank, with optional argument
%%%%%	to change the length of the blank.





%%%%% For Mild Texperts Only
%%%%% 	This segments sets up environments for an answer grid on the cover.

%% The first commands deal with a cover-page answer grid.

\newcommand{\checks}[2][9]{\boxed{\parbox[c][#2pt]{#1pt}{\large \bfseries a}} 
\boxed{\parbox[c][#2pt]{#1pt}{\large \bfseries b}} 
\boxed{\parbox[c][#2pt]{#1pt}{\large \bfseries c}} 
\boxed{\parbox[c][#2pt]{#1pt}{\large \bfseries d}} 
\boxed{\parbox[c][#2pt]{#1pt}{\large \bfseries e}}}
%%%%% 	An intermediate command which includes choices of height
%%%%%	or width for answer boxes.  

\newcommand{\answers}[1][9]{\checks[#1]{9}}
%%%%%  [1]=box width, default is 9pt

\newcommand{\ans}{\item \answers}
%%%%%  	This command gives one line of answer boxes if typed inside any
%%%%%	list environment.

\newcounter{numb}
\newenvironment{mylist}
{\begin{list}{\textbf{\arabic{numb}.}}{\usecounter{numb}}}{\end{list}}
%%%%%	Environment is simply an enumerated list with bold-face numbers
%%%%%	using the counter numb.


\newcommand{\Mult}[3][2in]{\item {#2}\newline\parbox[r][#1][t]{300pt}{#3}}

\newcommand{\Multlist}[2]{{\begin{mylist}
	\setcounter{numb}{#1} #2 \end{mylist}}}


\newcommand{\First}[2][2.5in]{\parbox{#1}{\begin{mylist} #2 \end{mylist}}}
%%%%%	This command produces the first column of answer boxes.
%%%%%	The optional argument is the width of the column, while the
%%%%%	standard argument is expected to be a number of \ans commands.
 
\newcommand{\Second}[3][2.5in]{\parbox{#1}{\begin{mylist}
	\setcounter{numb}{#2} #3 \end{mylist}}}
%%%%%	This command produces the second column of answer boxes
%%%%%	(do NOT skip a line after the argument of \First).
%%%%%	The optional argument changes the column width, the first
%%%%%	standard argument indicates how many answers are in the first
%%%%%	column, while the second should be a number of \ans commands.

\newcommand{\Firsts}[3][2.5in]{\hspace{#3}\parbox{#1}
		{\begin{mylist} #2 \end{mylist}}}
%%%%%	A slight variation of the \First command above which allows the
%%%%%	third argument to add an \hspace before the first column
%%%%%	of answer boxes.







%%%%% Notre Dame-Specific commands
%%%%% 	These commands are essentially class specific and should be 
%%%%%	ignored by almost everyone. 

\newcommand{\points}[3][100]{\vspace{25pt} \noindent
This examination consists of #2 problems,
worth a total of #1 points on #3 pages, including this front cover.  If 
problems are missing from your copy, you must ask for a new copy right
away.  The first ten problems are multiple choice 
\textbf{with no partial credit for any reason}.  Be sure to indicate
your single answer to each question by placing an $\times$ through
that letter on the answer grid below.  Students will \textbf{NOT} be
allowed extra time to fill in the grid after the exam has ended
if they forget to do so during the exam!
\vspace{10pt}}
%%%%% 	Between \Name and answer grid comments.  The optional argument
%%%%%	indicates the total points (default is 100).  The first argument
%%%%%	indicates the number of problems, the second deals with the
%%%%%	number of pages.


\newcommand{\finalpoints}[3][150]{\vspace{25pt} \noindent
This examination consists of #2 problems,
worth a total of #1 points on #3 pages, including this front cover.  If 
problems are missing from your copy, you must ask for a new copy right
away.  All of the problems are multiple choice 
\textbf{with no partial credit for any reason}.  Be sure to indicate
your single answer to each question by placing an $\times$ through
that letter on the answer grid below.  Students will \textbf{NOT} be
allowed extra time to fill in the grid after the exam has ended
if they forget to do so during the exam!
\vspace{10pt}}
%%%%% 	Between \Name and answer grid comments for the final.  
%%%%%	This is a slight variation on the \points command above.





\newcommand{\calcs}[1]{\vspace{10pt} \noindent
The last #1 problems are partial credit problems.
Be sure to show all work legibly.  Clearly indicate your final answer,
which should be simplified whenever possible.
\textbf{Books, notes and CALCULATORS are NOT permitted.}}  
%%%%%	Below answer grid comments.  The argument indicates how many
%%%%%	partial credit problems will be on the exam. 


\newcommand{\pledge}{\vspace{20pt}
\textbf{Sign the following honor code statement:}\newline 
``On my honor, I have neither given nor received unauthorized
aid on this exam.''\newline\parbox[c][35pt][b]{3.5in}{\hrulefill}}
%%%%%	Standard Notre Dame honor code statement.

\newcommand{\shortpledge}{\textbf{Sign the following honor code statement:}
\newline``On my honor, I have neither given nor received unauthorized
aid on this exam.''\quad \parbox[c][10pt][b]{4.5in}{\hrulefill} }
%%%%%	Notre Dame honor code statement for tight spaces.




\newcommand{\limn}{\underset{\scriptscriptstyle{n \to \infty}}{\lim} \ }
\newcommand{\lims}{\limn \underset{i=1}{\overset{n}{\Sigma}}}

\begin{document}

\begin{tops}
 Math 120 -- Calculus B \\
 Fall Semester 2000 \\
 First Midterm \\
 Thursday, September 21
\end{tops}

\Name \quad \Section

\points{15}{8}

\First{
\ans\ans\ans\ans\ans}
\Second{5}{
\ans\ans\ans\ans\ans}

\calcs{5}
\pledge

\break


\Multlist{0}{

\Mult	{Which of the following expresses $\int_2^5 x^4 \ dx$ as a limit
	of Riemann sums?}
	{\twotwoone{\lims (5+\frac{3i}{2})^4\frac3n}
	{\lims (2+\frac{3i}{n})^5\frac5n}
	{\lims (1+\frac{3i}{n})^4\frac3n}{\lims (2+\frac{3i}{n})^4\frac3n}
	{\lims (2+\frac{3i}{4})^5\frac3{5n}}}

\Mult	{Which of the following is an expression for $\int_1^2 x \ dx$
	directly from the definition? (Recall that 
	$\Sigma_{i=1}^n i=\frac{n(n+1)}2$.)}
	{\twotwoone{\limn(\frac2n+\frac{n(n+1)}{2n^2})}
	{\limn(1+\frac{n(n+1)}{2n^2})}{\limn(\frac12+\frac{n(n+1)}{n^2})}
	{\limn(n+\frac{n(n+1)}{2n})}{\limn(\frac1n+\frac{n(n+1)}{2n^2})}}
	
\Mult	{Suppose $x^3 \leq f(x) \leq x^2$ for $0 \leq x \leq 1$.  Which of
	the following must be true?}
	{\singles{$\frac13 \leq \int_0^1 f(x)\ dx \leq \frac12$}
	{$1 \leq \int_0^1 f(x)\ dx \leq 3$}
	{$\frac14 \leq \int_0^1 f(x)\ dx \leq \frac13$}
	{$\int_0^1 f(x)\ dx$ is negative}{$\int_0^1 f(x)\ dx$ is zero}}

\Mult	[1.6in]{Compute \[ \int_2^3 3x^2-2x+7\ dx \]}
	{\Answers{59}{14}{-18}{39}{21}}

\Mult	{Compute \[ \int sec^2(x) tan(x)\ dx \]}
	{\threetwo {tan(sec(x))+C}{sec(tan(x))+C}{sec^2(x)}
	{\frac{1}{2}sec(x)tan(x)+C}{\frac{1}{2}tan^2(x)+C}}

\Mult	{Find the area between $y=1$, $y=-2$, $x=y^2$ and $x=2y-2$.}
	{\Answers{$\frac{8}{3}$}{8}{12}{$-\frac{8}{3}$}{$-12$}}

\Mult	{The natural length of a spring is $30$ cm.  If a $10$ N force
	holds it at $35$ cm, how much work was required to move it there
	from its natural position?}
	{\Answers{.5 J}{50 J}{25 J}{.25 J}{5 J}}

\Mult	{Find the average value of the function 
	$y=cos \left(\frac{\pi}{2} sin(x)\right)cos(x)$ 
	over the interval between $0$ and $\frac{\pi}{2}$.}
	{\Answers{$\frac{4}{\pi^2}$}{$\frac{\pi^2}{8}$}{$\frac{8}{\pi^2}$}
	{$\frac{\pi}{4}$}{$\frac{\pi}{8}$}}

\Mult	{Which of the following is the derivative of 
	$g(x)=e^{tan(x)}$?}
	{\threetwo{tan(x)\ e^{sec^2(x)}}{sec^2(x)\ e^{tan(x)}}
	{e^{tan(x)}+C}{e^{sec^2(x)}}{e^{sec(x)tan(x)}}}

\Mult	{Integrate 
	\[ \int_0^{\frac{\pi}{2}} 2sin(x)cos(x) e^{sin^2(x)}\ dx \]}
	{\Answers{$e-1$}{$1-e$}{$e^2-1$}{$\frac{e^2}2-\frac12$}{$e$}}
}

\break

\half{10}{

\item	Approximate the area between $y=x$ and $y=x^2$ using left endpoints
	and $n=3$ subintervals.

\item	If
	\[ h(x)=\int_{2-4x^2}^{4x^2-2} sin(t^2)\ dt \]
	compute $h'(x)$.

\item	Find the volume of the solid formed by rotating the region
	between $x=1$, $y=0$ and $x=y^2$ around the line $x=1$.

\item	Compute the volume of the solid formed by rotating the area
	under the curve $y=sin(x^2)$ between $0$ and $\sqrt{\pi}$
	around the $y$-axis.

\item	If a child succeeds in emptying a rectangular bathtub by splashing
	all of the water over the sides, give a formula for the 
	work done by the child in terms of the length (l),
	width (w) and height (h) of the tub.  (Using metric units the
	wieght of water is $9800 \ \frac{N}{m^3}$.)  Your work should include
	at least one Riemann sum approximating the work.  
}


\end{document}