% search for "begin{questions" to jump to...well, you know.

% see bottom of file for rejected questions.

\documentclass{exam}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{sagetex}
\usepackage[margin=2cm]{geometry}
\usepackage[colorlinks=false]{hyperref}

% For "compressed" exam -- no vfills, pagebreaks, etc -- uncomment
% below. The actual value is unimportant; it only matters that it's
% defined. You can also call latex with something like
%
% pdflatex '\newcommand{\compressedformat}{x}\input{exam1.tex}'
%
%\newcommand{\compressedformat}{x}

%
% In the body of the exam, use \myvfill and \mynewpage.
%
\newcommand{\myvfill}{\ifdefined\compressedformat\relax\else\vfill\fi}
\newcommand{\mynewpage}{\ifdefined\compressedformat\relax\else\newpage\fi}

%
% Change these appropriately.
%
\newcommand{\thedate}{18 May 2010}
\newcommand{\theexam}{Final Exam}
\newcommand{\thecourse}{MAS101Z: Calculus 1}

%
% to print a big "DRAFT" on each page, uncomment below
%
%\newcommand{\draftversion}{x}
\newcommand{\drafttext}{\ifdefined\draftversion
  \begin{tikzpicture}[remember picture,overlay]
  \node [rotate=60,scale=12,color=gray!25] at (current page.center)
  {\textsf{DRAFT}};
\end{tikzpicture}
\else
  \relax
\fi}

%
% use this to add "problem continues..." at the bottom of the page
%
\newcommand{\problemcontinues}{
  \ifdefined\compressedformat
    \relax
  \else
    \runningfooter{}{\thepage\ of \numpages}{problem continues\ldots}
    \newpage
    \runningfooter{}{\thepage\ of \numpages}{}
  \fi}

\begin{document}

\pagestyle{headandfoot}
\header{\thecourse}{\theexam}{\thedate\drafttext}
\runningheadrule
\firstpageheader{\drafttext}{}{}
\firstpagefooter{}{}{}
\runningfooter{}{\thepage\ of \numpages}{}

\addpoints
\parindent 0ex

\textbf{\thecourse} \hfill  \textbf{Name:}
\makebox[5cm]{\hrulefill}

\textbf{\theexam}

\textbf{\thedate} \hfill \textbf{ID number:}
\makebox[5cm]{\hrulefill}

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

\ifdefined\compressedformat

{\large Usual exam instructions would go here, if not doing compressed
  format.}

\else

This exam contains $\numpages$ pages (including this cover page) and
$\numquestions$ problems for a total of $\numpoints$ points. Check to
see if any pages are missing.\\

You may \emph{not} use your books, notes, a calculator, or any
electronic device. You have three hours to complete this exam.\\

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

\begin{itemize}

\item \textbf{Show your work,} in a logical, coherent, and reasonably
  neat 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.} Your work should be mathematically correct and carefully
  and legibly written.

\item \textbf{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 \textbf{Follow the instructions of the exam proctors.}

%\item If you need more space, use the back of the pages; clearly
%  indicate when you have done this.
% Jurak asked me to delete this -- see his email from 13 May.

\end{itemize}

\fi
\myvfill

\begin{center} \gradetable[h][questions] \end{center}

\mynewpage

\begin{questions}

\question[10]
\parbox[t]{10.5cm}{Consider the shape bounded by: the $x$-axis, the
curve $y = \sin x$ from $0$ to $\pi/2$, the line $y = 1$ from $\pi/2$ to
$\pi/2 + 1$, and the line $x = \pi/2 + 1$, pictured on the right. Use
vertical strips to find the $x$-coordinate of the centroid of that
shape. (You will need to find the moment about the $y$-axis.)}
\hfill
\raisebox{-18mm}{\begin{tikzpicture}
  \draw[very thin, ->] (-1/4,0) -- (3, 0);
  \draw[very thin, ->] (0, -1/4) -- (0, 5/4);
  \draw[domain=0:pi/2] plot (\x,{sin(\x r)}) -- (pi/2 + 1, 1) --
  (pi/2 + 1, 0) -- cycle;

  \draw[very thin] (1/10, 1) -- (-1/10, 1) node[left] {$1$};

  \draw[very thin] (pi/2, 0) -- (pi/2, 1);
  \draw (pi/2, 1/10) -- (pi/2, -1/10) node[below] {$\frac{\pi}{2}$};

  \draw[very thin] (pi/2 + 1, 0) -- (pi/2 + 1, 1);
  \draw (pi/2 + 1, 1/10) -- (pi/2 + 1, -1/10) node[below] {$\frac{\pi}{2}+1$};
\end{tikzpicture}}

\mynewpage

\question[10] Consider the three polar plots below:

% set up plotting stuff
\begin{sagesilent}
  def gnuplot(x, y, tvals_, fn):
      """
      write out a gnuplot-style file of points x(t), y(t).
      """
      tvals = list(tvals_)
      lines = ['#This is a gnuplot-style file written by SageTeX.',
               '#x: {0}'.format(x),
               '#y: {0}'.format(y),
               '#Curve 0, {0} points'.format(len(tvals)),
               '#x y type']
      with open(fn, 'w') as f:
          f.write('\n'.join(lines) + '\n')
          fmt = lambda _: _.n().str(no_sci=2)
          f.writelines(['{0} {1}  i\n'.format(fmt(x(t)), fmt(y(t))) for t in tvals])

  t = var('t')
\end{sagesilent}

% now do the plots
\begin{sagesilent}
  r(t) = 1 - 2*sin(3*t)
  x(t) = r(t)*cos(t)
  y(t) = r(t)*sin(t)
  gnuplot(x, y, srange(0, 2*pi + .05, .05), 'exam2-1-2sin3t.table')

  r(t) = 1 - 3*sin(2*t)
  x(t) = r(t)*cos(t)
  y(t) = r(t)*sin(t)
  gnuplot(x, y, srange(0, 2*pi + .05, .05), 'exam2-1-3sin2t.table')

  r(t) = 1 - 2*sin(5/2*t)
  x(t) = r(t)*cos(t)
  y(t) = r(t)*sin(t)
  gnuplot(x, y, srange(0.21, 6.075, .05), 'exam2-crazy.table')
\end{sagesilent}

\newcommand{\myscale}{.8}
\newcommand{\myaxes}{\draw[very thin,->] (-3.25,0) -- (3.25,0);
                     \draw[very thin,->] (0,-3.25) -- (0,3.25);}

\begin{tikzpicture}[scale=\myscale]
 \myaxes
 \draw[smooth] plot file {exam2-crazy.table};
 \node at (1, -2) {A} ;
\end{tikzpicture}
\hfill
\begin{tikzpicture}[scale=\myscale]
 \myaxes
 \draw[smooth] plot file {exam2-1-2sin3t.table};
 \node at (1, -2) {B} ;
\end{tikzpicture}
\hfill
\begin{tikzpicture}[scale=\myscale]
 \myaxes
 \draw[smooth] plot file {exam2-1-3sin2t.table};
 \node at (1, -2) {C} ;
\end{tikzpicture}

One of the plots is a plot of $r = 1 - 2 \sin(3\theta)$ and another is a
plot of $r = 1 - 3 \sin(2\theta)$. (And one of the plots is something
else entirely.) Identify which plot goes with the correct function.
How do you know your answer is correct?

\mynewpage

\question[18]
For each of the following sequences, determine whether it
converges or diverges and explain your reasoning. If the series
converges, find its limit. (6 points each)

\begin{parts}
  \part $\displaystyle a_{n} = \frac{\left(\frac{5}{6}\right)^{n}}
{\left(\frac{4}{5}\right)^{n} + \left(\frac{6}{7}\right)^{n}}$
  % 70 p 420

  \myvfill

  \part $\displaystyle a_{n} = \int_{1}^{n} \frac{1}{\sqrt{x}}\, \mathrm{d}
  x$

  \myvfill

  \part $\displaystyle a_{n} = \frac{n^{2} + \sin(\arctan(n))}{
  \mathrm{e}^{\cos n} + 3n^{2}}$

  \myvfill
\end{parts}

\mynewpage

\question[10] Your friend Dongsu is now learning about Taylor series. He
says:
\begin{quote}
  ``I've found a way to calculate an approximation to the square root of
  three. They tell us that it is about $1.732$, but now I have a way to
  compute it to any accuracy I want. I start with the Taylor expansion
  for the binomial series:
  \[
  (1+x)^{1/2} = \sum_{n=0}^{\infty} \binom{1/2}{n} x^{n} =
  1 + \frac{1}{2}x - \frac{1}{8} x^{2} + \frac{1}{16}x^{3} -
  \frac{5}{128}x^{4} + \cdots
  \]
  Then you just plug in $x=2$. After the first term, it's an alternating
  series, and $\sqrt{1+x}$ is differentiable from $0$ to $2$, so it
  definitely converges---the first few approximations you get are $1$,
  $2$, $1.5$, $2$, $1.375$, and then it will alternate between bigger
  and smaller than $\sqrt{3}$. Just use more terms to get more
  accuracy.''
\end{quote}

Unfortunately, he is (again) wrong. Why is it not possible to use his
method to get accurate approximations to $\sqrt{3}$?

\mynewpage

\newcommand{\myvectors}{
  \vec{a} &= (1,0,1) & \vec{b} &= (1,0,0,1) & \vec{c} &= (1,2,3) \\
  \vec{d} &= (\sqrt{2}, \sqrt{3}, \sqrt{5}, \sqrt{7}) & \vec{e} &= (-2,
  -1, 3) & \vec{f} &= (6,5)
}

\question[12] Let
\begin{align*}
  \myvectors
\end{align*}
For each of the following expressions, if the expression does not make
any sense (i.e., it is undefined), say why. If the expression is
defined, evaluate it. (2 points each)

\begin{parts}
  \part $\vec{a} \cdot (\vec{c} \times \vec{e})$

  \myvfill

  \part $\vec{a} \cdot (\vec{b} \times \vec{d})$

  \myvfill

  \part $\vec{a} \times (\vec{c} \cdot \vec{e})$

  \myvfill

  \problemcontinues

  Here are the vectors again, for your reference:
  \begin{align*}
  \myvectors
  \end{align*}


  \part $(\vec{a} \cdot \vec{c}) \vec{f}$

  \myvfill

  \part $(\vec{a} \cdot \vec{c}) + (\vec{b} \cdot \vec{d})$

  \myvfill

  \part $(\vec{a} \times \vec{e}) \cdot \vec{b}$

  \myvfill
\end{parts}
% similar to 31 p 528

\mynewpage

\question[10] Find the length of the curve $r = \cos^{4}(\theta/4)$ for
$0 \le \theta \le \pi$.
% similar to 23 p 487

\mynewpage

\question[12] In this problem we will investigate the sequence
recursively defined by $a_{n+1} = a_{n}/2 + 1$, with $a_{0} = 1$. (3
points each)

\begin{parts}
  \part Show that if $a_{n} < 2$, then $a_{n+1} < 2$. (Since $a_{0} <
  2$, this means that every term of the sequence is less than two.)

  \myvfill

  \part Prove that the sequence is increasing by showing that $a_{n+1} -
  a_{n} > 0$ for all $n \ge 0$.

  \myvfill

  \part This sequence converges. How do you know?

  \myvfill

  \part Let $L$ be the limit of the sequence. Find $L$ by comparing
  $\displaystyle\lim_{n \to \infty} a_{n+1}$ and $\displaystyle\lim_{n
    \to \infty} (a_{n}/2 + 1)$.

  \myvfill
\end{parts}

\mynewpage

\question[12] Find the area enclosed by polar curves $r = 6$ and $r =
3 \csc \theta$.
% ex 14, p 487

% Ack! The line divides the circle into two pieces; which piece to take?
% There are two defensible choices here. Need to be more specific in the
% future.

% be careful with more complicated problems and the language for
% describing them -- my TA Jihee asked on a quiz for the area 'shared' by
% r = 1 and r = 1 - cos theta, and she meant the area inside both -- but
% it's easy to misinterpret. Be clear!

% (Actually, in Jihee's solutions, it seems that she wanted the area
% inside exactly one of the curves!)

\mynewpage

\noaddpoints \question[10] \addpoints
\begin{parts}
  \part[5] Assume that $\sum a_{n}$ converges. Explain why $\sum 1/a_{n}$
  must diverge.

  \myvfill

  \part[5] If $\sum a_{n}$ diverges and $a_{n} > 0$, does that guarantee
  that $\sum 1/a_{n}$ converges? Why?

  \myvfill
\end{parts}

\mynewpage

\question[8] Describe a series $\sum a_{n}$  that converges to zero, but
for which infinitely many terms are not zero.

\mynewpage

\question[20] For each of the series below, say whether the series
converges absolutely, converges conditionally, or diverges. Give reasons
for your answer. (4 points each)

\begin{parts}
  \part $\displaystyle \sum_{n = 0}^{\infty} \frac{n+1/2}{n!}$

  \myvfill

  \part $\displaystyle \sum_{n = 0}^{\infty} \frac{\cos(\pi
    n)}{(n+1/2)^{\pi}}$

  \myvfill

  \part $\displaystyle \sum_{n = 3}^{\infty} \frac{\ln n}{\ln (\ln n)}$

  \myvfill

  \problemcontinues

  \part $\displaystyle \sum_{n = 0}^{\infty} (-1)^{n}
  \left(\frac{1}{2}\right)^{n}$

  \myvfill

  \part $\displaystyle \sum_{n = 1}^{\infty} \left( n^{4}
    \sin\left(\frac{1/2}{n^{3}}\right)\right)^{n}$

  \myvfill
\end{parts}
% inspired by p 473, also
% http://www.sosmath.com/calculus/series/examples/examples.html

\mynewpage

\question[10] Express $\ln(1+x)$ as a power series with radius of
convergence at least $5$. (You will need to choose a center for the
power series so that it has that property.)

\mynewpage

\question[8] Let $\vec{v} = (2,6,1/3)$ and $\vec{w} = (-1, -1, 4)$. Find
an equation for the line perpendicular to both $\vec{v}$ and $\vec{w}$
that goes through the point $(\pi, \pi, \pi)$.

\end{questions}

\end{document}

,--------------------------------------------------------------
| Questions I didn't put on the exam, but which are interesting:
`-------------------------------------------------------------

\question[1] give a series with randomly arranged negative signs, ask if
it converges -- students need to recongize that they can take abs value
and it's absolutely convergent.

\question[1] have a bunch of functions -- 1/(1-x/5), 1/5 * 1/(1-x), and
so on -- and ask students to identify which has the largest radius of
convergence. Hrm, already have r.o.c. problem...

\question[1] find two series $\sum a_{n}$ and $\sum b_{n}$ that both
converge, but for which $\sum a_{n}b_{n}$ diverges. (exercise 58, p 448)

\question[1]
What is the value of the series
$\displaystyle
\sum_{n \ge 0} \frac{1}{\left(3 + (-1)^{n}\right)^{n}}
$?
% sum(1/4^(2*n), n, 0, infinity) + sum(1/2^(2*n+1), n, 0, infinity)
% 26/15

converge or diverge:
\part $\displaystyle a_{n} = \frac{\pi^{n}}{n^{\pi}}$
% 44 p 420


another problem idea for center of mass:

take a simple shape, such the sine curve shape in this exam. Add to that
shape either: a square of side length $r$ and density $1$,, or a square
of side length $1$ and density $r$. (Make a nice picture to illustrate
this.) Lots of interesting questions to ask...maybe, which makes the
center of mass move to the right faster?

or something where the shape is increasing in size, and you have to
choose a density so that its center of mass stays in one place.


%%% Local Variables:
%%% mode: pdflatex
%%% TeX-master: t
%%% TeX-PDF-mode: t
%%% End:
