%% This document created by Scientific Notebook (R) Version 3.0


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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{makeidx}
\usepackage{sw20jart}

%TCIDATA{TCIstyle=article/art4.lat,jart,sw20jart}

%TCIDATA{<META NAME="ViewSettings" CONTENT="31">}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="Title" CONTENT="Differentiation">}
%TCIDATA{Created=Mon Aug 19 14:52:24 1996}
%TCIDATA{LastRevised=Thu Feb 13 17:05:44 1997}
%TCIDATA{Language=American English}
%TCIDATA{CSTFile=MathHelp.cst}
%TCIDATA{<LINK REL="first" HREF="DM7-1.tex">}
%TCIDATA{<LINK REL="contents" HREF="DM0-0.tex">}
%TCIDATA{<LINK REL="copyright" HREF="DM0-2.tex">}
%TCIDATA{<LINK REL="end" HREF="DM7-9.tex">}
%TCIDATA{<LINK REL="index" HREF="DMIndex.tex">}
%TCIDATA{<LINK REL="next" HREF="DM7-4.tex">}
%TCIDATA{<LINK REL="parent" HREF="DM7.tex">}
%TCIDATA{<LINK REL="previous" HREF="DM7-2.tex">}
%TCIDATA{<LINK REL="top" HREF="DM0-0.tex">}

\input{tcilatex}
\begin{document}


\section{Differentiation 
\index{Derivative}\label{Derivative}}

The \emph{derivative} $f^{\prime }$ of a function $f$ is defined by the
equation 
\[
f^{\prime }(x)=\lim_{h\rightarrow 0}%
\frac{f(x+h)-f(x)}{h} 
\]

\subsection{\ Notation}

\textsl{Scientific Notebook} recognizes various notations for the
derivative, including the forms 
\[
\frac{d}{dx}\text{,}\;\frac{d^{n}}{dx^{n}}\text{,}\;D_{x}\text{,}\;D_{xx}%
\text{,}\;D_{x^{2}}\text{,}\;D_{xy}\text{,}\;D_{x^{s}y^{t}}\text{,}\;\frac{%
\partial }{\partial x}\text{, and }\frac{\partial ^{n}}{\partial
x^{s}\partial y^{t}} 
\]
where $s+t=n$. If $f(x)$ is defined as a function, then the forms $f^{\prime
}(x)$, $f^{\prime \prime }(x)$, and $f^{(n)}(x)$ are also recognized.

\begin{quote}
$\blacktriangleright $ To find the derivative of $x^{2}$
\end{quote}

\begin{itemize}
\item  Place the insertion point in the expression $\frac{d}{dx}\left(
x^{2}\right) $ and choose \textsf{Evaluate}, press \textsc{ctrl + e}, or
click \FRAME{itbpF}{0.3009in}{0.3009in}{0.0701in}{}{}{evaluate.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 0.3009in;height 0.3009in;depth 0.0701in;original-width
17.8125pt;original-height 16.9375pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'Evaluate.wmf';file-properties "XNPEU";}}.
\end{itemize}

You get the same result from any of the following expressions. 
\begin{eqnarray*}
&&\frac{dx^2}{dx}\qquad \frac d{dx}x^2\qquad \frac d{dx}\left( x^2\right)
\qquad \frac d{dx}\left[ x^2\right] \qquad \frac d{dx}\left\{ x^2\right\} \\
&&D_xx^2\qquad D_x\left( x^2\right) \qquad \frac{\partial x^2}{\partial x}%
\qquad \frac \partial {\partial x}x^2\qquad \frac \partial {\partial
x}\left( x^2\right)
\end{eqnarray*}

Note that the ``prime'' notation works only for defined functions. For
example, \textsf{Evaluate} applied to $\left( x+\sin x\right) ^{\prime }$
does not give the derivative.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\left( x+\sin x\right) ^{\prime }=\allowbreak x+\sin x$
\end{quotation}

The derivative is applied to the term directly to the right of the operator,
as illustrated in the following two examples.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\dfrac{\partial ^{2}}{\partial x^{2}}x^{2}+3x=\allowbreak 2+3x\vspace{6pt}$

$\dfrac{\partial ^{2}}{\partial x^{2}}\left( x^{2}+3x\right) \allowbreak
=\allowbreak 2$
\end{quotation}

Good notation is important when you are using \textsl{Scientific Notebook},
just as good notation is important in mathematics. Ambiguous notation \label%
{Amgibuous notation} 
\index{Ambiguous notation}may be accepted, but it may lead to an unexpected
output. Experiment with expressions such as 
\[
\frac{\partial ^{2}}{\partial x^{2}}\left( (x^{2}+3x\right) \qquad \text{%
and\qquad }\frac{\partial ^{2}}{\partial x^{2}}\{x^{2}+3x 
\]
to see how \textsl{Scientific Notebook} interprets ill-formed \label%
{Ill-formed expressions} 
\index{Ill-formed expressions}expressions.

\begin{quotation}
\emph{Tip\quad }Making good use of the parentheses button 
\FRAME{itbpF}{0.3009in}{0.3009in}{0.0701in}{}{}{parens.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid-file
"F";width 0.3009in;height 0.3009in;depth 0.0701in;original-width
17.8125pt;original-height 16.9375pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'Parens.wmf';file-properties "XNPEU";}}
eliminates many common types of ill-formed expressions.
\end{quotation}

\strut

\label{Piecewise-defined function}You can find derivatives of
piecewise-defined functions. The result will be a piecewise-defined function.

\begin{example}
Make the definition 
\[
f(x)=\left\{ 
\begin{array}{lll}
x & if & x<0 \\ 
3x^{2} & if & x\geq 0
\end{array}
\right. 
\]
Then \textsf{Evaluate} will return the following piecewise-defined function. 
\[
\frac{d}{dx}f(x)=\allowbreak \left\{ 
\begin{array}{ccc}
1 & \func{if} & x<0 \\ 
\func{undefined} & \func{if} & x=0 \\ 
6x & \func{if} & 0<x
\end{array}
\right. 
\]
\end{example}

\begin{example}
It is not necessary to name a piecewise function in order to take its
derivative. Enter a defining matrix for a piecewise-defined function,
including the left brace and right null brace: 
\[
\left\{ 
\begin{array}{ccl}
x+2 & \text{if} & x<0 \\ 
2 & \text{if} & 0<x<1 \\ 
2/x & \text{if} & 1<x
\end{array}
\right. 
\]
Then \textsf{Evaluate} will return the derivative as the following
piecewise-defined function. 
\[
\frac{d}{dx}\left( \left\{ 
\begin{array}{ccl}
x+2 & \text{if} & x<0 \\ 
2 & \text{if} & 0<x<1 \\ 
2/x & \text{if} & 1<x
\end{array}
\right. \right) =\allowbreak \left\{ 
\begin{array}{ccc}
1 & \func{if} & x<0 \\ 
\func{undefined} & \func{if} & x=0 \\ 
0 & \func{if} & x<1 \\ 
\func{undefined} & \func{if} & x=1 \\ 
-\frac{2}{x^{2}} & \func{if} & 1<x
\end{array}
\right. 
\]
\end{example}

\strut

\subsection{\ Plotting Derivatives\label{Plotting Derivatives}}

With \textsl{Scientific Notebook}, you can plot several functions on the
same graph. In particular, an function can be plotted together with one or
more of its derivatives.

\begin{example}
Define $f$ by the equation $f(x)=x^{4}-7x^{3}+14x^{2}-8x$. To view the graph
of $f$, type $f$ or $f(x)$ and click \FRAME{itbpF}{0.3009in}{0.3009in}{%
0.0701in}{}{}{2dplot.wmf}{\special{language "Scientific Word";type
"GRAPHIC";display "PICT";valid_file "F";width 0.3009in;height 0.3009in;depth
0.0701in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'2dplot.wmf';file-properties "XNPEU";}} or choose \textsf{Plot 2D +
Rectangular}. To view the graphs of the first and second derivatives, type $%
f^{\prime }(x)$, select it and drag it to the frame; then type $f^{\prime
\prime }(x),$ select it and drag it to the frame. In the \textsf{Plot
Properties} tabbed dialog set the \textsf{Domain Interval} to $-1\,\leq
\,x\,\leq \,5$ and set the \textsf{View Intervals} to $-1\,\leq \,x\,\leq
\,5 $ and $-15\,\leq \,y\,\leq \,15$. Choose the \textsf{Plot Components}
tab, and set the \textsf{Line Color} to \textsf{Green}; set the \textsf{Item
Number} to 2 and set the \textsf{Line Color} to \textsf{Red}; and set the 
\textsf{Item Number} to 3 and set the \textsf{Line Color} to \textsf{Blue}.
You see $f$ in green, $f^{\prime }$ in red, and $f^{\prime \prime }$ in
blue. \FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{Plot }{\special{language
"Scientific Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth
0pt;display "PICT";function \TEXUX{$x^{4}-7x^{3}+14x^{2}-8x$};linecolor
"green";linestyle 1;linethickness 1;pointstyle "point";function
\TEXUX{$\frac{d}{dx}\left( x^{4}-7x^{3}+14x^{2}-8x\right) $};linecolor
"red";linestyle 1;linethickness 1;pointstyle "point";function
\TEXUX{$\frac{d^{2}}{dx^{2}}\left( x^{4}-7x^{3}+14x^{2}-8x\right)
$};linecolor "blue";linestyle 1;linethickness 1;pointstyle "point";xmin
"-1";xmax "5";xviewmin "-1";xviewmax "5";yviewmin "-15";yviewmax
"15";viewset"XY";rangeset"X";phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}You can also
distinguish the graphs by determining the values at $0$. Use \textsf{Evaluate%
} (or inspection) to get $f(0)=\allowbreak 0$, $f^{\prime }(0)=\allowbreak
-8 $, and $f^{\prime \prime }(0)=\allowbreak 28$.\medskip
\end{example}

\subsection{\ Generic Functions\label{Generic functions}}

It is possible to allow \textsl{Scientific Notebook} to treat $f(x)$ as an%
\label{Arbitrary functions} 
\index{Arbitrary functions}arbitrary, or ``generic'' function. Simplify
define $f(x)$ to be a function, without associating it with a formula.

\begin{quote}
$\blacktriangleright $ \textsf{Define + New Definition}, or click 
\FRAME{itbpF}{0.3001in}{0.3001in}{0.0701in}{}{}{newdef.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.3001in;height 0.3001in;depth
0.0701in;original-width 0pt;original-height 0pt;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename 'NEWDEF.WMF';file-properties
"XNPEU";}}
\end{quote}

\begin{quotation}
$f(x)$

$g(x)$
\end{quotation}

Standard rules of calculus apply to arbitrary functions.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\dfrac{d}{dx}\left( f\left( g(x)\right) \right) =\allowbreak f^{\prime
}\left( g\left( x\right) \right) g^{\prime }\left( x\right) \vspace{6pt}$

$D_{x}\left[ f(x)g(x)\right] =\allowbreak \left[ f^{\prime }\left( x\right)
g\left( x\right) +f\left( x\right) g^{\prime }\left( x\right) \right] 
\vspace{6pt}$

$D_{x}\dfrac{f(x)}{g(x)}=\allowbreak \dfrac{f^{\prime }\left( x\right) }{%
g\left( x\right) }-\dfrac{f\left( x\right) }{g^{2}\left( x\right) }g^{\prime
}\left( x\right) \vspace{6pt}$

$\dfrac{d}{dx}\dint_{0}^{x}f(t)\,dt=\allowbreak f\left( x\right) $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Series, Expand in Powers of:} $x$
\end{quote}

\begin{quotation}
$f(x)=\allowbreak f\left( 0\right) +f^{\prime }\left( 0\right) x+\frac{1}{2}%
f^{\prime \prime }\left( 0\right) x^{2}+\frac{1}{6}f^{\prime \prime \prime
}\left( 0\right) x^{3}+O\left( x^{4}\right) \medskip $
\end{quotation}

\subsection{\ Implicit Differentiation\label{Implicit differentiation}}

\textsl{Scientific Notebook} handles implicit differentiation in a natural
way.

\begin{example}
To carry out implicit differentiation of functions determined by the
equation 
\[
xy+\sin x=y 
\]

\begin{enumerate}
\item[1.]  Leave the insertion point in the equation $xy+\sin x=y$, and from
the \textsf{Calculus} submenu, choose \textsf{Implicit Differentiation}.
Type $x$ for \textsf{Differentiation Variable}, and choose \textsf{OK}. This
returns the equation 
\[
y+xy^{\prime }+\cos x=y^{\prime } 
\]

\item[2.]  From the \textsf{Solve} submenu, choose \textsf{Exact}. Type $%
y^{\prime }$ in the dialog box for \textsf{Variable(s) to Solve For}, and
choose \textsf{OK}. This returns the equation 
\[
y^{\prime }=-\frac{y+\cos x}{x-1} 
\]

\item[3.]  Leave the insertion point in $y^{\prime }=-\frac{y+\cos x}{x-1}$,
and from the \textsf{Calculus} submenu, choose \textsf{Implicit
Differentiation}. Type $x$ for the \textsf{Differentiation Variable}, and
choose \textsf{OK}. This returns the equation 
\[
y^{\prime \prime }=-\frac{y^{\prime }-\sin x}{x-1}+\frac{y+\cos x}{\left(
x-1\right) ^{2}} 
\]

\item[4.]  Use the editing features of \textsl{Scientific Notebook} to
replace $y^{\prime }$ by $-\frac{y+\cos x}{x-1}$. Then apply \textsf{Simplify%
} and \textsf{Factor} the denominator in place to get the following. 
\begin{eqnarray*}
y^{\prime \prime } &=&-\frac{-\frac{y+\cos x}{x-1}-\sin x}{x-1}+\frac{y+\cos
x}{\left( x-1\right) ^{2}} \\
&=&\allowbreak \frac{2y+2\cos x+\left( \sin x\right) x-\sin x}{x^{2}-2x+1} \\
&=&\allowbreak \frac{2y+2\cos x+\left( \sin x\right) x-\sin x}{\left(
x-1\right) ^{2}}
\end{eqnarray*}
\end{enumerate}
\end{example}

\strut

\label{Generic constant}You can use \textsf{Define + New Definition} to 
\index{Generic functions@Generic functions}declare a character to be a
(generic) constant.

\begin{quote}
$\blacktriangleright $ \textsf{Define + New Definition}
\end{quote}

\begin{quotation}
$a$
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Implicit Differentiation}
\end{quote}

\begin{quotation}
$ax+y=0$ (\textsf{Differentiation Variable}: $x$) Derivative: $a+y^{\prime
}=0\medskip $

$bx+y=0$ (\textsf{Differentiation Variable}: $x$) Derivative: $b^{\prime
}x+b+y^{\prime }=0$
\end{quotation}

\strut

Note that $a^{\prime }=0$ while $b^{\prime }$ is not automatically assumed
to be $0$.

\strut

\subsection{\ Numerical Solutions to Equations\label{Numerical solutions}}

\textsl{Scientific Notebook} supports both exact and numerical methods for
solving equations, as illustrated in the following three examples.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Exact}
\end{quote}

\begin{quotation}
$5x^{3}-5x^{2}=x$, Solution is: $\left\{ x=0\right\} ,\allowbreak \left\{ x=%
\frac{1}{2}+\frac{3}{10}\sqrt{5}\right\} ,\allowbreak \left\{ x=\frac{1}{2}-%
\frac{3}{10}\sqrt{5}\right\} $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Exact}
\end{quote}

\begin{quotation}
$5.0x^{3}-5.0x^{2}=x$, Solution is: $\left\{ x=0\right\} ,\allowbreak
\left\{ x=1.170820393\right\} ,\allowbreak \left\{ x=-.1708203932\right\} $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Numeric}
\end{quote}

\begin{quotation}
$5x^{3}-5x^{2}=x$, Solution is: $\left\{ x=0\right\} ,\allowbreak \left\{
x=-.1708203932\right\} ,\allowbreak \left\{ x=1.170820393\right\} $
\end{quotation}

\subsubsection{Iteration\label{Iterate}}

You can also solve many equations of the form $f(x)=x$ numerically using 
\textsf{Iterate} 
\index{Iteration} 
\index{Solve@\QTR{MenuDialog}{Solve}!iterate@\QTR{MenuDialog}{Iterate}}from
the \textsf{Calculus} submenu. This technique works for functions satisfying 
$\left| f^{\prime }(x)\right| <1$ near the intersection of the curve $y=f(x)$
and the line $y=x$. You start with an estimate $x_{0}$ for the root, and 
\textsf{Iterate} returns the list of values 
\[
f(x_{0}),f\left( f(x_{0})\right) ,f\left( f\left( f(x_{0})\right) \right)
,f\left( f\left( f\left( f(x_{0})\right) \right) \right) ,\ldots 
\]
up to the number of iterations you specify. In appropriate situations, these
values converge to a root of the equation $f(x)=x$.

\begin{example}
Use \textsf{Iterate} to solve the equation $\cos x=x$.

\begin{itemize}
\item  \textsf{Define} $f$ as the function $f(x)=\cos x$.

\item  From the \textsf{Calculus} submenu, choose \textsf{Iterate}.

\item  In the dialog box, enter $f$ as the \textsf{Iteration Function},
select 1.0 as \textsf{Starting Value} and select 10 as the \textsf{Number of
Iterations}.
\end{itemize}

(Note the decimal form of the initial value; it is needed to get the
numerical response shown in this example.)

With \textsf{Digits Used in Display} set to 5, you get the following vector
of iterations. 
\[
\left[ 
\begin{array}{c}
1.0 \\ 
.5403 \\ 
.85755 \\ 
.65429 \\ 
.79348 \\ 
.70137 \\ 
.76396 \\ 
.7221 \\ 
.75042 \\ 
.7314 \\ 
.74424
\end{array}
\right] 
\]
These entries are the initial value, followed by the values 
\[
f(1.0),f(f(1.0)),\ldots ,f(f(f(f(f(f(f(f(f(f(1.0)))))))))) 
\]
\end{example}

You can generate these numbers geometrically by starting at the point $(1,0)$
and moving vertically to the curve $y=\cos x$, then horizontally to the line 
$y=x$, then vertically to the curve $y=\cos x$, then horizontally to the
line $y=x$, and so forth, as illustrated in the following figure. 
\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$\cos x,x$};linecolor "black";linestyle
1;linethickness 1;pointstyle "point";function \TEXUX{$\left[
\MATRIX{2,11}{c}\VR{,,c,,,}{,,c,,,}{,,,,,}\HR{,,,,,,,,,,,}\CELL{1.0}\CELL{0}%
\CELL{1.0}\CELL{.5403}\CELL{.5403}\CELL{.5403}\CELL{.5403}\CELL{.85755}%
\CELL{.85755}\CELL{.85755}\CELL{.85755}\CELL{.65429}\CELL{.65429}%
\CELL{.65429}\CELL{.65429}\CELL{.79348}\CELL{.79348}\CELL{.79348}%
\CELL{.79348}\CELL{.70137}\CELL{.70137}\CELL{.70137}\right] $};linecolor
"black";linestyle 1;linethickness 1;pointstyle "point";xmin "0";xmax
"1";xviewmin "0";xviewmax "1";yviewmin "-0.02";yviewmax
"1.02";rangeset"X";phi 45;theta 45;plottype 4;constrained TRUE;numpoints
49;axesstyle "normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}

This figure can be generated by plotting $\cos x$ and $x$ as usual, then
selecting the matrix 
\[
\left[ 
\begin{array}{cc}
1.0 & 0 \\ 
1.0 & .5403 \\ 
.5403 & .5403 \\ 
.5403 & .85755 \\ 
.85755 & .85755 \\ 
.85755 & .65429 \\ 
.65429 & .65429 \\ 
.65429 & .79348 \\ 
.79348 & .79348 \\ 
.79348 & .70137 \\ 
.70137 & .70137
\end{array}
\right] 
\]
and dragging it to the frame.

\subsubsection{Newton's Method 
\index{Newton's method}\label{Newton's method}}

The iteration method in the previous section can work very slowly. However,
it provides the basis for Newton's method , which is usually much faster
than direct iteration. Newton's method is based on the observation that the
tangent line is a good local approximation to the graph of a function.

Let $\left( x_0,f(x_0)\right) $ be a point on the graph of the function $f$.
The tangent line is given by the equation 
\[
y-f(x_0)=f^{\prime }(x_0)(x-x_0) 
\]
This line crosses the $x$-axis when $y=0$. The corresponding value of $x$ is
given by 
\[
x=x_0-%
\frac{f(x_0)}{f^{\prime }(x_0)} 
\]
In general, given an approximation $x_n$ to a zero of a function $f(x)$, the
tangent line at the point $\left( x_n,f(x_n)\right) $ crosses the $x$-axis
at the point $\left( x_{n+1},0\right) $ where 
\[
x_{n+1}=x_n-\frac{f(x_n)}{f^{\prime }(x_n)} 
\]
Given $x_0$, Newton's method produces a list $x_1$, $x_2$, $\ldots $, $x_n$
of approximations to a zero of $f$.

In the following graph, $f(x)=x-x^3$, $x_0=0.44$, $x_1\approx -0.41$, $%
x_2\approx 0.27$, and $x_3\approx -0.048$.

\FRAME{dtbpFU}{3in}{2.0003in}{0pt}{\Qcb{$x-x^{3}$}}{}{}{\special{language
"Scientific Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth
0pt;display "PICT";function \TEXUX{$x-x^{3}$};linecolor "red";linestyle
1;linethickness 1;pointstyle "point";function
\TEXUX{$\MATRIX{2,8}{c}\VR{,,l,,,}{,,l,,,}{,,,,,}\HR{,,,,,,,,}\CELL{.44}%
\CELL{0}\CELL{.44}\CELL{.\,35482}\CELL{-.41}\CELL{0}\CELL{-.41}\CELL{-.%
\,34108}\CELL{.27}\CELL{0}\CELL{.27}\CELL{.\,25032}\CELL{-.048}\CELL{0}%
\CELL{-.048}\CELL{-4.\,7889\times 10^{-2}}$};linecolor "blue";linestyle
1;linethickness 1;pointstyle "point";xmin "-1";xmax "1";xviewmin
"-1.04";xviewmax "1.041";yviewmin "-0.4003";yviewmax
"0.4006";rangeset"X";phi 45;theta 45;plottype 4;numpoints 49;axesstyle
"normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}

This figure can be generated by plotting $x-x^{3}$ as usual, zooming in to
change the viewing rectangle, then selecting the matrix 
\[
\left[ 
\begin{array}{ll}
.44 & 0 \\ 
.44 & f(.44) \\ 
-.41 & 0 \\ 
-.41 & f(-.41) \\ 
.27 & 0 \\ 
.27 & f(.27) \\ 
-.048 & 0 \\ 
-.048 & f(-.048)
\end{array}
\right] 
\]
and dragging it to the frame.

The \emph{Newton iteration function} for a function $f$ is the function $g$
defined by 
\[
g(x)=x-\frac{f(x)}{f^{\prime }(x)} 
\]

\begin{example}
This example uses Newton's method to solve the same equation $x=\cos x$ as
in the previous example.

\begin{enumerate}
\item[1.]  Define $f$ as the function $f(x)=x-\cos x$.

\item[2.]  Define $g$ as the function $g(x)=x-\frac{f(x)}{f^{\prime }(x)}$.

\item[3.]  From the \textsf{Calculus} menu, choose \textsf{Iterate}.

\item[4.]  In the dialog box, give $g$ as the \textsf{Iteration Function},
enter $.7$ as the \textsf{Initial Value}, and select $5$ as the \textsf{%
Number of Iterations}.
\end{enumerate}

With \textsf{Digits Used in Display} set at $20$, you get the vector of
values shown on the right below. 
\[
\begin{array}{c}
\text{Initial value} \\ 
g(0.7) \\ 
g(g(0.7)) \\ 
g(g(g(0.7))) \\ 
g(g(g(g(0.7)))) \\ 
g(g(g(g(g(0.7)))))
\end{array}
= 
\begin{array}{c}
.7 \\ 
.73943649784805819543 \\ 
.7390851604651073986 \\ 
.73908513321516080562 \\ 
.73908513321516064166 \\ 
.73908513321516064166
\end{array}
\]
These values converge to the display precision in four iterations. As a
check, use \textsf{Evaluate} to verify that 
\[
\cos \left( .73908513321516064166\right) =\allowbreak .73908513321516064165 
\]
\end{example}

\strut

\begin{example}
Make a graph of $y=\cos x$ and $y=x$ to see the approximate solution.$\cos
x,x$\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$\cos x$};linecolor "red";linestyle 1;linethickness
1;pointstyle "point";function \TEXUX{$x$};linecolor "blue";linestyle
1;linethickness 1;pointstyle "point";xmin "-5";xmax "5";xviewmin
"-5";xviewmax "5";yviewmin "-5.2";yviewmax "5.204";rangeset"X";phi 45;theta
45;plottype 4;numpoints 49;axesstyle "normal";xis \TEXUX{x};var1name
\TEXUX{$x$};}}You can observe that there is only one solution, so you do not
need to specify the interval for the solution. Enter the equation $\cos x=x$%
, leave the insertion point in the equation, and from the \textsf{Solve}
submenu, choose \textsf{Numeric}. You receive the response ``Solution is: $%
\left\{ x=.73909\right\} $.''
\end{example}

\strut

\begin{example}
Consider the function $f(x)=x(2-x^{2})$, a function that has zeros at $x=0$, 
$-\sqrt{2}$, and $\sqrt{2}$. Let $g(x)=x-f(x)/f^{\prime }(x)$ be the Newton
iteration function. To see the effect of two iterations of Newton's method,
graph the two functions $f(x)$ and $g(g(x))$.

Change the \textsf{View Intervals} to $-2\leq x\leq 2$ and $-2\leq y\leq 2$.
The graph is nearly flat for $x$ close to one of the three zeros of $f(x)$,
with interesting chaotic behavior in between.$\allowbreak $\FRAME{dtbpF}{3in%
}{2.0003in}{0pt}{}{}{}{\special{language "Scientific Word";type
"MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display "PICT";function
\TEXUX{$\allowbreak x-x\frac{2-x^{2}}{2-3x^{2}}-\left(
x-x\frac{2-x^{2}}{2-3x^{2}}\right) \frac{2-\left(
x-x\frac{2-x^{2}}{2-3x^{2}}\right) ^{2}}{2-3\left(
x-x\frac{2-x^{2}}{2-3x^{2}}\right) ^{2}}$};linecolor "red";linestyle
1;linethickness 2;pointstyle "point";function \TEXUX{$x(2-x^{2})$};linecolor
"blue";linestyle 1;linethickness 1;pointstyle "point";xmin "-2";xmax
"2";xviewmin "-2.08";xviewmax "2.082";yviewmin "-2";yviewmax
"2";viewset"XY";rangeset"X";phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}
\end{example}

\strut

\subsection{\ Optimization\label{Optimization}\label{Extreme values}}

Many of the applications of differentiation involve finding a value of $x$
that yields a local maximum 
\index{Local maximum}\label{Maximum}\label{Local Maximum} or local minimum 
\index{Local minimum}\label{Minimum}\label{Local Minimum} value of some
function $f(x)$. Given the function $f(x)=\cos x+\sin 3x$, a plot suggests
that there are numerous extreme values 
\index{Extreme values}.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$\cos x+\sin 3x$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$\cos x+\sin 3x$};linecolor "blue";linestyle
1;linethickness 1;pointstyle "point";xmin "-5";xmax "5";xviewmin
"-5.2";xviewmax "5.204";yviewmin "-1.954";yviewmax "1.955";rangeset"X";phi
45;theta 45;plottype 4;numpoints 49;axesstyle "normal";xis
\TEXUX{x};var1name \TEXUX{$x$};}}

You can locate these extreme values by finding all values $x$ such that $%
f^{\prime }(x)=0$, since the function $f(x)=\cos x+\sin 3x$ is everywhere
differentiable.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Numeric}
\end{quote}

\begin{quotation}
$f^{\prime }(x)=0$, Solution is : $\left\{ x=2.556254693\right\} $
\end{quotation}

This calculation yields only one critical number, although the graph
indicates many more. Another strategy is to start with an exact method, then
to apply numerical methods to the results.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Exact}
\end{quote}

\begin{quotation}
$f^{\prime }(x)=0$, Solution is : $\left\{ x=2\arctan \left( \rho \right)
\right\} $

where $\rho $ is a root of $2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$
\end{quotation}

With the insertion point in the expression $%
2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$, click \FRAME{itbpF}{0.3001in}{%
0.3001in}{0.0701in}{}{}{2dplot.wmf}{\special{language "Scientific Word";type
"GRAPHIC";maintain-aspect-ratio TRUE;display "PICT";valid_file "F";width
0.3001in;height 0.3001in;depth 0.0701in;original-width
17.8125pt;original-height 16.9375pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename '2dplot.wmf';file-properties "XNPEU";}}. Set the 
\textsf{View Intervals} to $-5\leq x\leq 5$ and $-100\leq y\leq 20 $ for the
following view. The graph of this polynomial shows that there are six real
roots.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$
\end{quotation}

\begin{center}
\FRAME{itbpF}{2.0081in}{1.3353in}{0in}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 2.0081in;height 1.3353in;depth 0in;display
"PICT";function
\TEXUX{$2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$};linecolor
"blue";linestyle 1;linethickness 1;pointstyle "point";xmin "-5";xmax
"5";xviewmin "-5.2";xviewmax "5.204";yviewmin "-2000";yviewmax
"600";viewset"XY";rangeset"X";phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{Z};var1name \TEXUX{$x$};}} \FRAME{itbpF}{%
2.0081in}{1.3353in}{0in}{}{}{}{\special{language "Scientific Word";type
"MAPLEPLOT";width 2.0081in;height 1.3353in;depth 0in;display "PICT";function
\TEXUX{$2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$};linecolor
"red";linestyle 1;linethickness 1;pointstyle "point";xmin "-5";xmax
"5";xviewmin "-5.2";xviewmax "5.204";yviewmin "-20";yviewmax
"20";viewset"XY";rangeset"X";phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{Z};var1name \TEXUX{$x$};}}
\end{center}

With the insertion point in the equation $%
2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}=0$, from the \textsf{Solve}
submenu, choose \textsf{Numeric}. You get the following approximations to
the roots of this sixth-degree polynomial. (For this answer, in the \textsf{%
Settings} box, \textsf{Digits Used in Display} was set at 10.)

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Numeric}
\end{quote}

\begin{quotation}
$2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}=0$,

Solution is : $\left\{ Z=-4.150985601\right\} ,\allowbreak \left\{
Z=-.8933542331\right\} ,\allowbreak \left\{ Z=-.3013217637\right\}
,\allowbreak $

$\left\{ Z=.2409066415\right\} ,\allowbreak \left\{ Z=1.119376797\right\}
,\allowbreak \left\{ Z=3.318711493\right\} $
\end{quotation}

You could obtain the roots of this sixth-degree polynomial equally well by
choosing \textsf{Roots} from the \textsf{Polynomials} submenu. The
corresponding values of $x$ are then given by

\begin{quotation}
$x_{1}=2\arctan (-4.150985601)=\allowbreak -2.668788519$

$x_{2}=2\arctan (-.8933542331)=\allowbreak -1.458262501$

$x_{3}=2\arctan (-.3013217637)=\allowbreak -.5853379603$

$x_{4}=2\arctan \left( .2409066415\right) =\allowbreak .4728041346$

$x_{5}=2\arctan \left( 1.119376797\right) =\allowbreak 1.683330152$

$x_{6}=2\arctan \left( 3.318711493\right) =\allowbreak 2.556254693$
\end{quotation}

Indeed, the absolute minimum $f\left( -2.668788519\right) =\allowbreak
-1.87870685$ occurs at $x_1=-2.668788519$ (and at $x_1+2\pi n$ for any
integer $n$), and the absolute maximum $f\left( \allowbreak
.4728041346\right) =\allowbreak 1.87870685$ occurs at $x_4=\allowbreak
.4728041346$ (and at $x_4+2\pi n$ for any integer $n$).

\label{Find extrema}Extreme values of $\cos x+\sin 3x$ can also be found
directly. From the \textsf{Calculus} submenu, choose \textsf{Find Extrema}
to produce the following.

\begin{quote}
$\blacktriangleright $ \textsf{Find Extrema}
\end{quote}

\begin{quotation}
$\cos x+\sin 3x$ Candidate(s) for extrema: $\allowbreak $ $\max \left( \cos
\left( 2\arctan \left( \rho \right) \right) +\sin \left( 6\arctan \left(
\rho \right) \right) \right) ,$ $\min \left( \cos \left( 2\arctan \left(
\rho \right) \right) +\sin \left( 6\arctan \left( \rho \right) \right)
\right) ,$ at $\left\{ \left\{ x=2\arctan \left( \rho \right) \right\}
\right\} $ where $\rho $ is a root of $%
2Z+4Z^{3}+2Z^{5}-3+45Z^{2}-45Z^{4}+3Z^{6}$
\end{quotation}

The extreme values of $y=x^3-5x+1$ are found similarly.

\begin{quote}
$\blacktriangleright $ \textsf{Find Extrema}
\end{quote}

\begin{quotation}
$x^{3}-5x+1$ Candidate(s) for extrema:

$\left\{ \frac{10}{9}\sqrt{15}+1,-\frac{10}{9}\sqrt{15}+1\right\}
,\allowbreak $ at $\left\{ \left\{ x=\frac{1}{3}\sqrt{15}\right\} ,\left\{
x=-\frac{1}{3}\sqrt{15}\right\} \right\} $
\end{quotation}

Floating-point coefficients produce floating-point approximations. Thus,
applying \textsf{Find Extrema} to $x^{3}-5.0x+1.0$ gives numerical
approximations to the extreme values.

\begin{quote}
$\blacktriangleright $ \textsf{Find Extrema}
\end{quote}

\begin{quotation}
$x^{3}-5.0x+1.0$ Candidate(s) for extrema:

$\left\{ 5.303314829,-3.303314829\right\} ,\allowbreak $ at $\left\{ \left\{
x=-1.290994449\right\} ,\left\{ x=1.290994449\right\} \right\} $
\end{quotation}

Geometrically, the points $\left( -1.290994449,5.303314829\right) $ and $%
\left( 1.290994449,-3.303314829\right) $ represent a high point and a low
point, respectively.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$x^{3}-5x+1$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$x^{3}-5x+1$};linecolor "red";linestyle
1;linethickness 2;pointstyle "point";xmin "-3";xmax "3";xviewmin
"-3.12";xviewmax "3.122";yviewmin "-11.48";yviewmax "13.49";rangeset"X";phi
45;theta 45;plottype 4;numpoints 49;axesstyle "normal";xis
\TEXUX{x};var1name \TEXUX{$x$};}}

\subsection{\ Curve Sketching\label{Curve sketching}}

\textsl{Scientific Notebook} produces 
\index{Curve sketching}excellent function plots, but the default plot may
well obscure some of the subtle detail. For example, let us examine the
graph of the function $f(x)=%
\frac{x^{6}-5x^{3}+10x^{2}-40x}{\left( x^{2}-4\right) ^{2}}$. In the default
plot, the two vertical asymptotes $x=-2$ and $x=2$ are visible, but little
else is.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left( x^{2}-4\right) ^{2}}$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left(
x^{2}-4\right) ^{2}}$};linecolor "maroon";linestyle 1;linethickness
1;pointstyle "point";xmin "-5";xmax "5";xviewmin "-5.2";xviewmax
"5.204";yviewmin "-8.125E16";yviewmax "8.941E17";rangeset"X";phi 45;theta
45;plottype 4;numpoints 49;axesstyle "normal";xis \TEXUX{x};var1name
\TEXUX{$x$};}}

To see more detail, zoom in and experiment with different views such as the
following.\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language
"Scientific Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth
0pt;display "PICT";function \TEXUX{$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left(
x^{2}-4\right) ^{2}}$};linecolor "maroon";linestyle 1;linethickness
1;pointstyle "point";xmin "-5";xmax "5";xviewmin "-5.2";xviewmax
"5.204";yviewmin "-100";yviewmax "100";viewset"XY";rangeset"X";phi 45;theta
45;plottype 4;numpoints 49;axesstyle "normal";xis \TEXUX{x};var1name
\TEXUX{$x$};}}

To locate the relative extreme values, solve $f^{\prime }(x)=0$.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Exact}
\end{quote}

\begin{quotation}
$f^{\prime }(x)=0$, Solution is : $\left\{ x=\rho \right\} $

where $\rho $ is a root of $2Z^{7}-24Z^{5}+5Z^{4}+180Z^{2}-20Z^{3}-80Z+160$
\end{quotation}

You can find approximate real roots of this seventh-degree polynomial with 
\textsf{Numeric} from the \textsf{Solve} submenu.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Numeric}
\end{quote}

\begin{quotation}
$2Z^{7}-24Z^{5}+5Z^{4}+180Z^{2}-20Z^{3}-80Z+160=0$,

Solution is : $\left\{ Z=-3.886400582\right\} ,\allowbreak \left\{
Z=2.235875042\right\} ,\allowbreak \left\{ Z=3.032705128\right\} $
\end{quotation}

These three roots of $f^{\prime }$ give two local minimums; 
\[
f(-3.886400582)=\allowbreak 32.81201997 
\]
and 
\[
f(3.032705128)=\allowbreak 22.55314538 
\]
and one local maximum, 
\[
f(2.235875042)=\allowbreak 29.65559266 
\]

\label{Polynomials divide}You can gain additional insight into this graph by
rewriting $f(x)$ as a polynomial plus a fraction.

\begin{quote}
$\blacktriangleright $ \textsf{Polynomials + Divide}
\end{quote}

\begin{quotation}
$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left( x^{2}-4\right) ^{2}}=\allowbreak
x^{2}+8+\dfrac{-5x^{3}+58x^{2}-40x-128}{\left( x^{2}-4\right) ^{2}}$
\end{quotation}

Select and drag the expression $x^2+8$ to the view to see both curves in the
same picture. Note how well the graph of $y=x^2+8$ matches the graph of $%
y=f(x)$ for large values of $x$.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left( x^{2}-4\right) ^{2}},\allowbreak
x^{2}+8$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$\dfrac{x^{6}-5x^{3}+10x^{2}-40x}{\left(
x^{2}-4\right) ^{2}}$};linecolor "red";linestyle 1;linethickness
1;pointstyle "point";function \TEXUX{$x^{2}+8$};linecolor "blue";linestyle
1;linethickness 1;pointstyle "point";xmin "-10";xmax "10";xviewmin
"-10";xviewmax "10";yviewmin "-100";yviewmax
"100";viewset"XY";rangeset"X";phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}

To locate the intervals where the graph of $f(x)=x^{4}+3x^{3}-x^{2}-3x$ is
concave upward, evaluate $f^{\prime \prime }(x)$ to get $f^{\prime \prime
}(x)=\allowbreak 12x^{2}+18x-2$, and solve the inequality $\allowbreak
12x^{2}+18x-2>0$.

\begin{quote}
$\blacktriangleright $ \textsf{Solve + Exact}
\end{quote}

\begin{quotation}
$12x^{2}+18x-2>0$,

Solution is : $\left\{ x<-\frac{3}{4}-\frac{1}{12}\sqrt{105}\right\}
,\allowbreak \left\{ -\frac{3}{4}+\frac{1}{12}\sqrt{105}<x\right\} $
\end{quotation}

To solve more complicated inequalities or systems of inequalities, you can
set expressions equal to zero and test for sign changes.\smallskip

\begin{example}
You can answer the question of where the graph of $f(x)=\frac{%
x^{6}-5x^{3}+10x^{2}-40x}{\left( x^{2}-4\right) ^{2}}$ is concave upward by
investigating the sign of the second derivative.

\begin{itemize}
\item  \textsf{Evaluate and Simplify} 
\begin{eqnarray*}
f^{\prime \prime }(x) &=&\allowbreak \allowbreak 2\frac{%
-400x^{3}-16x^{6}-1200x+320x^{2}+270x^{4}+160+x^{8}-5x^{5}}{\left(
x^{2}-4\right) ^{4}} \\
&&
\end{eqnarray*}
\end{itemize}

Since the denominator is always nonnegative, it is sufficient to investigate
the sign of the numerator.

\begin{itemize}
\item  \textsf{Solve + Numeric} 
\begin{eqnarray*}
0 &=&-400x^{3}-16x^{6}-1200x+320x^{2}+270x^{4}+160+x^{8}-5x^{5} \\
&&\text{Solution is }\left\{ x=.1375939264\right\} ,\allowbreak \left\{
x=2.341382231\right\}
\end{eqnarray*}

\item  \textsf{Evaluate Numerically} 
\begin{eqnarray*}
f^{\prime \prime }(0) &=&\allowbreak 1.25 \\
f^{\prime \prime }(1) &=&\allowbreak -21.48148148 \\
^{\prime \prime }(2.4) &=&\allowbreak 40.96378321
\end{eqnarray*}
\end{itemize}

Taking into account the vertical asymptotes, the graph is concave upward on
the intervals $(-\infty ,-2),$ $(-2,0.1375939264)$, and $(2.341382231,\infty
)$.\medskip
\end{example}

\subsection{\ Related topics}

\begin{itemize}
\item  \hyperref{Evaluating Calculus Expressions}{}{}{DM7-1.tex#Calculus
expressions}

\item  \hyperref{Limits}{}{}{DM7-2.tex#Limit}

\item  \hyperref{Indefinite Integration}{}{}{DM7-4.tex#Indefinite integral}

\item  \hyperref{Definite Integrals}{}{}{DM7-6.tex#Definite integral}

\item  \hyperref{Exercises and Solutions}{}{}{DM7-9.tex#Exercises}
\end{itemize}

\rule{0.67in}{0.01in}

\hyperref{\FRAME{itbpF}{38.875pt}{24.5pt}{6pt}{}{}{index.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 38.875pt;height 24.5pt;depth
6pt;original-width 36.875pt;original-height 22.5625pt;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename 'index.wmf';file-properties
"XNPEU";}}}{}{}{DMIndex.tex#Math Index}\quad {\small Index entries: 
\hyperref{Derivative}{}{}{DMIndex.tex#Derivative}, \hyperref{Limits}{}{}{%
DMIndex.tex#Limits}, \hyperref{Plotting 2D}{}{}{DMIndex.tex#Plotting 2D}}

\end{document}
