%\documentclass[landscape]{article}
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
%\usepackage{slide-article-tom}
\usepackage[landscape]{slide-article-tom}


\ifx\pdfoutput\undefined
     \usepackage[dvips]{graphicx}
\else
     \usepackage[pdftex]{graphicx}
     \pdfcompresslevel9
\fi

\usepackage[all]{xy}
\setlength{\unitlength}{1cm}

\usepackage{tikz}
\usetikzlibrary{backgrounds,calc}
\usepackage{calc}

\usepackage[titles]{tocloft}

%\setlength{\cftbeforechapskip}{2ex}
\setlength{\cftbeforesecskip}{-2ex}

\usepackage{hyperref}

\hypersetup{colorlinks,
            linkcolor=blue,
            %pdfpagemode=FullScreen
            pdfpagemode=UseNone
            }


%\def\@linkcolor{red}
%\def\@linkcolor{blue}
%\def\@anchorcolor{black}
%\def\@citecolor{red}
%\def\@filecolor{cyan}
%\def\@urlcolor{magenta}
%\def\@menucolor{red}
%\def\@pagecolor{red}


\def\pagedone{\newpage}

\def\tthdump#1{#1}

%% \tthdump{\def\sectionhead#1{\begin{center}{\LARGE\hypertarget{#1}
%%      {#1}\hyperlink{Our general topics:}{\hfil$\leftarrow$}}\end{center}}}
%%      
%% %%tth:\def\sectionhead#1{{\LARGE#1\hypertarget{#1}{#1}}
%% %%tth:     \special{html: <A NAME="#1"></A><a href="\#Top of file">       Top</a>}}

%% \def\sectionhead#1{\section{#1}\hyperlink{Contents}{\hfil$\leftarrow$}}
%% \def\sectionhead#1{\section*{#1}\addcontentsline{toc}{section}{#1}\hyperlink{Contents}{$\leftarrow$}}

\tthdump{\def\sectionhead#1{\begin{center}\section*{#1 \hyperlink{Contents}{\hfil$\leftarrow$}}
             \end{center}
     \addcontentsline{toc}{section}{#1}
     \vspace{-\baselineskip}
     }}

%%tth:\def\sectionhead#1{\begin{center}\section{#1}\end{center}
%%tth:     {\special{html: <a href="\#Top of file">       <--</a>}}}

%% %%tth:     \addcontentsline{toc}{section}{#1}}

\tthdump{\def\exercises#1{\begin{center}\subsection*{#1 -~exercises
            \hyperlink{Contents}{\hfil$\leftarrow$}}\end{center}
%     \addcontentsline{toc}{subsection}{#1 (ex)}
     \vspace{-\baselineskip}
     }}
     
%%tth:\def\exercises#1{\begin{center}\subsection{#1 -~exercises}\end{center}
%%tth:     {\special{html: <a href="\#Top of file">       <--</a>}}}

     
%% \tthdump{\def\exercises#1{\begin{center}{\LARGE Exercises: \hypertarget{#1.ex}
%%      {#1}\hyperlink{Contents}{\hfil$\leftarrow$}}\end{center}}}
%%      
%% %%tth:\def\exercises#1{{\LARGE Exercises: #1\hypertarget{#1.ex}{#1.ex}}
%% %%tth:     \special{html: <A NAME="#1.ex"></A><a href="\#Top of file">       Top</a>}}

\tthdump{\def\quotesection#1{\begin{center}{\LARGE\hypertarget{#1}
     {#1}\hyperlink{The quotes}{\hfil$\twoheadleftarrow$}}\end{center}}}
     
%%tth:\def\quotesection#1{{\LARGE#1\hypertarget{#1}{#1}}
%%tth:     \special{html: <A NAME="#1"></A><a href="\#The quotes">       <-</a>}}

%%tth:\def\makehyperlink#1{\special{html: <a href="\##1">}{\large#1}\special{html: </a>}}

%%tth:\def\makehyperlinkex#1{\ \ \special{html: <a href="\##1">}{\large (ex)}\special{html: </a>}}

%%tth:\def\binom#1#2{\left(\begin{array}{c}#1\\#2\end{array}\right)}

\tthdump{\def\httimes{\times}}
%%tth:\def\httimes{x\ }

\tthdump{\def\mybigtriangledown{\bigtriangledown}}
%%tth:\def\mybigtriangledown{\mathrm{Del}}

\tthdump{\def\htvec#1{\vec{#1}}}
%%tth:\def\htvec#1{{\bf #1}}

\def\myspan{\mathrm{span}}
\def\matrix{\mathrm{matrix}}

\tthdump{\def\myreal{\mathbb{R}}}
%%tth:\def\myreal{\mathbf{R}}
%%\def\myreal{\Re}
\tthdump{\def\mycomplex{\mathbb{C}}}
%%tth:\def\mycomplex{\mathbf{C}}
\tthdump{\def\myfield{\mathbb{F}}}
%%tth:\def\myfield{\mathbf{F}}
\tthdump{\def\myquaternions{\mathbb{H}}}
%%tth:\def\myquaternions{\mathbf{H}}
\tthdump{\def\myrationals{\mathbb{Q}}}
%%tth:\def\myrationals{\mathbf{Q}}
\tthdump{\def\myintegers{\mathbb{Z}}}
%%tth:\def\myintegers{\mathbf{Z}}

%\def\dim\mathrm{dim}
\def\im{\mathrm{im}}
\def\deriv{\mathrm{D}}
\def\trace{\mathrm{trace}}
\def\detm{\mathrm{det}_m}
\def\detv{\mathrm{det}_v}
\def\perm{\mathrm{perm}}
\def\sign{\mathrm{sign}}

% kets and bras etc.
\def\ket#1{|{#1}\rangle}
\def\bra#1{\langle{#1}|}
\def\braket#1#2{\langle{#1}|{#2}\rangle}

%\def\sectionhead#1{\begin{center}{\LARGE #1}\end{center}}
%\def\sectionhead#1{\section{#1}}

% defines a 2 element column vector.
\def\col#1#2{\left(\begin{array}{c}#1\\#2\end{array}\right)}
\def\tcol#1#2{(#1, #2)^T}


\begin{document}
\raggedright
%%tth:\special{html: <A NAME="Top of file"></A>}


\pagestyle{myfooters}
%\pagestyle{plain}

\thispagestyle{empty}


%%tth:\special{html:<title> Nonlinear Systems (and chaos)</title>}

%Slide 1
\title{{\LARGE\bf Nonlinear Systems}\newline
              (\ldots and chaos) \newline
                a brief introduction
\newline
}
\author{Tom Carter \newline
\newline
Computer Science\newline
CSU Stanislaus
\vfill
\tthdump{\href
{http://csustan.csustan.edu/\~tom/Nonlinear-Systems}{http://csustan.csustan.edu/\~\ tom/Nonlinear-Systems}}
%%tth:\href{http://csustan.csustan.edu/~tom/Nonlinear-Systems}{http://csustan.csustan.edu/\~tom/Nonlinear-Systems}
}


%\date{Fall, 2011}
\date{\today}


\maketitle

%Slide 2
%% \sectionhead{Our general topics:}
%% %%tth:\begin{itemize}
%% %%tth:\item
%% \tthdump{\hyperlink{Why differentiable manifolds}
%%                {\ $\circledcirc$ Why differentiable manifolds\newline}}
%% %%tth:\makehyperlink{Why differentiable manifolds}
%% %%tth:\item
%% \tthdump{\hyperlink{References}
%% 	        {$\circledcirc$ References\newline}} 
%% %%tth:\makehyperlink{References}
%% %%tth:\end{itemize}
%% 
%% (ex):  exercises.
%% 
%% \pagedone

\tthdump{\renewcommand\contentsname{Our general topics:\hypertarget{Contents}{}}}
%% \newcommand\listfigurename{List of Figures}
%% \newcommand\listtablename{List of Tables}

\tableofcontents

\pagedone




\sectionhead{What are nonlinear systems?}
%% %%tth:\section{What are nonlinear systems?}

\begin{itemize}
       \item Let's start by adding another word to this, and ask the question, "What are nonlinear dynamical systems?" (and we'll go
         back to front \ldots)
         
         A reasonable thing to say is that a {\em system} is a collection of entities that we can treat (for some purpose, in
         some context) as a unity of interacting parts or elements.  At various times we will treat various collections of
         entities as systems, or subsystems.  We may at times ignore certain elements that might otherwise be included.
         There will also often be times when we will engage in abstraction, and refer to a ``system'' when we are actually discussing,
         manipulating, or analyzing an abstraction from the real (physical) system we are interested in.
         
         A {\em dynamical} system is one which changes over time.  It is generally not unreasonable to assume that there is
         some form of energy flow involved in such a system.
         
         A {\em nonlinear} dynamical system is, as the name implies, a system whose best description (behavior) is not
         {\em linear}.  There are various contexts and forms of description for the concept {\em linear}.  We'll look at various
         examples as we go along.

 \pagedone
       
\sectionhead{A Linear Example (string)}
%% %%tth:\section{A Specific Example (vibrating string)}
     \begin{center}(a little string theory :-)\end{center}
       \item It will be worth our while to have some very specific examples available, so let's start with this one -- 
          consider a string stretched tightly between two fixed endpoints:
            
             \vspace{0.5cm}
             \begin{center}
              \begin{tikzpicture}[line width=2.5pt]
                   \draw (-6,0) -- (6,0);
                   \draw(-6,-0.3) -- (-6,0.3);
                   \draw(6,-0.3) -- (6,0.3);
             \end{tikzpicture}
              \end{center}
              
%	      \centerline{\includegraphics[width = 6in]{string-zero}}
	      	      
	    We can pull the center of the string up:
	    
	     \vspace{0.5cm}
              \begin{center}
                   \begin{tikzpicture}[line width=2.5pt]
                        \draw (-6,0) -- (0,1);
                        \draw (0,1) -- (6,0);
                        \draw(-6,-0.3) -- (-6,0.3);
                        \draw(6,-0.3) -- (6,0.3);
                        \draw[color=gray, thin](-6,0) -- (6,0);
                  \end{tikzpicture}
              \end{center}
              
%	      \centerline{\includegraphics[width = 6in]{string-up}}
	      
	      At the moment we release it, there will be forces acting on the string.  Let's focus our attention on the
	      center point of the string (where we had taken hold of it to pull it up).  There will be forces pulling toward
	      the two fixed ends:
	      
	      \vspace{0.5cm}
	      \begin{center}
                   \begin{tikzpicture}[line width=2.5pt]
                        \draw (-6,0) -- (0,1);
                        \draw (0,1) -- (6,0);
                        \draw(-6,-0.3) -- (-6,0.3);
                        \draw(6,-0.3) -- (6,0.3);
                        \draw[color=gray, thin](-6,0) -- (6,0);
                        \draw[->](-0.1, 1.5) -> (-2.1,1.1);
                        \draw[->](0.1, 1.5) -> (2.1,1.1);
                  \end{tikzpicture}
              \end{center}
              
%	      \centerline{\includegraphics[width = 6in]{string-forces}}
	      
	      There will be a ``net'' force acting on the center point of the string:
	      
	       \vspace{0.5cm}
	       \begin{center}
                   \begin{tikzpicture}[line width=2.5pt]
                        \draw (-6,0) -- (0,1);
                        \draw (0,1) -- (6,0);
                        \draw(-6,-0.3) -- (-6,0.3);
                        \draw(6,-0.3) -- (6,0.3);
                        \draw[color=gray, thin](-6,0) -- (6,0);
                        \draw[->](0, 0.9) -> (0,0.3);
                  \end{tikzpicture}
              \end{center}
              
%	      \centerline{\includegraphics[width = 6in]{string-force-net}}

               Now let's put a ``reference frame'' on the system, so we can make things more explicit.

\pagedone
 	      
	        We will measure
	      the vertical displacement of the center point of the string relative to the ``resting position,'' with positive
	      up and negative down:
	      
	       \vspace{0.5cm}
	        \begin{center}
                   \begin{tikzpicture}[line width=2.5pt]
                        \draw (-6,0) -- (0,1);
                        \draw (0,1) -- (6,0);
                        \draw(-6,-0.3) -- (-6,0.3);
                        \draw(6,-0.3) -- (6,0.3);
                        \draw[color=gray, thin](-6,0) -- (6,0);
                        \draw[->](0, 0.9) -- (0,0.3);
                        \draw[<->](6.75,-3) -- (6.75, 3);
                        \draw(6.6,0) -- (6.9,0);
                        \draw(7.5,0) node {0};
                        \draw(7.3,2) node {+};
                        \draw(7.3,-2) node {--};
                        \draw(7.7,3) node {x};
                        
                  \end{tikzpicture}
              \end{center}
              
%	      \centerline{\includegraphics[width = 7.5in]{string-ref-frame}}
	      
	      At this point we'll make a set of simplifying assumptions, and in particular treat this as a {\em linear} system
	      (in a sense to be made more explicit below).

 \pagedone
 
      \item  Among the assumptions we'll make are:
      
        \begin{itemize}
             \item Everything is nicely symmetric (in particular, the force is exactly vertical).
             \item The force is very simple (no complications from friction, etc.).
             \item The force changes {\em linearly} with the displacement of the center point  of the string.
             \item The motion is always continuous and smooth (differentiable), and thus, also,
             \item Newtonian mechanics (and all that that entails, including all the machinery of the calculus \ldots)
        \end{itemize} 
        
\pagedone

      \item Now we'll set this up as a (Newtonian) differential system.  The (vertical) displacement of the center point
           of the string will be denoted by $x$ (which we will recall is actually a function of time $t$, but we will generally
           simplify the notation as $x$ rather than $x(t)$).  We will (often) denote the derivative of a function with respect
           to time as 
                $$\dot{x} = \frac{d x(t)}{d t}$$
           and the second derivative as
                $$\ddot{x} =   \frac{d^2 x(t)}{d t^2}.$$
           As appropriate, we will refer to velocity and acceleration as
                $$ v = \dot{x}$$
            and
                 $$ a = \dot{v} = \ddot{x}.$$
                 
            For the time being, we will assume a very simple form for the force on the center point:
                 $$ F = - x$$
            (Note:  these should really be vectors $\vec{F} = -\vec{x}$, but we'll keep the notation simple for now \ldots).
            This is the place at which we are doing a {\em linear} approximation, and thus are working with a {\em linear
            dynamical system}.
            
            Now we invoke Newton, and his fundamental equation of motion:
                 $$ F = m a$$
            (and we'll use units where $m = 1$, and thus write $F = a$).
 \pagedone
       \item Putting the pieces together, our system is given by the linear ordinary differential equation:
                 $$ a = F = - x$$
            or
                 $$ \ddot{x} = - x$$
            or
                 $$ \ddot{x} + x = 0.$$
            
            We can use the standard machinery of calculus to solve this differential equation.
            
 \pagedone
 
           The characteristic polynomial of this differential equation is
                $$ z^2 + 1 = (z + i)(z - i)$$
           with roots $z = i$ and $z = - i$.  Hence the general form of the solution is
                $$ x = x(t) = b_0 e^{it} + b_1 e^{-i t}.$$
           Now we can remember (use) the definition
                $$e^x = \sum_{n = 0}^\infty \frac{x^n}{n!},$$
           from which we get
           \begin{equation*}
                 \begin{split}
                     e^{it} & =  \sum_{n = 0}^\infty \frac{(it)^n}{n!} \\
                              & =  1 + it - \frac{t^2}{2!} - i \frac{t^3}{3!} + \frac{t^4}{4!} + \cdots \\
                              & =  1 - \frac{t^2}{2!} + \frac{t^4}{4!} - \cdots \\
                              & \quad \  \ + it - i \frac{t^3}{3!} + i \frac{t^5}{5!} - \cdots \\
                              & =  \sum_{n = 0}^\infty (-1)^n \frac{t^{(2n)}}{(2n)!} + i \sum_{n = 0}^\infty (-1)^n \frac{t^{(2n+1)}}{(2n+1)!} \\
                              & =  \cos{(t)} + i \sin{(t)}.
                \end{split}
          \end{equation*}
          Then, using some standard techniques (and observing that $\cos{(t)}$ and $\sin{(t)}$ are linearly independent),
          we find that the general solution to our system can be written as:
               $$ x(t) = c_0 \cos{(t)} + c_1 \sin{(t)}.$$
               
          Of course, if we didn't want to be reminded of the general method of solving linear ordinary differential equations,
          or the definition of the exponential function, or
          Euler's formula ($ e^{it} = \cos{(t)} + i \sin{(t)}$), we could have just observed that
               $$ \frac{d^2\cos{(t)}}{dt^2} = - \cos{(t)} $$
          and
               $$ \frac{d^2\sin{(t)}}{dt^2} = - \sin{(t)} $$
          and gone straight to our general solution :-)
          
\pagedone

     \item There is another nice way to represent such a second order ordinary differential equation, as a
          system of first order differential equations.
          
          In this example, we start with the equation
               $$ \ddot{x} + x = 0, $$
          then introduce a new variable $v = \dot{x}$ (which we have seen before -- the velocity), and then
          express things as a system:
          \begin{align*}
              \dot{x} & =  v \\
              \dot{v} & =  -x
          \end{align*}
          
          This is a very general approach, which can also be applied to $n$th order equations, resulting in a system
          $n$ first order equations.
          
\pagedone
          
          We can then rewrite the system in vector/matrix notation:  
               $$\begin{bmatrix} \dot{x} \\ \dot{v}  \end{bmatrix}
                           = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}
                              \begin{bmatrix} x \\ v  \end{bmatrix}
               $$
          (note the convenient use of column notation for vectors).
          
          Changing notation slightly, to simply extension to $n$th order:
               $$\begin{bmatrix} \dot{x_1} \\ \dot{x_2}  \end{bmatrix}
                           = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}
                              \begin{bmatrix} x_1 \\ x_2  \end{bmatrix}
               $$
          and, writing $\mathbf{x}$ for $ \begin{bmatrix} x_1 \\ x_2  \end{bmatrix}$, 
          $\mathbf{\dot{x}}$ for $ \begin{bmatrix} \dot{x_1} \\ \dot{x_2}  \end{bmatrix}$, and
          $\mathbf{A}$ for $\begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}$, we can write
          $$\mathbf{\dot{x}} = \mathbf{A} \mathbf{x}.$$

\pagedone

          Generalizing to $n$th order, writing $\mathbf{x}$ for $\begin{bmatrix} x_1 \\ \vdots \\ x_n  \end{bmatrix} $, etc.,
          and also allowing a constant $b_i$ to be added to each row, we have a system
          $$\mathbf{\dot{x}} = \mathbf{A} \mathbf{x} + \mathbf{b}.$$
          
          In this form, it is easy to see that these are {\em linear} systems.  There is a well developed theory for solving
          such systems (using eigenvalues/eigenvectors, etc.), and even for generalizations where $\mathbf{A}$ and
          $\mathbf{b}$ can be time dependent:
          $$\mathbf{\dot{x}} = \mathbf{A}(t) \mathbf{x} + \mathbf{b}(t).$$
          Discussion of this is available in various places, such as here:
          \tthdump{\href{http://www.unf.edu/\~mzhan/chapter4.pdf}{http://www.unf.edu/\~\ mzhan/chapter4.pdf}}.

 \pagedone
 
      \item For future reference, here is an example of what a {\em nonlinear} system would like in this sort of notation
           (of course, the right hand sides won't be linear, and hence we won't get the nice simple matrix representation).
           
           These are the (famous) {\em Lorenz equations}, which give rise to the {\em Lorenz attractor}: 
           \begin{align*}
                \dot{x} & =  \sigma (y - x) \\
                \dot{y} & =  x (\rho - z) - y \\
                \dot{z} & =  xy - \beta z
           \end{align*}
           where $\sigma$ is the {\em Prandtl number}, $\rho$ is the {\em Rayleigh number}, and $\beta$ is another adjustable
           parameter.  All of $\sigma$, $\rho$, and $\beta$ are positive, with typical values $\sigma = 10$, $\beta = 8 / 3$, and
           $\rho$ is varied.  When $\rho$ = 28, the system exhibits chaotic behavior.  You can see the nonlinear (mixed) terms
           in the second and third equations (the $xz$ and $xy$ terms).
           
 \pagedone
 
      \item  Let's go back to our string example (i.e., our simple harmonic oscillator).  For ease of reading, let's also go
           back to our notation of position $x$ and velocity $v$, or, when we want to clarify the time dependence, $x(t)$
           and $v(t)$:
           \begin{align*}
                \dot{x} & =  v     &  \dot{x}(t) & =  v(t) \\
                \dot{v} & =  - x   &  \dot{v}(t) & =  -x(t) \\
           \end{align*}
           The simplest solution to this system is $x(t) = \cos{(t)}$ (and, of course, $v(t) = - \sin{(t)}$).
           We can visualize the behavior of the system by plotting $x(t)$:
           
           \begin{center}
                \begin{tikzpicture}[scale=3, line width=2pt]
                     \draw[->](0,0) -- (5,0);
                     \draw(5.1,0) node {$t$};
                     \draw[->](0,-0.75) -- (0,0.75);
                     \draw(-0.2,0.4) node {$x$};
                     \draw[x=1.57ex,y=1ex] (0,1)
                          cos (1,0) sin (2,-1) cos (3,0) sin (4,1) cos(5, 0) sin(6,-1) cos(7,0) sin(8,1);
                     \draw[->](0,-0.75) -- (0,0.75);
                \end{tikzpicture}
           \end{center}
           
%           \begin{picture}(20, 5.5)
%                \thicklines
%                \put(0,2.5){\vector(1,0){19.9}}
%                \put(1,0){\vector(0,1){5.5}}
%                \put(20.2,2.4){$t$}
%                \put(0,4.6){$x$}
%                \qbezier(1,5)(3,5)(5,2.5)
%                \qbezier(5,2.5)(7,0)(9,0)
%                \qbezier(9,0)(11,0)(13,2.5)
%                \qbezier(13,2.5)(15,5)(17,5)
%           \end{picture}
 \pagedone
           We can also try plotting both $x(t)$ and $v(t)$ on the same graph:
           
           \begin{center}
                \begin{tikzpicture}[scale=3, line width=1.75pt]
                     \draw[->](0,0) -- (5,0);
                     \draw(5.1,0) node {$t$};
                     \draw[->](0,-0.75) -- (0,0.75);
                       \draw[color=blue](-0.2, 0.4) node {$x$};
                     \draw[color=red](-0.2, 0) node {$v$};
                     \draw[color=blue,x=1.57ex,y=1ex]
                          (0,1) cos (1,0) sin (2,-1) cos (3,0) sin (4,1) cos(5, 0) sin(6,-1) cos(7,0) sin(8,1);
                     \draw[color=red,x=1.57ex,y=1ex]
                          (0,0) sin (1,-1) cos (2,0) sin (3,1) cos (4,0) sin(5,-1) cos(6, 0) sin(7, 1) cos(8,0);
                     \draw[color=blue](-0.2, 0.4) node {$x$};
                     \draw[color=red](-0.2, 0) node {$v$};
                \end{tikzpicture}
           \end{center}
           
%           \begin{picture}(20, 5.5)
%                \thicklines
%                \put(0,2.5){\vector(1,0){19.9}}
%                \put(1,0){\vector(0,1){5.4}}
%                \put(20.2,2.4){$t$}
%                \put(0,4.6){$x$}
%                \put(0,3){$v$}
%                \qbezier(1,5)(3,5)(5,2.5)
%                \qbezier(5,2.5)(7,0)(9,0)
%                \qbezier(9,0)(11,0)(13,2.5)
%                \qbezier(13,2.5)(15,5)(17,5)
%                
%                \qbezier(1,2.5)(3,5)(5,5)
%                \qbezier(5,5)(7,5)(9,2.5)
%                 \qbezier(9,2.5)(11,0)(13,0)
%                \qbezier(13,0)(15,0)(17,2.5)
%           \end{picture}
           
           Before long, this can get fairly messy.  We would like better ways to visualize the system.
           
           One important point is that this is a fully deterministic system, and the state of the system is completely
           specified once we know $x$ and $v$.  We can thus visualize the system in {\em state space}
           (also called {\em phase space}), with one dimension for each variable.  Each point in phase space
           represents the state of the system at a particular time, and over time the system will trace a {\em trajectory}
           through phase space.
           
           For our simple harmonic oscillator, the phase space trajectory takes a particularly nice form:
           
           \begin{center}
                \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=blue, ->] (-5,0) -- (5,0);
                     \draw[color=blue](5.4,0) node{$x$};
                     \draw[color=red, ->](0,-4) -- (0,4);
                     \draw[color=red](0,4.4) node{$v$};
                     \draw[color=purple] (0,0) circle (3cm);
                     \draw(4.7,3)node{$\begin{bmatrix} \textcolor{blue}{x(t)} \\ \textcolor{red}{v(t)}  \end{bmatrix}$};
                     \draw [->] (3.6,3) arc (90:150:1.7cm);
                     \draw(5.2,-2)node{$\begin{bmatrix} \textcolor{blue}{x(0)} \\ \textcolor{red}{v(0)}  \end{bmatrix}$};
                     \draw [->] (3.8,-1.8) -- (3.1,-0.1);
                \end{tikzpicture}
           \end{center}
           
 \pagedone

      \item We can also think about the vector field consisting of the derivatives.  Associated with each
           point in phase space, there is the vector of the velocity/acceleration values.  At
           the point $\begin{bmatrix} \textcolor{blue}{x(t)} \\ \textcolor{red}{v(t)}  \end{bmatrix}$ there is
           the derivative vector $\begin{bmatrix} {v(t)} \\ {-x(t)}  \end{bmatrix}$:
          \begin{center}
                \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=blue, ->] (-6,0) -- (6,0);
                     \draw[color=blue](6.4,0) node{$x$};
                     \draw[color=red, ->](0,-4) -- (0,4);
                     \draw[color=red](0,4.4) node{$v$};
                     \foreach \x in {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}
                         \foreach \y in {-3, -2, -1, 0, 1, 2, 3}
                               \pgfmathsetmacro{\u } { (\x + \y / 5) }
                               \pgfmathsetmacro{\v}{ \y + (-1) * (\x / 5) }
                               \draw[->](\x, \y) -- (\u, \v);
                \end{tikzpicture}
           \end{center}
\pagedone

          For a given trajectory in phase space, the derivative vectors along the trajectory will be tangent to
          the trajectory at each point:
           \begin{center}
                \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=blue, ->] (-5,0) -- (5,0);
                     \draw[color=blue](5.4,0) node{$x$};
                     \draw[color=red, ->](0,-4) -- (0,4);
                     \draw[color=red](0,4.6) node{$v$};
                     \draw[color=purple] (0,0) circle (3cm);
                     \draw [->] (3,0) -- (3, -3);
                     \draw [->] (2.12, -2.12) -- (0, -4.24);
                     \draw [->] (0, -3) -- (-3, -3);
                     \draw [->] (-2.12, -2.12) -- (-4.24,0);
                      \draw [->] (-3, 0) -- (-3,3);
                      \draw [->] (-2.12, 2.12) -- (0, 4.24);
                      \draw [->] (0, 3) -- (3, 3);
                       \draw [->] (2.12, 2.12) -- (4.24, 0);
                \end{tikzpicture}
           \end{center}
           
\pagedone

          We can even use this to find (at least an approximation to) a trajectory, given an initial point (initial
          condition) in phase space.  The basic idea comes from the definition of the derivative:
          $$ \frac{df(t)}{dt} = \lim_{\Delta t \to 0} \frac{f(t + \Delta t) - f(t)}{\Delta t} $$
          which means that, for small $\Delta t$, we have the approximation
          $$ \frac{df(t)}{dt} \approx \frac{f(t + \Delta t) - f(t)}{\Delta t} $$
          or,
          $$ \frac{df(t)}{dt} * \Delta t \approx f(t + \Delta t) - f(t) $$
          and thus the approximation
          $$ f(t + \Delta t) \approx f(t) + \frac{df(t)}{dt} * \Delta t .$$
          
\pagedone

          In the case of our simple harmonic oscillator, we have the approximation
          \begin{align*}
               \begin{bmatrix} x(t + \Delta t) \\ v(t + \Delta t) \end{bmatrix} & = \begin{bmatrix} x(t) \\ y(t)  \end{bmatrix}
                          + \begin{bmatrix} \dot{x}(t) * \Delta t \\ \dot{v}(t) * \Delta t  \end{bmatrix}  \\
                          & = \begin{bmatrix} x(t) \\ y(t)  \end{bmatrix}
                          + \begin{bmatrix} v(t) * \Delta t \\ -x(t) * \Delta t  \end{bmatrix}.
           \end{align*}
           
           Working with our particular system, let's do a couple of steps, starting at $t = 0$, and with $\Delta t = 0.1$.
           We will have $\begin{bmatrix} x(0) \\ y(0)  \end{bmatrix} = \begin{bmatrix} 1 \\ 0  \end{bmatrix}$, and
           $\begin{bmatrix} \dot{x}(0) \\ \dot{v}(0) \end{bmatrix} = \begin{bmatrix} 0 \\ -1 \end{bmatrix} $.
           Our first step of approximation will give us
           \begin{align*}
               \begin{bmatrix} x(0.1) \\ v(0.1) \end{bmatrix} & \approx \begin{bmatrix} 1 \\ 0  \end{bmatrix}
                          + \begin{bmatrix} 0 * 0.1 \\ -1 * 0.1 \end{bmatrix}  \\
                          & = \begin{bmatrix} 1 \\  -0.1  \end{bmatrix}.
           \end{align*}
           
\pagedone

          The next three steps of our approximation will be:
          \begin{align*}
               \begin{bmatrix} x(0.2) \\ v(0.2) \end{bmatrix} & \approx \begin{bmatrix} 1 \\ -0.1  \end{bmatrix}
                          + \begin{bmatrix} -0.1 * 0.1 \\ -1 * 0.1 \end{bmatrix}  \\
                          & = \begin{bmatrix} 0.99 \\  -0.2  \end{bmatrix}.
           \end{align*}
           and
           \begin{align*}
               \begin{bmatrix} x(0.3) \\ v(0.3) \end{bmatrix} & \approx \begin{bmatrix} 0.99 \\ -0.2  \end{bmatrix}
                          + \begin{bmatrix} -0.2 * 0.1 \\ -0.99 * 0.1 \end{bmatrix}  \\
                          & = \begin{bmatrix} 0.97 \\  -0.299  \end{bmatrix}
           \end{align*}
           and
           \begin{align*}
               \begin{bmatrix} x(0.4) \\ v(0.4) \end{bmatrix} & \approx \begin{bmatrix} 0.97 \\ -0.299 \end{bmatrix}
                          + \begin{bmatrix} -0.299 * 0.1 \\ -0.97 * 0.1 \end{bmatrix}  \\
                          & = \begin{bmatrix} 0.9401 \\  -0.396  \end{bmatrix}
           \end{align*}
           This will look like (I have gone ahead and added several more steps):
            \begin{center}
                \vspace{-1.0cm}
                \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=blue, ->] (-6,0) -- (6,0);
                     \draw[color=blue](6.4,0) node{$x$};
                     \draw[color=red, ->](0,-5) -- (0,5);
                     \draw[color=red](0,5.4) node{$v$};
                     \draw[color=purple] (0,0) circle (3cm);
                     \pgfmathsetmacro{\x} {1}
                     \pgfmathsetmacro{\v} {0}
                     \pgfmathsetmacro{\u} {\x + 0.1 * \v }
                     \pgfmathsetmacro{\w} {\v + 0.1 * (-1) * \x }
                      \foreach \i in {0,1,...,100} {
                              \draw[color=purple,->](3 * \x, 3 * \v) -- (3 * \u, 3 * \w);
                              \pgfmathparse{\u}
                              \xdef\x{\pgfmathresult}
                              \pgfmathparse{\w}
                              \xdef\v{\pgfmathresult}
                              \pgfmathparse{\x + 0.1 * \v }
                              \xdef\u{\pgfmathresult}
                              \pgfmathparse{\v + 0.1 * (-1) * \x }
                              \xdef\w{\pgfmathresult}
                        }
                \end{tikzpicture}
           \end{center}
           The approximation starts out doing a reasonable job (but over time it does drift away from
           the real trajectory \ldots).
%           \begin{center}
%                \begin{tikzpicture}[line width=1.75pt, color=purple]
%                     \draw[color=blue, ->] (-5,0) -- (5,0);
%                     \draw[color=blue](5.4,0) node{$x$};
%                     \draw[color=red, ->](0,-4) -- (0,4);
%                     \draw[color=red](0,4.6) node{$v$};
%                     \draw [->] (3,0) -- (3, -0.3);
%                     \draw [->] (3, -0.3) -- (2.97, -0.6);
%                     \draw [->] (2.97, -0.6) -- (2.91, -0.897);
%                      \draw [->] (2.91, -0.897) -- (2.8203, -1.188);
%                      \draw [->] (2.8203, -1.188) -- (2.7015, -1.47003);
%                      \draw [->] (2.7015, -1.47003) -- (2.554497, -1.74018);
%                      \draw [->] (2.554497, -1.74018) -- (2.380479, -1.9956297);
%                      \draw [->] (2.380479, -1.9956297) -- (2.18091603, -2.2336776);
%                      \draw [->] (2.18091603, -2.2336776) -- (1.95754827, -2.451769203);
%                      \draw [->] (1.95754827, -2.451769203) -- (1.7123713497, -2.64752403);
%                      \draw [->] (1.7123713497, -2.64752403) -- (1.4476189467, -2.81876116497);
%                      \draw [->] (1.4476189467, -2.81876116497) -- (1.165742830203, -2.96352305964);
%                      \draw [->] (1.165742830203, -2.96352305964) -- (0.869390524239, -3.0800973426603);
%                      \draw [->] (0.869390524239, -3.0800973426603) -- (0.56138078997297, -3.1670363950842);
%                      \draw [->] (0.56138078997297, -3.1670363950842) -- (0.24467715046455, -3.2231744740815);
%                      \draw [->] (0.24467715046455,-3.2231744740815) -- (-0.0776402969436001, -3.24764218912795);
%                      \draw [->] (-0.0776402969436001,-3.24764218912795) -- (-0.402404515856395, -3.23987815943359);
%                      \draw [->] (-0.402404515856395,-3.23987815943359) -- (-0.726392331799754, -3.19963770784795);
%                      \draw [->] (-0.726392331799754,-3.19963770784795) -- (-1.04635610258455, -3.12699847466798);
%                      \draw (0,0) circle (3cm);
%                \end{tikzpicture}
%           \end{center}
           
\pagedone

     \item  We'll keep in mind this approximation approach, and come back to it later.  In particular, we'll need
          to think some about what cautions we should keep in mind when using approximations.  But, let's
          briefly return now to the thrilling days of yesteryear, and do a little bit more with linear systems.
          
          Our linear approximation of the string system clearly leaves out a bunch of stuff.  In particular, we know
          perfectly well that a vibrating string won't go on vibrating forever.  Things like friction (both internal within
          the string itself, and external, like air resistance) will play a role in the dynamics.  We can improve our
          system by adding a friction term.  In keeping with our simplification of linearity, a reasonable approximation
          of the friction term is that it depends linearly on velocity.  Keeping terms and constants simple, we can
          learn a reasonable amount by studying this system (the second term in the $\dot{v}$ line is friction):
            \begin{align*}
                \begin{bmatrix} \dot{x} \\ \dot{v}  \end{bmatrix}
                          &  =  \begin{bmatrix} v \\ -x - bv  \end{bmatrix}.
           \end{align*}
           Using the ``characteristic polynomial'' approach, we can look at
           $ \ddot{x} = -x - b\dot{x}$
           or
           $ \ddot{x} + b\dot{x} + x = 0$,
           and thus work with
           $$r^2 + br + 1 = 0$$
           giving us
           $$r = \frac{-b \pm \sqrt{b^2 - 4}}{2}$$
           or, assuming $| b | < 2$,
           $$r = -\frac{b}{2} \pm i \frac{\sqrt{4 - b^2}}{2}$$.
\pagedone
          From this, we get a solution to the system in the form
          \begin{align*}
               x(t) &= e^{(-\frac{b}{2} + i \frac{\sqrt{4-b^2}}{2})t} + e^{(-\frac{b}{2} - i \frac{\sqrt{4-b^2}}{2})t}\\
                     &= e^{-\frac{b}{2}t}\left( e^{i \frac{\sqrt{4-b^2}}{2}t} + e^{-i \frac{\sqrt{4-b^2}}{2}t}\right) \\
                     &= e^{-\frac{b}{2}t}*2\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
          \end{align*}
          which is decaying oscillations:
          
          \vspace{0.5cm}
          \centerline{\includegraphics[width = 4.2in]{exp-decay-cos}}

 \pagedone
           In phase space, this system spirals in toward $(0, 0)$ (see appendix 1):
           \begin{center}
	            \begin{tikzpicture}[x=1cm, y=1cm,line width=1.75pt]]
	
	            \pgfmathsetmacro{\offset}{0};
	
	            \draw[color=blue, ->] (-5,0) -- (5,0);
	            \draw[color=blue](5.4,0) node{$x$};
	            \draw[color=red, ->](0,-4) -- (0,4);
	            \draw[color=red](0,4.6) node{$v$};
	            \pgfmathsetmacro{\b}{0.1}
	            \draw[color=purple,domain=0:20*pi,
	                  smooth,samples=600,variable=\t] plot
	                  ({(2)*exp((-\b/2)*\t)*2*cos(sqrt(4-\b*\b)/2*\t r)},
	                  {(-2)*exp((-\b/2)*\t)*(\b*cos(sqrt(4-\b*\b)/2*\t r)+sqrt(4-\b*\b)*sin(sqrt(4-\b*\b)/2*\t r))}) 
	                  coordinate(end);
	
	           \end{tikzpicture}
           \end{center}
 \pagedone
 
      \item We can characterize various points in phase space, and various trajectories.
           
           In the case of the simple harmonic oscillator, for any starting point (initial condition), the
           resulting trajectory is a simple closed trajectory -- a {\em periodic orbit}. 
            \begin{center}
                \begin{tikzpicture}[line width=1.75pt, color=purple]
                     \draw[color=blue, ->] (-5,0) -- (5,0);
                     \draw[color=blue](5.4,0) node{$x$};
                     \draw[color=red, ->](0,-4) -- (0,4);
                     \draw[color=red](0,4.6) node{$v$};
                     \draw (0,0) circle (0.5cm);
                     \draw (0,0) circle (1cm);
                     \draw (0,0) circle (1.5cm);
                     \draw (0,0) circle (2cm);
                     \draw (0,0) circle (2.5cm);
                     \draw (0,0) circle (3cm);
                \end{tikzpicture}
           \end{center}
             In the special case
           of starting at $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$, the system is at a {\em fixed point}.
           This fixed point is, however, not {\em stable}, in the sense that if some noise jostles the system,
           it will follow a periodic orbit somewhat away from $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$.
           
           On the other hand, in the case of of the damped harmonic oscillator, any initial condition will
           tend toward $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$ as $t \to \infty$.  $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$
           is a fixed point, and is an {\em attracting stable} fixed point, in the sense that if noise jostles
           the system, it will, as $t \to \infty$, return to $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$.
 \pagedone          
           For any of these continuous systems (i.e., systems where $t$ is a continuous variable), we can get
           at new system by replacing $t$ with $-t$.  In the case of the simple harmonic oscillator, there is
           complete symmetry, and the new system is indistinguishable from the original -- in particular,
           all trajectories are closed periodic orbits.
           
           In the case of the damped harmonic oscillator, there is a fixed point at $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$,
           but all other trajectories spiral out (in phase space) away from $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$.
           In this case, $\begin{bmatrix} 0 \\ 0  \end{bmatrix}$ is an {\em unstable, repelling} fixed point.

\end{itemize}
        
\pagedone

\sectionhead{Discrete Linear Systems}
\begin{itemize}
     \item The systems we have been looking at all have time ($t$) as a continuous variable (and we have been
          limiting ourselves to smooth, i.e., differentiable, systems).
          
          Now I'd like to move to {\em discrete} systems, where time proceeds in steps rather than continuously.  In
          other words, instead of looking at the variable $x(t)$, we will now take time to only take integral values,
          and we will be interested in systems with values $x_0, x_1, x_2, \dots$
          
          Instead of {\em differential} equations, we will be working with {\em difference} equations.  The general
          form of a (one variable) difference equation is
               $$x_{n+1} = f(x_n, x_{n-1}, \ldots, x_0, c).$$
\pagedone          
          A very simple example is the Fibonacci sequence.  This is given by the difference equation
               $$x_{n+2} = x_{n+1} + x_{n}.$$
          This is a second order difference equation.  Once we specify initial conditions (e.g., $x_0 = 0$, $x_1 = 1$),
          we have the solution sequence $0, 1, 1, 2, 3, 5, 8, 13, 21, \ldots$
          
          We can solve linear difference equations for the general solution for the $n$th term using a procedure
          similar to the approach for linear differential equations.  For the Fibonacci sequence, we rewrite the equation
          as
               $$x_{n+2} - x_{n+1} - x_{n} = 0,$$
          and then work with the characteristic polynomial
               $$r^2 - r - 1 = 0.$$
          From this, we get
               $$r = \frac{1 \pm \sqrt{1+4}}{2} = \frac{1 \pm \sqrt{5}}{2}.$$
          The general form of the solution is then
               $$x_n = a_1\left(\frac{1 + \sqrt{5}}{2}\right)^n + a_2\left(\frac{1 - \sqrt{5}}{2}\right)^n.$$
          Once we specify the initial conditions, we can solve for $a_1$ and $a_2$.  For example,
          when $x_0 = 1$ and $x_1 = 1$, we get
               $$ a_1*1 + a_2*1 = 0 $$
               $$ a_1*\left(\frac{1 + \sqrt{5}}{2}\right) + a_2*\left(\frac{1 - \sqrt{5}}{2}\right) = 1,$$
          from which $a_2 =  - a_1$, and so
                $$ a_1*\left(\frac{1 + \sqrt{5}}{2}\right) - a_1*\left(\frac{1 - \sqrt{5}}{2}\right) = 1,$$
          and hence
               $$ a_1= \frac{1}{\sqrt{5}}$$
               $$ a_2 = - \frac{1}{\sqrt{5}}$$
          and so
               $$ x_n = \frac{1}{\sqrt{5}}*\left(\frac{1 + \sqrt{5}}{2}\right)^n
                            - \frac{1}{\sqrt{5}}*\left(\frac{1 - \sqrt{5}}{2}\right)^n .$$
                            
          This is a very general approach (with some minor subtleties when dealing with repeated roots) -- and, of
          course, there are the problems of finding the roots for higher order polynomials, but this basically gets us
          going on general linear difference equations.
          
\end{itemize}
\pagedone
\sectionhead{The Logistics Equation (derivation)}
     \begin{itemize}
          \item Now it's time to get down to business, and start exploring a specific nonlinear example.
               We're going to look at a classic example from biology, concerning population growth.
          
               We'll start by considering a single
               species, living in an environment where it depends on a consumable resource.  So, imagine a beaker
               of sugar water, into which we put a single bacterium:
           \begin{center}
                \begin{tikzpicture}[line width=1.75pt, color=gray]
                     \draw[rounded corners]
                            (-1.5,3) -- (-1.3,3) -- (-1.3,0) -- (1.3,0) -- (1.3,3) -- (1.5,3);
                     \draw (0,2.4) ellipse (1.3cm and 0.2cm);
                     \draw (0,1) circle(.05cm);
%                     \filldraw
%                           [yscale=2.8] (-1.3,1)
%                           [rounded corners] -- (-1.3,0) -- (1.3,0)
%                           [sharp corners] -- (1.3,1) -- cycle;
                \end{tikzpicture}
           \end{center}
 \pagedone
          As time passes, the bacteria reproduce (by dividing, time lapse pictures, bacteria greatly magnified \ldots):
          \begin{center}
                \begin{tikzpicture}[line width=1.75pt, color=gray]
                     \draw[rounded corners]
                            (-9.5,3) -- (-9.3,3) -- (-9.3,0) -- (-6.7,0) -- (-6.7,3) -- (-6.5,3);
                     \draw (-8,2.4) ellipse (1.3cm and 0.2cm);
                     \foreach \x in {0.0}
                          \foreach \y in {0.0}
                               \draw (-8+\x,1+\y) circle(.05cm);
                     \draw(-8,-1)node{$P_0$};
                     \draw[rounded corners]
                            (-5.5,3) -- (-5.3,3) -- (-5.3,0) -- (-2.7,0) -- (-2.7,3) -- (-2.5,3);
                     \draw (-4,2.4) ellipse (1.3cm and 0.2cm);
                     \foreach \x in {0.1, -0.1}
                          \foreach \y in {0.0}
                               \draw (-4+\x,1+\y) circle(.05cm);
                     \draw(-4,-1)node{$P_1$};
                     \draw[rounded corners]
                            (-1.5,3) -- (-1.3,3) -- (-1.3,0) -- (1.3,0) -- (1.3,3) -- (1.5,3);
                     \draw (0,2.4) ellipse (1.3cm and 0.2cm);
                     \foreach \x in {0.1, -0.1}
                          \foreach \y in {0.1,-0.1}
                               \draw (0+\x,1+\y) circle(.05cm);
                     \draw(0,-1)node{$P_2$};
                     \draw[rounded corners]
                            (2.5,3) -- (2.7,3) -- (2.7,0) -- (5.3,0) -- (5.3,3) -- (5.5,3);
                     \draw (4,2.4) ellipse (1.3cm and 0.2cm);
                     \foreach \x in {0.3, 0.1,-0.1,-0.3}
                          \foreach \y in {0.1,-0.1}
                               \draw (4+\x,1+\y) circle(.05cm);
                     \draw(4,-1)node{$P_3$};
                     \draw[rounded corners]
                            (6.5,3) -- (6.7,3) -- (6.7,0) -- (9.3,0) -- (9.3,3) -- (9.5,3);
                     \draw (8,2.4) ellipse (1.3cm and 0.2cm);
                     \foreach \x in {0.3, 0.1,-0.1,-0.3}
                          \foreach \y in {0.3,0.1,-0.1,-0.3}
                               \draw (8+\x,1+\y) circle(.05cm);
                     \draw(8,-1)node{$P_4$};
%                     \filldraw
%                           [yscale=2.8] (-1.3,1)
%                           [rounded corners] -- (-1.3,0) -- (1.3,0)
%                           [sharp corners] -- (1.3,1) -- cycle;
                \end{tikzpicture}
           \end{center}
           The population of bacteria at time $n+1$ will be given by
                $$P_{n+1} = 2 P_n \ \ (\text{with\ }P_0 = 1),$$
           and so in general
                $$P_n = 2^n.$$
\pagedone
          \item Now we'll ask the traditional question at this point:  If we put the first bacterium in the beaker at 9:00 am,
          the bacteria divide every 10 minutes, and the beaker is completely full of bacteria at 12:00 noon, at what time
          was the beaker exactly half full of bacteria?
          
          The answer is clearly ``11:50 am.''  (Now we're supposed to think about natural resources like oil, and oil consumption
          doubling every 20 years -- if in all the time of oil consumption up until now we have consumed half the total reserve
          of oil, in how many years will we have consumed all the oil? etc. \ldots)
          
          But the question I really want to ask is, ``What will the beaker look like at 10 minutes after 12:00 noon?''
          
          The first thought is that there will be sugar water and bacteria all over the table because the beaker will have
          overflowed from the next doubling (it was completely full at 12:00 noon) -- but in the real world, that can't be
          right.  In fact, there won't be any live bacteria in the beaker at 10 minutes after 12:00 noon, because they
          all will have died of starvation!  The beaker was completely full of bacteria, so there was no sugar water
          left \ldots
          
          In fact, as the bacteria population gets closer to filling the beaker, there will be a downward pressure on
          population -- there will be increasing competition for scarce resources.  Therefore, a better model of
          the bacteria population at a given time $n+1$ will be
               $$ P_{n+1} = 2 x_n (M - P_n)$$
          where the 2 is from population growth by doubling, and $M$ is the maximum number of bacteria that can
          fit in the beaker.  Note that this corresponds with the idea that if the beaker is ever completely full of
          bacteria, in the next time step the population will go to $0$ because there will be mass starvation \ldots
          
     \item     Now let's simplify the units -- instead of keeping track of the total population $P_n$, we'll let $x_n = \frac{P_n}{M}$,
          that is, the proportion of the maximum population (also sometimes called the {\em carrying capacity}) that we have
          at time $n$.  We will thus have $0 \le x_n \le 1$.  Let's also generalize to other species that might have
          a net birth rate $R$ other than 2, so that
          we will have the classic {\em logistics equation} for population of a single species in a resource limited
          environment:
               $$x_{n+1} = R * x_n * (1 - x_n).$$
               
          Note that this has an $x_n^2$ term, is thus nonlinear, and can't be ``solved'' in any straightforward way \ldots
          
          
\end{itemize}
\pagedone
\sectionhead{The Logistics Equation (analysis)}
     \begin{itemize}
          \item  The fact that we can't ``solve'' the logistics equation doesn't mean that we can't study its behavior,
               or analyze its characteristics.  Let's do some work on that.  We can start by just observing the system
               in action.
               
               For our first example, let's look at what happens when $R = 1$.  We'll choose a starting value of $x_0 = \frac{1}{2}$.
               We will have
               \begin{align*}
                    x_0 &= \frac{1}{2} \\
                    x_1 &= 1 * \frac{1}{2} * (1 - \frac{1}{2}) = \frac{1}{4} \\
                    x_2 &= 1 * \frac{1}{4}(1 - \frac{1}{4}) = \frac{1}{4} * \frac{3}{4} = \frac{3}{16}\\
                    \ldots
               \end{align*}
\pagedone
               Plotting $x_n$ vs. $n$, we see (first $x_0=\frac{1}{2}$, then $x_0=0.75$):
               \begin{center}
                    \vspace{-0.5cm}
                    \begin{tikzpicture}[line width=1.75pt]
                          \draw[color=black, ->] (-8.2,0) -- (8,0);
                          \draw[color=black](-8.6,2) node{$x_n$};
                          \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                          \draw[color=black](-8.6,4) node{$1$};
                          \draw[color=black](-1,-1) node{$x_{n+1} = 1.0 * x_n *(1 - x_n),\ \ x_0=\frac{1}{2}$};
                          \draw[color=black](-8.2,4) -- (-7.8,4);
                          \draw[color=black](8.4,0) node{$n$};
                          \pgfmathsetmacro{\R}{1.0}
                          \pgfmathsetmacro{\x}{0.5}
                          \draw[fill=black](-8,4*\x) circle(0.05cm);
                          \foreach \i in {-7.5,-7,...,7} {
                               \pgfmathparse{\R*\x*(1-\x)}
                               \xdef\x{\pgfmathresult}
                               \draw[fill=black](\i,4*\x) circle(0.05cm);
                          }
                    \end{tikzpicture}
               \end{center}
               \begin{center}
                    \vspace{-0.5cm}
                    \begin{tikzpicture}[line width=1.75pt]
                          \draw[color=black, ->] (-8.2,0) -- (8,0);
                          \draw[color=black](-8.6,3) node{$x_n$};
                          \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                          \draw[color=black](-8.6,4) node{$1$};
                          \draw[color=black](-1,-1) node{$x_{n+1} = 1.0 * x_n *(1 - x_n),\ \ x_0=0.75$};
                          \draw[color=black](-8.2,4) -- (-7.8,4);
                          \draw[color=black](8.4,0) node{$n$};
                          \pgfmathsetmacro{\R}{1.0}
                          \pgfmathsetmacro{\x}{0.75}
                          \draw[color=black,fill=black](-8,4*\x) circle(0.05cm);
                          \foreach \i in {-7.5,-7,...,7} {
                               \pgfmathparse{\R*\x*(1-\x)}
                               \xdef\x{\pgfmathresult}
                               \draw[color=black,fill=black](\i,4*\x) circle(0.05cm);
                          }
                    \end{tikzpicture}
               \end{center}
\pagedone
          Let's look at some other values of $R$ (and values of $x_0$):
          \begin{center}
               \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 2.0 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{2.0}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
         %      \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,3) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 2.0 * x_n *(1 - x_n),\ \ x_0=0.75$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{2.0}
                     \pgfmathsetmacro{\x}{0.75}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
          %     \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.0 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.0}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
             %  \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.5 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.5}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
           %    \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.6 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.6}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.7 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.7}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
           %    \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.8 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.8}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
          %     \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 3.9 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{3.9}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
           %    \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.5$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.5}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,2) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.501$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.501}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
           %    \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,3) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.75$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.75}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,3) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.751$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.751}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,3) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.751$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.751}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.5,-7.4,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,3) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.751$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.751}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.99,-7.98,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,1) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.3$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.3}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.99,-7.98,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
          \begin{center}
            %   \vspace{-0.5cm}
               \begin{tikzpicture}[line width=1.75pt]
                     \draw[color=black, ->] (-8.2,0) -- (8,0);
                     \draw[color=black](-8.6,1) node{$x_n$};
                     \draw[color=black, ->](-8,-0.2) -- (-8,4.4);
                     \draw[color=black](-8.6,4) node{$1$};
                     \draw[color=black](-1,-1) node{$x_{n+1} = 4.0 * x_n *(1 - x_n),\ \ x_0=0.01$};
                     \draw[color=black](-8.2,4) -- (-7.8,4);
                     \draw[color=black](8.4,0) node{$n$};
                     \pgfmathsetmacro{\R}{4.0}
                     \pgfmathsetmacro{\x}{0.01}
                     \draw[fill=black](-8,4*\x) circle(0.05cm);
                     \foreach \i in {-7.99,-7.98,...,7} {
                          \pgfmathparse{\R*\x*(1-\x)}
                          \xdef\x{\pgfmathresult}
                          \draw[fill=black](\i,4*\x) circle(0.05cm);
                     }
               \end{tikzpicture}
          \end{center}
\pagedone
               Let's view the behavior of the system in a somewhat different way.
               We're going shift over into a form of {\em phase space} for this system, where we will plot $x_{n+1}$ against $x_n$.
               Note that for any value of $R > 0$, the right hand side is a parabola opening down,
               with roots at $x_n = 0$ and $x_n = 1$.  The maximum value of the parabola occurs at $x_n = \frac{1}{2}$,
               and the maximum value is $\frac{R}{4}$.
               \begin{center}
                \begin{tikzpicture}[scale=7, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.28, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\r}{3.0}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
           %          \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
             %        \draw[color=purple](0.5,0.75) parabola[bend at start] (1,0);
                     \draw(1.58, 0.6) node {$x_{n+1}=Rx_n(1-x_n)$};
                     \draw [->] (1.4,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
               Now we'll follow the trajectory of the system.  We'll visualize this by drawing a sequence of lines (often called a
               cobweb diagram).  The coordinates of the endpoints of the lines will be
               $(x_0,0) -> (x_0, x_1),\ \ (x_0, x_1) -> (x_1, x_1),$\newline
               $(x_1, x_1) -> (x_1, x_2),\ \ (x_1, x_2) -> (x_2, x_2)$, etc.
               \begin{center}
                \begin{tikzpicture}[scale=7, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\r}{3.9}
                     \pgfmathsetmacro{\x}{0.4}
                     \pgfmathsetmacro{\wid}{1}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
          %           \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
            %         \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.65, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw[line width=\wid,->](\x,0) -- (\x,\y/2);
                     \draw[line width=\wid,->](\x,\y/2) -- (\x,\y);
                     \pgfmathsetmacro{\midx}{\x+0.5*(\y-\x)}
                     \draw[line width=\wid,->](\x,\y) -- (\midx,\y);
                     \draw[line width=\wid,->](\midx,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,4} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \pgfmathsetmacro{\midy}{\y+0.5*(\x-\y)}
                          \draw[line width=\wid,->](\x,\x) -- (\x,\midy);
                          \draw[line width=\wid,->](\x,\midy) -- (\x,\y);
                          \pgfmathsetmacro{\midx}{\x+0.5*(\y-\x)}
                          \draw[line width=\wid,->](\x,\y) -- (\midx,\y);
                          \draw[line width=\wid,->](\midx,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
           Let's let that same example run for a while:
           \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.8}
                     \pgfmathsetmacro{\r}{3.9}
                     \pgfmathsetmacro{\x}{0.4}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0 = \x$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
             %        \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
               %      \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,30} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          And even longer:
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.8}
                     \pgfmathsetmacro{\r}{3.9}
                     \pgfmathsetmacro{\x}{0.4}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$ = \x};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,100} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          With a different starting value:
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.8}
                     \pgfmathsetmacro{\r}{3.9}
                     \pgfmathsetmacro{\x}{0.1}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$ = \x};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,100} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          And even longer:
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.9}
                     \pgfmathsetmacro{\x}{0.1}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$ = \x};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
             %        \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
               %      \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,350} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
\pagedone
          For other values of $R$ (320 iterations):
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.828}
                     \pgfmathsetmacro{\x}{0.5}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0 = \x$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,320} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          And slight changes (also 320 iterations):
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.829}
                     \pgfmathsetmacro{\x}{0.5}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0 = \x$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,320} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}

\pagedone
          \item Now we'll be a little more systematic in our analysis.  We'll start with small values of $R$, where
               the dynamics are relatively simple.  Let's look at the slope of the tangent line to the parabola
               at $0$.  We are working with the parabola $P(x) = R * x * (1 - x)$, or $P(x) = - Rx^2 + Rx$,
               so the derivative is $P'(x) = -2Rx + R$.  We thus have $P'(0) = R$, and hence when $R \le 1$,
               the entire parabola (for $x > 0$) lies below the line $x_{n+1} = x_n$.  In this case, the dynamics
               just die away to zero (i.e., $\lim_{n \to \infty}(x_n) = 0$).  In particular, $0$ is an {\em attracting
               fixed point} of the system.  (Note that for any value of $R$, $0$ is a fixed point of the system.)
               
               For $R \le 1$, the dynamics don't depend in any significant way on the starting value -- almost
               immediately, the system begins decaying to $0$, and continues directly there.
\pagedone
               \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{0.9}
                     \pgfmathsetmacro{\x}{0.7}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          For $R > 1$, we have a new feature -- the parabola crosses the line $x_{n+1} = x_n$ at some point
          $x > 0$.  In particular, we solve for that crossing point by setting $x_n = x_{n+1}$ -- in other words,
          we have
               $$ x_n = R * x_n * (1 - x_n),$$
          and so
          \begin{align*}
               x_n - Rx_n(1-x_n) &= 0 \\
               x_n - Rx_n + Rx_n^2 &= 0 \\
               Rx_n^2 + (1 - R)x_n &= 0 \\
               x_n(Rx_n + 1 - R) &= 0,
          \end{align*}
          and hence the crossing point occurs at
          $$x_n = \frac{R - 1}{R}.$$
\pagedone
          For all values of $R > 1$, this crossing point is a fixed point of the system.  For values $1 < R < 3$, this is
          an attracting fixed point for any starting value $x_0$ (except $x_0 = 0$ or $1$, and $0$ is now a {\em repelling}
          fixed point):
          \begin{center}
                \begin{tikzpicture}[scale=9, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{1.5}
                     \pgfmathsetmacro{\x}{0.2}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
 \pagedone
           \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{1.5}
                     \pgfmathsetmacro{\x}{0.9}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
              %       \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                %     \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
           \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{2.0}
                     \pgfmathsetmacro{\x}{0.9}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
             %        \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
               %      \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
           \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{2.0}
                     \pgfmathsetmacro{\x}{0.05}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
             %        \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
               %      \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
           \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{2.8}
                     \pgfmathsetmacro{\x}{0.9}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                %     \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                  %   \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           Note that for $2 < R < 3$, the parabola is coming back down at the fixed point $\frac{R - 1}{R}$, and so the
           trajectory spirals in \ldots
\pagedone
     When $R = 3$, we have a new phenomenon.  We still have a fixed point at $\frac{R - 1}{R}$, but it is no longer
     and attracting fixed point:
     \begin{center}
                \begin{tikzpicture}[scale=9, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.9}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                %     \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                  %   \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.63}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                %     \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                  %   \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,50} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.5}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
              %       \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                %     \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,50} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          For $R$ slightly bigger than $3$, we have new behavior:
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.075}
                     \pgfmathsetmacro{\x}{0.5}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                 %    \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                   %  \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,20} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          Or, starting closer to the fixed point:
          \begin{center}
                \begin{tikzpicture}[scale=10, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.06, 1) node {$1$};
                     \draw(-0.2, 0.4) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.29, 0.95) node {$x_{n+1}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.075}
                     \pgfmathsetmacro{\x}{0.65}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw(\x, -0.06) node{$x_0$};
                     \draw(1, -0.06) node{$1$};
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
               %      \draw[color=purple](0,0) parabola[bend at end] (0.5,\r/4);
                 %    \draw[color=purple](0.5,\r/4) parabola[bend at start] (1,0);
                     \draw(1.5, 0.5) node {$x_{n+1}=\r*x_n(1-x_n)$};
               %      \draw [->] (1.65,0.45) arc (-45:-89:1.0);
                     \draw(1.328, 0.33) node {$x_0 = \x$};
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,40} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}

\pagedone
          As $R$ passes through $3$, the fixed point goes from being an attracting fixed to point to being
          an {\em unstable fixed point} (note that we actually already observed this as $R$ passed through
          $1$, where $0$ became an unstable fixed point).
          
          By looking more closely at the region of the fixed point as $R$ passes through $3$, we can
          understand better what is happening.  In particular, the critical feature of the system is that
          as $R$ goes through $3$, the slope of the tangent to the parabola goes from above $-1$ to
          below $-1$ (i.e., becomes more steep).
\pagedone
          \begin{center}
                \begin{tikzpicture}[scale=85, line width=1.75pt]
                     \draw(0.63,0.63) -- (0.69,0.63);
                     \draw(0.69,0.63) -- (0.69,0.69);
                     \draw(0.69,0.69) -- (0.63,0.69);
                     \draw(0.63,0.69) -- (0.63,0.63);
                     \draw(0.63,0.63) -- (0.69, 0.69);
                     \draw(0.62,0.63) node {$0.63$};
                     \draw(0.62,0.69) node {$0.69$};
                     \draw(0.69,0.625) node {$0.69$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{2.95}
                     \pgfmathsetmacro{\x}{0.64}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.63:0.69,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.75, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.653,0.62) node {$x_0 = \x$};
                     \draw[->](\x,0.623) -- (\x,0.63);
                     \draw[line width=\wid](\x,0.63) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,40} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \begin{tikzpicture}[scale=85, line width=1.75pt]
                     \draw(0.64,0.64) -- (0.69,0.64);
                     \draw(0.69,0.64) -- (0.69,0.69);
                     \draw(0.69,0.69) -- (0.64,0.69);
                     \draw(0.64,0.69) -- (0.64,0.64);
                     \draw(0.64,0.64) -- (0.69, 0.69);
                     \draw(0.63,0.64) node {$0.64$};
                     \draw(0.63,0.69) node {$0.69$};
                     \draw(0.69,0.635) node {$0.69$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.645}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.641:0.69,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.75, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.663,0.62) node {$x_0 = \x$};
                     \draw[->](\x,0.623) -- (\x,0.64);
                     \draw[line width=\wid](\x,0.64) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,10} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
            \begin{center}
                \begin{tikzpicture}[scale=85, line width=1.75pt]
                     \draw(0.64,0.64) -- (0.69,0.64);
                     \draw(0.69,0.64) -- (0.69,0.69);
                     \draw(0.69,0.69) -- (0.64,0.69);
                     \draw(0.64,0.69) -- (0.64,0.64);
                     \draw(0.64,0.64) -- (0.69, 0.69);
                     \draw(0.63,0.64) node {$0.64$};
                     \draw(0.63,0.69) node {$0.69$};
                     \draw(0.69,0.635) node {$0.69$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.65}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.641:0.69,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.75, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.663,0.62) node {$x_0 = \x$};
                     \draw[->](\x,0.623) -- (\x,0.64);
                     \draw[line width=\wid](\x,0.64) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,10} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \begin{tikzpicture}[scale=85, line width=1.75pt]
                     \draw(0.64,0.64) -- (0.69,0.64);
                     \draw(0.69,0.64) -- (0.69,0.69);
                     \draw(0.69,0.69) -- (0.64,0.69);
                     \draw(0.64,0.69) -- (0.64,0.64);
                     \draw(0.64,0.64) -- (0.69, 0.69);
                     \draw(0.63,0.64) node {$0.64$};
                     \draw(0.63,0.69) node {$0.69$};
                     \draw(0.69,0.635) node {$0.69$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.0}
                     \pgfmathsetmacro{\x}{0.655}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.641:0.69,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.75, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.663,0.62) node {$x_0 = \x$};
                     \draw[->](\x,0.623) -- (\x,0.64);
                     \draw[line width=\wid](\x,0.64) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,10} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \begin{tikzpicture}[scale=110, line width=1.75pt]
                     \draw(0.63,0.63) -- (0.71,0.63);
                     \draw(0.71,0.63) -- (0.71,0.71);
                     \draw(0.71,0.71) -- (0.63,0.71);
                     \draw(0.63,0.71) -- (0.63,0.63);
                     \draw(0.63,0.63) -- (0.71, 0.71);
                     \draw(0.62,0.63) node {$0.63$};
                     \draw(0.62,0.71) node {$0.71$};
                     \draw(0.71,0.625) node {$0.71$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.05}
                     \pgfmathsetmacro{\x}{0.667}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.6303:0.708,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.77, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.678,0.615) node {$x_0 = \x$};
                     \draw[->](\x,0.62) -- (\x,0.63);
                     \draw[line width=\wid](\x,0.63) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,40} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           If we zoom out from this, we see another interesting phenomenon arise \ldots
           \begin{center}
                \begin{tikzpicture}[scale=55, line width=1.75pt]
                     \draw(0.57,0.57) -- (0.77,0.57);
                     \draw(0.77,0.57) -- (0.77,0.77);
                     \draw(0.77,0.77) -- (0.57,0.77);
                     \draw(0.57,0.77) -- (0.57,0.57);
                     \draw(0.57,0.57) -- (0.77, 0.77);
                     \draw(0.55,0.57) node {$0.57$};
                     \draw(0.55,0.77) node {$0.77$};
                     \draw(0.77,0.562) node {$0.77$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.05}
                     \pgfmathsetmacro{\x}{0.667}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.5703:0.752,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.86, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.678,0.555) node {$x_0 = \x$};
                     \draw[->](\x,0.56) -- (\x,0.57);
                     \draw[line width=\wid](\x,0.57) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,120} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \begin{tikzpicture}[scale=55, line width=1.75pt]
                     \draw(0.57,0.57) -- (0.77,0.57);
                     \draw(0.77,0.57) -- (0.77,0.77);
                     \draw(0.77,0.77) -- (0.57,0.77);
                     \draw(0.57,0.77) -- (0.57,0.57);
                     \draw(0.57,0.57) -- (0.77, 0.77);
                     \draw(0.55,0.57) node {$0.57$};
                     \draw(0.55,0.77) node {$0.77$};
                     \draw(0.77,0.562) node {$0.77$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.05}
                     \pgfmathsetmacro{\x}{0.575}
                     \pgfmathsetmacro{\y}{\r*\x*(1-\x)}
                     \draw[color=purple,domain=0.5703:0.752,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)}) 
	                  coordinate(end);
                     \draw(0.86, 0.66) node {$x_{n+1}=\r*x_n(1-x_n)$};
                     \draw(0.61,0.555) node {$x_0 = \x$};
                     \draw[->](\x,0.56) -- (\x,0.57);
                     \draw[line width=\wid](\x,0.57) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,120} {
                          \xdef\x{\y}
                          \pgfmathparse{\r*\x*(1-\x)}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                \end{tikzpicture}
           \end{center}
\pagedone
          \item We are seeing here an orbit of period 2 -- the system bounces back and forth between two values.
               For values of $R < 3$ we had an attracting fixed point.  The attracting fixed point is at $0$ for $0 \le R \le 1$,
               and at $\frac{R-1}{R}$ for $1 < R < 3$.  At $R = 3$ we still have the fixed point (and in fact that fixed
               point remains for all $R \ge 1$), but it is no longer a stable fixed point.  For $R > 3$, it is a {\em repelling
               fixes point} -- values near, but not exactly on, the fixed point will, in successive iterations, move
               further away.
               
               At $R = 1$ and $R = 3$, changes in $R$ result in significant changes in the dynamics of the system.
               These significant changes in the dynamics of the system resulting from changes in a controlling
               parameter are called {\em bifurcations}.  At $R = 1$, the stable (attracting) fixed point
               at $0$ becomes unstable, and becomes a repelling fixed point.  We acquire a new stable (attracting)
               fixed point at $\frac{R-1}{R}$.
\pagedone
               At $R = 3$, the fixed point at $\frac{R-1}{R}$ becomes unstable, and we acquire a new attracting stable
               orbit of period 2.  These is the first of a sequence of bifurcations in the dynamics of the logistics
               equation.  At each of these bifurcations, an orbit of period $2^n$ becomes unstable (although it
               continues to exist in the dynamics), and a new stable orbit of period $2^{n+1}$ arises.  This process
               is called a {\em period doubling bifurcation cascade}.
               
               We can calculate the $x$ values of this period 2 orbit by looking at two steps of the difference equation:
               \begin{align*}
                    x_{n+2} &= Rx_{n+1}(1 - x_{n+1}) \\
                                  &= R(Rx_n(1 - x_n))(1 - Rx_n(1 - x_n)) \\
                                  &= R^2x_n(1 - x_n)(1 - Rx_n + Rx_n^2) \\
                                  &= R^2x_n(-Rx_n^3 + 2Rx_n^2 - (R + 1)x_n + 1)
               \end{align*}
\pagedone
               We are looking for period 2 orbits -- in other words, values where $x_{n+2} = x_n$.  We therefore want
                    $$x_n = R^2x_n(-Rx_n^3 + 2Rx_n^2 - (R + 1)x_n + 1)$$
               or
                    $$R^2x_n(-Rx_n^3 + 2Rx_n^2 - (R + 1)x_n + 1) - x_n = 0.$$
               This is a 4th degree polynomial is $x_n$, which, for $R > 3$, has 4 roots.  It is easy to see that
               $x_n = 0$ is a root (but we already knew that, because 0 is a fixed point of the original equation,
               and hence also repeats itself every 2 steps).  Similarly, $x_n = \frac{R-1}{R}$ is a root, because
               it too is a fixed point.  We could proceed with the (somewhat messy) algebra to find the other
               two roots, but instead let's look at the cobweb diagram for $x_{n+2}$ vs. $x_n$ (in these diagrams,
               we're also seeing the original parabolas, for reference \ldots).
\pagedone
               You can see the bifurcation happen as $R$ reaches 3.0:
               \begin{center}
                    \vspace{-0.5cm}
                \begin{tikzpicture}[scale=5.5, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=green](-0.2, 0.6) node {$x_{n+2}$};
                     \draw[color=purple](-0.2, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.4, 0.95) node {$x_{n+2}=x_n$};
                     \pgfmathsetmacro{\r}{2.8}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
                     \draw(1.5, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \vspace{-0.5cm}
                \begin{tikzpicture}[scale=5.5, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=green](-0.2, 0.6) node {$x_{n+2}$};
                     \draw[color=purple](-0.2, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.4, 0.95) node {$x_{n+2}=x_n$};
                     \pgfmathsetmacro{\r}{3.0}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
                     \draw(1.5, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
 \pagedone
           and moves on past \ldots
           \begin{center}
                \vspace{-0.5cm}
                \begin{tikzpicture}[scale=5.5, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=green](-0.2, 0.6) node {$x_{n+2}$};
                     \draw[color=purple](-0.2, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.4, 0.95) node {$x_{n+2}=x_n$};
                     \pgfmathsetmacro{\r}{3.2}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
                     \draw(1.5, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
           \begin{center}
                \vspace{-0.5cm}
                \begin{tikzpicture}[scale=5.5, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=green](-0.2, 0.6) node {$x_{n+2}$};
                     \draw[color=purple](-0.2, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw(1.4, 0.95) node {$x_{n+2}=x_n$};
                     \pgfmathsetmacro{\r}{3.7}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
                     \draw(1.5, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
               We can also look at higher order iterates:
               \begin{center}
               % \vspace{-0.5cm}
                \begin{tikzpicture}[scale=12, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=blue](-0.15, 0.7) node {$x_{n+4}$};
                     \draw[color=green](-0.15, 0.5) node {$x_{n+2}$};
                     \draw[color=purple](-0.15, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw[color=blue](1.23, 1) node {$x_{n+4}=x_n$};
                     \pgfmathsetmacro{\r}{3.829}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t]  plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
	             \draw[color=blue,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1))*(1-(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)))})
	                  coordinate(end);
                     \draw(1.2, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
               For various values of $R$:
               \begin{center}
               % \vspace{-0.5cm}
                \begin{tikzpicture}[scale=12, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=blue](-0.15, 0.7) node {$x_{n+4}$};
                     \draw[color=green](-0.15, 0.5) node {$x_{n+2}$};
                     \draw[color=purple](-0.15, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw[color=blue](1.23, 1) node {$x_{n+4}=x_n$};
                     \pgfmathsetmacro{\r}{3.9}
                     \draw[color=purple,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*\t*(1-\t)})
	                  coordinate(end);
                     \draw[color=green,domain=0:1,
	                  smooth,samples=600,variable=\t]  plot
	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
	                  coordinate(end);
	             \draw[color=blue,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1))*(1-(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)))})
	                  coordinate(end);
                     \draw(1.23, 0.6) node {$R = \r$};
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
          We can do cobweb diagrams also:
          \begin{center}
               % \vspace{-0.5cm}
                \begin{tikzpicture}[scale=11, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=blue](-0.15, 0.7) node {$x_{n+4}$};
           %          \draw[color=green](-0.15, 0.5) node {$x_{n+2}$};
              %       \draw[color=purple](-0.15, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw[color=blue](1.23, 1) node {$x_{n+4}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.829}
                     \pgfmathsetmacro{\x}{0.3}
%                     \draw[color=purple,domain=0:1,
%	                  smooth,samples=600,variable=\t] plot
%	                  ({\t},{\r*\t*(1-\t)})
%	                  coordinate(end);
%                     \draw[color=green,domain=0:1,
%	                  smooth,samples=600,variable=\t]  plot
%	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
%	                  coordinate(end);
	             \draw[color=blue,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1))*(1-(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)))})
	                  coordinate(end);
                     \draw(1.3, 0.6) node {$R = \r$};
                     \draw(\x, -0.06) node{$x_0 = \x$};
                  %    \draw(1.268, 0.4) node {$x_0 = \x$};
                     \pgfmathsetmacro{\y}{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,320} {
                          \xdef\x{\y}
                    %      \pgfmathparse{\r*\x*(1-\x)}
                          \pgfmathparse{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
          With changing starting values:
          \begin{center}
               % \vspace{-0.5cm}
                \begin{tikzpicture}[scale=11, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=blue](-0.15, 0.7) node {$x_{n+4}$};
           %          \draw[color=green](-0.15, 0.5) node {$x_{n+2}$};
              %       \draw[color=purple](-0.15, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw[color=blue](1.23, 1) node {$x_{n+4}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.829}
                     \pgfmathsetmacro{\x}{0.5}
%                     \draw[color=purple,domain=0:1,
%	                  smooth,samples=600,variable=\t] plot
%	                  ({\t},{\r*\t*(1-\t)})
%	                  coordinate(end);
%                     \draw[color=green,domain=0:1,
%	                  smooth,samples=600,variable=\t]  plot
%	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
%	                  coordinate(end);
	             \draw[color=blue,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1))*(1-(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)))})
	                  coordinate(end);
                     \draw(1.3, 0.6) node {$R = \r$};
                     \draw(\x, -0.06) node{$x_0 = \x$};
                  %    \draw(1.268, 0.4) node {$x_0 = \x$};
                     \pgfmathsetmacro{\y}{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,320} {
                          \xdef\x{\y}
                    %      \pgfmathparse{\r*\x*(1-\x)}
                          \pgfmathparse{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone
          And changing values of $R$:
          \begin{center}
               % \vspace{-0.5cm}
                \begin{tikzpicture}[scale=11, line width=1.75pt]
                     \draw[->](0,0) -- (1.1,0);
                     \draw(1.2,0) node {$x_n$};
                     \draw[->](0,0) -- (0,1.05);
                     \draw(-0.02,1) -- (0.02,1);
                     \draw(-0.1, 1) node {$1$};
                     \draw[color=blue](-0.15, 0.7) node {$x_{n+4}$};
           %          \draw[color=green](-0.15, 0.5) node {$x_{n+2}$};
              %       \draw[color=purple](-0.15, 0.3) node {$x_{n+1}$};
                     \draw[->](0,0) -- (1.05,1.05);
                     \draw[thin,dashed](0,1) -- (1,1);
                     \draw[thin,dashed](1,0) -- (1,1);
                     \draw[color=blue](1.23, 1) node {$x_{n+4}=x_n$};
                     \pgfmathsetmacro{\wid}{0.6}
                     \pgfmathsetmacro{\r}{3.828}
                     \pgfmathsetmacro{\x}{0.5}
%                     \draw[color=purple,domain=0:1,
%	                  smooth,samples=600,variable=\t] plot
%	                  ({\t},{\r*\t*(1-\t)})
%	                  coordinate(end);
%                     \draw[color=green,domain=0:1,
%	                  smooth,samples=600,variable=\t]  plot
%	                  ({\t},{pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)})
%	                  coordinate(end);
	             \draw[color=blue,domain=0:1,
	                  smooth,samples=600,variable=\t] plot
	                  ({\t},{\r*(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1))*(1-(pow(\r,2)*\t*((-1)*\r*pow(\t,3)+2*\r*pow(\t,2)-(\r+1)*\t+1)))})
	                  coordinate(end);
                     \draw(1.3, 0.6) node {$R = \r$};
                     \draw(\x, -0.06) node{$x_0 = \x$};
                  %    \draw(1.268, 0.4) node {$x_0 = \x$};
                     \pgfmathsetmacro{\y}{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                     \draw[line width=\wid](\x,0) -- (\x,\y);
                     \draw[line width=\wid](\x,\y) -- (\y,\y);
                     \foreach \i in {1,2,...,320} {
                          \xdef\x{\y}
                    %      \pgfmathparse{\r*\x*(1-\x)}
                          \pgfmathparse{\r*(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1))*(1-(pow(\r,2)*\x*((-1)*\r*pow(\x,3)+2*\r*pow(\x,2)-(\r+1)*\x+1)))}
                          \xdef\y{\pgfmathresult}
                          \draw[line width=\wid](\x,\x) -- (\x,\y);
                          \draw[line width=\wid](\x,\y) -- (\y,\y);
                     }
                  %   \draw [->] (1.46,0.55) arc (-45:-90:0.7);
                \end{tikzpicture}
           \end{center}
\pagedone

               
     \end{itemize}
\pagedone
\sectionhead{Appendix 1}        
 
          Just to check (and practice our derivatives :-) with the damped harmonic oscillator example \ldots
          
          We had:
          \begin{align*}
               x(t) &= e^{-\frac{b}{2}t}*2*\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
          \end{align*}
          from which,
          \begin{align*}
               v(t) &=  \dot{x}(t) = -\frac{b}{2}e^{-\frac{b}{2}t}*2\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)} \\
                              &   \ \ \ \ -e^{-\frac{b}{2}t}*\sqrt{4-b^2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\\
                              & = -e^{-\frac{b}{2}t}\left(b*\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                    + \sqrt{4-b^2}*\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right)
          \end{align*}
\pagedone
          Combining the terms:
          \begin{align*}
               & -x(t) - bv(t) \\
                               & = - e^{-\frac{b}{2}t}*2\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)} \\
                               &  \ \ \ + be^{-\frac{b}{2}t}\left(b*\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                    + \sqrt{4-b^2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right) \\
                               &=  e^{-\frac{b}{2}t}\left((b^2-2)\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                    + b\sqrt{4-b^2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right)
          \end{align*}
\pagedone
          And, sure enough, when we calculate $\dot{v}(t)$, we get the same thing:          
          \begin{align*}
               \dot{v}(t) &=  \frac{b}{2}e^{-\frac{b}{2}t}\left(b*\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                    + \sqrt{4-b^2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right) \\
                              &   \ \ \ \ - e^{-\frac{b}{2}t}\left(-b*\frac{\sqrt{4-b^2}}{2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                + \frac{4-b^2}{2}\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right)\\
                              & = e^{-\frac{b}{2}t}\left(\frac{b^2}{2}\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                    + b\frac{\sqrt{4-b^2}}{4}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right) \\
                              &   \ \ \ \ +e^{-\frac{b}{2}t}\left(b\frac{\sqrt{4-b^2}}{2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                                - \frac{4-b^2}{2}\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right)\\
                              & = e^{-\frac{b}{2}t}\left((b^2 - 2)\cos{\left(\frac{\sqrt{4-b^2}}{2}t\right)}
                                      +b\sqrt{4-b^2}\sin{\left(\frac{\sqrt{4-b^2}}{2}t\right)}\right)\\
          \end{align*}
\pagedone

\sectionhead{Appendix 2}
        Something will go here \ldots
                            
\pagedone
%\begin{figure}
%\begin{center}
%\begin{tikzpicture}
%    % draw nodes (pgf/TikZ v2.00 manual sections 3.4, 3.7, 3.9)
%    \node (source) at (0,0) [circle,draw,label=below:Source] {$S$};
%    \node (relay) at (3,2) [circle,draw,label=below:Relay] {$R$};
%    \node (destination) at (6,0) [circle,draw,label=below:Destination] {$D$};
%	
%    % connect nodes (pgf/TikZ v2.00 manual section 3.11)
%    \draw [->] (source.60) to node [auto] {$\alpha_1$} (relay.west);
%    \draw [->] (relay.east) to node [auto] {$\alpha_2$} (destination.120);
%    \draw [->] (source.east) to node [auto,swap] {$\alpha_0$} (destination.west);
%\end{tikzpicture}
%\end{center}
%
%\caption{\label{fig:SRD} Source-relay-destination figure.}
%\end{figure}

%   \tikz \fill[orange] (1ex,1ex) circle (1ex);
%   \tikz \draw (0,0) -- (1,0) -- (1,1) -- cycle;
%   
%   \begin{tikzpicture}[line width=5pt]
%   
%  \draw[color=red, ->] (-1.5,0) -- (1.5,0);
%  \draw[->](0,-1.5) -- (0,1.5);
%    \draw (0,0) circle (3cm);
%\end{tikzpicture}
%
%\tikz[scale=3] \draw[x=1.57ex,y=1ex] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0)
%                            (0,1) cos (1,0) sin (2,-1) cos (3,0) sin (4,1);

 \footnotesize
 \bibliographystyle{plain} 
 
%% \tthdump{\hypertarget{References}{}\hyperlink{Contents}{\hfil To top $\leftarrow$}}
%% %%tth:{\special{html: <A NAME="References"></A><a href="\#Top of file">       Top</a>}}


\marginpar{\hyperlink{Contents}{\hfil$\leftarrow$}}

\vspace{-\baselineskip}
\vspace{-\baselineskip}
\vspace{-\baselineskip}
 
 \begin{thebibliography}{12}
%%tth:{\special{html: <font size="+0">}}

\addcontentsline{toc}{section}{References}

\bibitem{zhan}
Zhan, Mei-Qin,\newline
Course notes, on Systems of First Order Differential Equations\newline
 \hyperref{http://www.unf.edu/\~mzhan/chapter4.pdf}{}{}
 {http://www.unf.edu/\~\ mzhan/chapter4.pdf}
%
%\bibitem{chung2}
%Chung, Fan,\newline
%Graph Theory in the Information Age, Notices of the AMS, Vol. 57, No. 6, pp. 726-732\newline
% \hyperref{http://www.math.ucsd.edu/~fan/wp/graph.pdf}{}{}
% {http://www.math.ucsd.edu/~fan/wp/graph.pdf}
% 
%\bibitem{horaud}
%Horaud, Radu, \newline
%A Short Tutorial on Graph Laplacians, Laplacian Embedding, and Spectral Clustering\newline
% \hyperref{http://perception.inrialpes.fr/~Boyer/ReadingGroup/GraphLaplacian-tutorial.pdf}{}{}
% {http://perception.inrialpes.fr/\~\ Boyer/ReadingGroup/GraphLaplacian-tutorial.pdf}
%
%\bibitem{luxburg}
%von Luxburg, Ulrike,\newline
%A Tutorial on Spectral Clustering\newline
%\hyperref{http://people.kyb.tuebingen.mpg.de/ule/publications/publication_downloads/Luxburg07_tutorial.pdf}{}{}
%{http://people.kyb.tuebingen.mpg.de/ule/
%publications/publication\_downloads/Luxburg07\_tutorial.pdf}
%
%\bibitem{spielman}
%Spielman, Daniel, and Srivastava, Nikhil,\newline
%Graph Sparsification by Effective Resistances\newline
%Abstract: \hyperref{http://arxiv.org/abs/0803.0929}{}{}
%{http://arxiv.org/abs/0803.0929}\newline
%Full text: \hyperref{http://arxiv.org/pdf/0803.0929v4}{}{}
%{http://arxiv.org/pdf/0803.0929v4}
%
%\bibitem{vejmelka}
%Vejmelka, Martin,\newline
%Spectral Graph Clustering\newline
%\hyperref{http://ai.ms.mff.cuni.cz/~sui/Seminar2009MartinVejmelka.pdf}{}{}
%{http://ai.ms.mff.cuni.cz/~sui/Seminar2009MartinVejmelka.pdf}
% 
%\bibitem{ng}
%Ng, Andrew, Jordan, Michael, and Weiss, Yair,\newline
%On Spectral Clustering: Analysis and an Algorithm\newline
%\hyperref{http://www.stat.washington.edu/wxs/Stat593-s03/Literature/ng-jordan-weiss-nips01.pdf}{}{}
%{http://www.stat.washington.edu/wxs/Stat593-s03/Literature/ng-jordan-weiss-nips01.pdf}
%
%\bibitem{zhu}
%Zhu, Xiaojin,\newline
%Course notes, Advanced Natural Language Processing\newline
% \hyperref{http://pages.cs.wisc.edu/~jerryzhu/cs769.html}{}{}
% {http://pages.cs.wisc.edu/~jerryzhu/cs769.html}


\end{thebibliography}

\tthdump{\hyperlink{Contents}{\hfil To top $\leftarrow$}}
%%tth:{\special{html: <a href="\#Top of file">       Back to top of file</a>}}


\end{document}
