% Taylor Approximations II
% MATH 266B Exercise 2
\documentclass[12pt]{article}
\usepackage{times}
\pagestyle{empty}
\addtolength{\textwidth}{1.2in}
\addtolength{\textheight}{1.2in}
\addtolength{\oddsidemargin}{-.58in}
\addtolength{\evensidemargin}{-.58in}
\renewcommand{\baselinestretch}{1.0}
\parindent = 0cm
\parskip = .1cm
\begin{document}
\begin{center}
{\Large Taylor Approximations II
\footnote{Copyright \copyright 2003 Winfried Just, Department Mathematics,
Ohio University. All rights reserved.}}
\end{center}
In this exercise, we will do some additional visualizations of how Taylor polynomials approximate
a given function. You will be able to submit this exercise for up to four bonus points
on Thursday, January 30.\\
For this exercise, you need to download the file Tapprox.m from my web page and save it in
the ``work'' directory of your \textsc{MatLab} folder without changing its name (and without changing
the extension .m)!\\
Now let us explore how the subsequent Taylor polynomials approach the function $\sin x$ on
the
interval $[-1, 10]$. For this, open \textsc{MatLab} and enter:
\smallskip
\verb$>> Tapprox$\\
\smallskip
\textsc{MatLab} will now ask you to enter the formula of your function. Enter:\\
\verb$>> sin(x)$\\
Next \textsc{MatLab} will ask you to enter a value for $a$. Choose $a = 0$ here.
Simply enter the number \verb& 0&. After that, you will be asked to enter the left and right
endpoints of your interval $[-1 , 10]$. Finally, \textsc{MatLab} will ask you to put limits
on the values that are displayed on the $y$-axis. For nice results, I recommend putting in
a lower limit of $-2$ and an upper limit of $2$.\\
Now you are ready to hit ENTER and observe how the Taylor polynomials approximate the graph
of $\sin x$. The figure shows you the graph of $\sin x$ and of the current Taylor
polynomial,
and the command window simultaneously displays the degree of the current Taylor polynomial.\\
On a separate work sheet (to be submitted) answer the following questions:
\begin{enumerate}
\item
What is the smallest $n$ such that the Taylor polynomial of degree $n$ at $a = 0$ approximates
the function $\sin x$ for every $x$ in the interval $[-1 , 10]$ with an error of no more than
$0.1$?
\item
Why does the picture in \textsc{MatLab}'s figure only change every other time you hit ENTER and not
every time?\\
Now repeat the exercise with the same function and the same interval, but let $a = 5.5$.
\item
With the new value of $a$,
what is the smallest $n$ such that the Taylor polynomial of degree $n$ at $a = 5.5$
approximates the function $\sin x$ for every $x$ in the interval $[-1 , 10]$ with an
error of no more than $0.1$? What is the reason that the answer is different from the answer to
Question 1?\\
Now repeat the exercise with the function $f(x) = \ln x$. Remember that you need to enter:\\
\verb$>> log(x)$\\
\smallskip
Let the interval be $[0, 2.5]$, choose $a = 1$, and make the bounds on the $y$-axis again
-2 and 2.
\item
Describe what you observe. Do the Taylor approximations appear to get better and better for
all $x$ in the interval?
\end{enumerate}
\end{document}