\documentclass{article}

%\usepackage{teaching}

\title{Mathematical Methods: Tutorial sheet 5}

\date{7 November 2007}

\author{Peter Harrison}


\renewcommand{\baselinestretch}{1}   % {1,1.25,1.667} = % single/1.5/double line spacing

\newcommand{\answerblock}[1]{{\bf Solution:}\nopagebreak[1]#1}
\usepackage{mathchars}

\newcommand{\nat}{\bbbn}
\newcommand{\rat}{\bbbq}
\newcommand{\real}{\bbbr}
\newcommand{\integers}{\bbbz}

\renewcommand{\rat}{Q \!\!\!\! O}
\renewcommand{\integers}{Z \!\!\! Z}

%\renewcommand{\answerblock}[1]{}
\newcommand{\bcomment}[1]{}

\newcommand{\mtx}[4]{\left(\begin{array}{rr}#1&#2\\#3&#4\end{array}\right)}
\newcommand{\cmtx}[4]{\left(\begin{array}{cc}#1&#2\\#3&#4\end{array}\right)}
\newcommand{\Bmtx}[9]{\left(\begin{array}{rrr}#1&#2&#3\\#4&#5&#6\\#7&#8&#9\end{array}\right)}
\newcommand{\Bcmtx}[9]{\left(\begin{array}{ccc}#1&#2&#3\\#4&#5&#6\\#7&#8&#9\end{array}\right)}
\newcommand{\vcr}[2]{\left(\begin{array}{r}#1\\#2\end{array}\right)}
\newcommand{\cvcr}[2]{\left(\begin{array}{c}#1\\#2\end{array}\right)}
\newcommand{\Bvcr}[3]{\left(\begin{array}{r}#1\\#2\\#3\end{array}\right)}
\newcommand{\Bcvcr}[3]{\left(\begin{array}{c}#1\\#2\\#3\end{array}\right)}
\newcommand{\zeromtx}{\left(\begin{array}{rr}0&0\\0&0\end{array}\right)}
\newcommand{\identitymtx}{\left(\begin{array}{rr}1&0\\0&1\end{array}\right)}
\newcommand{\determinant}[1]{\left| #1 \right|}

\newcommand{\vi}{\vec{i}}
\newcommand{\vj}{\vec{j}}
\newcommand{\vk}{\vec{k}}


\begin{document}
\maketitle
\noindent
{\bf Assessed question is number 3.  Due Monday 19/11/2007.}

\bigskip

{\bf Maclaurin's series}
\begin{enumerate}

\item
You all know (or can look up) the binomial theorem, which gives a finite expansion in powers of $x$ for $(1+x)^n$ when $n$ is a positive integer.  Derive it by using Maclaurin's theorem.  What is the result when $n$ is \emph{not} an integer?

\answerblock{
When $n$ is a positive integer, the $r$th derivative of $(1+x)^n$ is $$n(n-1)\ldots (n-r+1)(1+x)^{n-r} = \frac{n!}{(n-r)!} \mbox{~~~when~} x=0,$$ for $0 \leq r \leq n$, and is 0 for $r>n$.  Hence the coefficient $$a_r =  \frac{n!}{(n-r)!r!}$$ for $0 \leq r \leq n$, noting that this gives 1 for $a_0$, and $a_r=0$ for $r>n$.  Thus
$$(1+x)^n = \sum_{r=0}^n \left( \begin{array}{c} n  \\r  \end{array} \right) x^r $$

When $n$ is not an integer -- call it $\alpha$ instead -- the same method applies but the number of non-zero derivatives is infinite (because you never get to a constant derivative).  Thus the series is infinite \emph{and only valid if it converges}:
$$(1+x)^\alpha = \sum_{r=0}^\infty \frac{\alpha(\alpha-1)\ldots (\alpha-r+1)}{r!} x^r $$
}


\item 
Calculate to 4 decimal places $\sin \pi/2, \sin \pi/3, \sin \pi/4, \sin \pi/5, \sin \pi/6$ and $\sin \pi/7$ by using (in each case) any of:
\begin{enumerate}
\item a suitable geometric argument;
\item a protractor, ruler and very large piece of paper;
\item Maclaurin's series.
\end{enumerate}
{\bf N.B.}  I expect you to use method (a) for {\em at least} $\sin \pi/2$!  

Calculate a bound on the error term (i.e. a number that the error is not greater than) in each case that you use Maclaurin's series, such that accuracy to 4 decimal places is assured.

\answerblock{
\begin{enumerate}
\item $\sin \pi/2 = 1$ by considering a right-angled triangle where one acute angle approaches 0 and the other approaches $\pi/1$.  Then the length of the side opposite the larger acute angle approaches the length of the hypotenuse.
\item Drop a perpendicular (bisector) from a vertex of an equilateral triangle of side-length 2 to the opposite side.  This creates two right-angled triangles with sides 2 (hypotenuse), 1 and $\sqrt{3}$ (by Pythagorus), and angles opposite these sides $\pi/2$, $\pi/6$ (because the angle at the vertex was bisected) and $\pi/3$.  Thus $\sin \pi/3 = \sqrt{3}/2$.
\item Consider a right-angled triangle with side-lengths $1,1,\sqrt{2}$.  Its angles are $\sin \pi/4,\sin \pi/4,\sin \pi/2$.  Thus $\sin \pi/4 = 1/\sqrt{2}$.
\item Use Maclaurin's series to up to the term $x^7/7!$, giving $\sin \pi/5 = 0.5878$.  Since the $8^{th}$ derivative of $\sin x$ is $\sin x$ which has absolute value less than 1 (except when $x=\pi/2$), an error bound is $1/7!=0.0000248016$ since $x<1$.  Actually, terms up to $x^5/5!$ suffice here.
\item As in part (b), $\sin \pi/6 = 1/2$.
\item Using Maclaurin's series as in part (d), $\sin \pi/7 = 0.4339$, using terms up to $x^7/7!$  Again, terms up to $x^5/5!$ suffice, and just two non-zero terms give a correct result to 3 d.p.
\end{enumerate}
}



\item 
\begin{enumerate}
\item 
Derive Maclaurin's series, i.e. power series expansions in $x^i$ ($i=1,2,\ldots$), for the functions $e^x, \sin x, \cos x$.
 
\item
The differential equation:
$$ \frac{\mbox{d}^2 y}{\mbox{d}x^2} + \omega^2 y = 0 $$
describes vibrations of various kinds, where $y$ usually represents a distance and $x$ is time.  To solve it, suppose that a power series solution is postulated:
$$ y = \sum_{i=0}^\infty a_i x^i $$  
\begin{enumerate}
\item
By substituting into the given differential equation and comparing coefficients of $x^i$ for $i \geq 0$, show that if the power series solution is valid, then 
$$a_{i+2} = -\frac{\omega^2 a_i}{(i+1)(i+2)}$$
\item 
Deduce that, for $n \in \nat$,
\begin{eqnarray*}
a_{2n} &=& (-1)^n a_0 \frac{\omega^{2n}}{(2n)!} \\
a_{2n+1} &=& (-1)^n a_1 \frac{\omega^{2n}}{(2n+1)!}
\end{eqnarray*}
\item
Hence show that, if $y=1$ and $\frac{\mbox{d} y}{\mbox{d}x} = 1$ at $x=0$, the solution of the differential equation is $y = \omega^{-1} \sin \omega x + \cos \omega x$.
\end{enumerate}
\end{enumerate}


\answerblock{
\begin{enumerate}
\item Let $D$ denote differentiation wrt $x$.  $D^n e^x = e^x = 1$ at $x=0$.  Thus,
Maclaurin's series gives $$e^x = \sum_{i=0}^\infty \frac{x^i}{i!}$$
$D^{2n} \sin x = (-1)^n \sin x = 0$ at $x=0$, $D^{2n+1} \sin x = (-1)^n \cos x = (-1)^n $ at
$x=0$.  Thus, Maclaurin's series gives 
$$\sin x = \sum_{i=0}^\infty (-1)^i \frac{x^{2i+1}}{(2i+1)!}$$
$D^{2n} \cos x = (-1)^n \cos x = (-1)^n $ at $x=0$, $D^{2n+1} \cos x = -(-1)^n \sin x = 0 $
at $x=0$.  Thus, Maclaurin's series gives 
$$\cos x = \sum_{i=0}^\infty (-1)^i \frac{x^{2i}}{(2i)!}$$

\begin{enumerate}
\item  Let $y = \sum_{i=0}^\infty a_i x^i$.  Substituting in the differential equation, we
get:
$$ \sum_{i=2}^\infty a_i i(i-1) x^{i-2} + \sum_{i=0}^\infty a_i \omega^2 x^i = 0$$ Changing
the summation variable in the left hand sum to $i+2$,
$$ \sum_{i=0}^\infty [a_{i+2} (i+2)(i+1) + a_i \omega^2 ] x^{i} = 0 $$ Comparing coefficients
the result follows.

\item  The recurrence `goes up in 2s' and even and odd terms depend respectively on $a_0$ and
$a_1$.  Thus, 
$$ a_{2n} = -\frac{\omega^2 a_{2n-2}}{2n(2n-1)} = \ldots = (-1)^n a_0
\frac{\omega^{2n}}{(2n)!} $$
$a_{2n+1}$ follows similarly.

\item Substituting into the power series, the solution is
\begin{eqnarray*}
y &=& a_0 \sum_{i=0}^\infty (-1)^i  \frac{\omega^{2i}x^{2i}}{(2i)!} + 
a_1 \sum_{i=0}^\infty (-1)^i \frac{\omega^{2i}x^{2i+1}}{(2i+1)!} \\
&=& a_0 \sum_{i=0}^\infty (-1)^i  \frac{(\omega x)^{2i}}{(2i)!} + 
a_1/\omega \sum_{i=0}^\infty (-1)^i \frac{(\omega x)^{2i+1}}{(2i+1)!} \\
&=& a_0 \cos \omega x + (a_1/\omega)  \sin \omega x
\end{eqnarray*}
Since $y=1$ at $x=0$, $a_0 = 1$.  Since $Dy = -a_0\omega \sin \omega x + a_1 \cos \omega x =
a_1$ at $x=0$, the result follows.
\end{enumerate}
\end{enumerate} }



\item 
{\bf (Exam question Q6C1452005)}

Calculate the first three non-zero terms of the Maclaurin series for the function $\tan x$.

\answerblock{
The first six derivatives (starting at 0th) of $\tan x$ are:  
\begin{eqnarray*}
\tan x \\ \sec^2 x \\ 2\sec^2 x \tan x \\ 6 \sec^4 x - 4 \sec^2 x \\ (24 \sec^4 x - 8 \sec^2 x)\tan x \\ (\ldots)' \tan x +  (24 \sec^4 x - 8 \sec^2 x)\sec^2 x
\end{eqnarray*}
which evaluate at $x=0$ to:  $0,1,0,2,0,16$

Maclaurin's series therefore starts:
$$\tan x = x + 2x^3/3! + 16x^5/5! + \ldots = x+x^3/3 + 2x^5/15 + \ldots$$
}


\item 
Verify numerically using Maclaurin's series that $\sin \pi/4 = \sin 9 \pi/4$ to four decimal places.  How many terms did you need, and why is this more than you needed in question 2?

\answerblock{
This time you need 13 terms, up to $x^{25}/25!$, when $x=9 \pi/4$.  The error term is bounded above by $x^{26}/26! = 0.0000299932$, so guaranteed correct to 4 d.p.  Leaving out the 13th term, we are not accurate to 4 d.p. (we get 0.7070), and the error is only bounded by $x^{24}/24! = 0.000390186$ which is insufficient.  
}


\end{enumerate}

\end{document}
