\documentclass[fullpage, 10pt, openany]{book}

\usepackage{etex}

%%%%%%%%PAGE FORMATTING
\topmargin -.7in \textheight 9.5in \oddsidemargin -.3in
\evensidemargin -.3in \textwidth 7in


\usepackage{fancyhdr} %%%%for page headers and footers
\usepackage{amsmath} %%%%%standard math symbols
\usepackage{makeidx} %%%%%for the index


%%%%%                   Postscript drawing packages
\usepackage{pstricks, pstricks-add, pst-plot}

\usepackage{hangcaption} %%% for captioning in figures with multiple images
\usepackage[amsmath,thmmarks,standard,thref]{ntheorem} %%%%for theorem numbering
\usepackage{multicol} %%%%%for multicolumns in the content and also in exercises
\usepackage[colorlinks=true,linkcolor=red, pdftitle={differential calculus book}, pdfauthor={david santos},
bookmarksopen, dvips]{hyperref}
\usepackage{pdflscape}
\usepackage{thumbpdf}

%%%%%%%%%%%%%%CHAPTER HEADINGS
\usepackage[Lenny]{fncychap}

%%%%%                  FONTS
\fontencoding{T1}

\DeclareFixedFont{\smallit}{T1}{phv}{b}{it}{9pt}
\usepackage{pifont,marvosym,amssymb,mathrsfs, manfnt, amsfonts}
%\usepackage{newcent}
%\usepackage{lmodern}
%\usepackage{euler}


\usepackage{mathptmx}% instead of package times
\usepackage[scaled=0.92]{helvet} % or [scaled=0.92], if you like
\usepackage{courier}
\mathversion{bold}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\lhead{\nouppercase{\textcolor{red}{\rightmark}}}
\rhead{\nouppercase{\textcolor{red}{\leftmark}}}
\lhead[\rm\thepage]{\textcolor{red}{\it \rightmark}}
\rhead[\textcolor{red}{\it\leftmark}]{\rm\thepage} \cfoot{}
\usepackage[tiling]{pst-fill}      % PSTricks package for filling/tiling
\usepackage{pst-char}              % PSTricks package for character path
\usepackage{pst-grad}              % PSTricks package for gradient filling
%
\newcommand{\WriteBig}[5] {%
  \DeclareFixedFont{\bigsf}{T1}{phv}{b}{n}{#2}%
  \DeclareFixedFont{\smallrm}{T1}{ptm}{(m)}{n}{#3}%
  \psboxfill{\smallrm  #1} %
      \centerline{%
         \pscharpath[fillstyle=gradient,%
        gradangle=-45,%
        gradmidpoint=0.5,%
        addfillstyle=boxfill,%
        gradbegin=#4,%
        gradend=#5,%
        fillangle=45,%
        fillsep=0.7mm]{\rput[b](0,0){\bigsf#1}}}
}

%%Note: I had to comment-out marvosym.sty on the line \def\Rightarrow{{\mvchr58}}
%%because it wasn't giving the standard \implies command. Anyone knowing a better way
%%of dealing with this problem, please email me.


\everymath{\displaystyle}

%%%%%%%%%%%%%%%%%INTERVALS
%%%%%%%% lo= left open, rc = right closed, etc.
\def\lcrc#1#2{\left[#1 \ ; #2 \right]}
\def\loro#1#2{ \left]#1 \ ; #2 \right[}
\def\lcro#1#2{\left[#1 \ ; #2 \right. \left[ \right.}
\def\lorc#1#2{\left. \right[#1 \ ; #2 \left.\right]}


%%%%%                Non-standard commands and symbols
\newcommand{\BBZ}{\mathbb{Z}}
\newcommand{\BBR}{\mathbb{R}}
\newcommand{\BBN}{\mathbb{N}}
\newcommand{\BBC}{\mathbb{C}}
\newcommand{\BBQ}{\mathbb{Q}}
\def\binom#1#2{{#1\choose#2}}
\def\T#1#2{\mathscr{T}_{#1}{#2}}
\newcommand{\dis}{\displaystyle}
\def\fun#1#2#3#4#5{\everymath{\displaystyle}{{#1} : \vspace{1cm}
\begin{array}{ccc}{#4} & \rightarrow &
{#5}\\
{#2} &  \mapsto & {#3} \\
\end{array}}}
\def\im#1{{\mathbf{Im}}\left(#1\right)}
\def\dom#1{{\mathbf{Dom}}\left(#1\right)}
\def\supp#1{{\mathbf{supp}}\left(#1\right)}
\def\target#1{{\mathbf{Target}}\left(#1\right)}

\def\sgn#1{{\mathrm{signum}}\left(#1\right)}
\def\distance#1#2{{\mathbf d}{\langle {#1}, {#2}\rangle}}
\newcommand{\idefun}{{\bf Id\ }}
\def\tends#1#2{{#1 \rightarrow #2}}
\def\diff#1#2{\dfrac{\mathrm{d}}{\mathrm{d} #2}\ #1}


%%%%%FLOAT PLACEMENT

\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9} \setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20} \setcounter{dbltopnumber}{9}




%%%%%                    THEOREM-LIKE ENVIRONMENTS
\newcommand{\proofsymbol}{\Pisymbol{pzd}{113}}

\theorempreskipamount .5cm \theorempostskipamount .5cm
\theoremstyle{change}
\theorembodyfont{\normalfont}
\newtheorem{thm}{Theorem}
\newtheorem{cor}[thm]{{ Corollary}}
\newtheorem{lem}[thm]{{ Lemma}}
\newtheorem{exa}[thm]{{ Example}}
\newtheorem{df}[thm]{{ Definition}}
\newtheorem{axi}[thm]{Axiom}


\newenvironment{pf}[0]{\itshape\begin{quote}{\bf Proof: \ }}{\proofsymbol\end{quote}}
\newenvironment{rem}[0]{\begin{quote}{\huge\textcolor{red}{\Stopsign}}\itshape }{\end{quote}}




\title{\WriteBig{Maths 165}{4cm}{5mm}{blue}{white}}
\author{ David A. Santos \\
\href{mailto:dsantos@ccp.edu}{dsantos@ccp.edu}}
\date{AUTUMN 2004}
%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand{\twocoltoc}{%
  \section*{\contentsname
      \@mkboth{%
        }{}}%
  \begin{multicols}{2}
    \@starttoc{toc}%
  \end{multicols}}
\makeatother
%%%%%%%%%%%%
\makeindex

%%%%%%%ANSWERS%%%%%%%%%%%%%%%

%\usepackage{answers}

%\newtheorem{que}[thm]{Query}

%\Newassociation{answer}{Answer}{jose}
%\renewcommand{\Answerlabel}[1]{\sf\bf{#1 Answer}}
\usepackage{polynom}






\setlength{\fboxrule}{2pt}






\usepackage{fancybox}
\begin{document}


\pagenumbering{roman} \maketitle

\twocoltoc{} \pagestyle{fancy}
%\Opensolutionfile{jose}[josesolns]{}

\clearpage \section*{Preface} \markboth{}{}
\addcontentsline{toc}{chapter}{Preface} \markright{Preface}


These notes started the fall of 2004, when I taught Maths 165,
Differential Calculus, at Community College of Philadelphia.

\bigskip

The students at that course were Andrea BATEMAN, Kelly BLOCKER,
Alexandra LOUIS,  Cindy LY, Thoraya SABER, Stephanilee MAHONEY,
Brian McCLINTON, Jessica MENDEZ,  Labaron PALMER, Leonela TROKA, and
Samneak SAK. I would like to thank them for making me a better
teacher with their continuous input and questions.

\bigskip


The main goal of these notes is to initiate students in the study of
Calculus. Chapter 1 introduces most of the notation used throughout
the notes. The central problem is: given a (simple) formula relating
two quantities, how can we graphically represent this relationship?
This problem is partially answered in Chapter 2, where we derive
formul\ae\ for lines, semicircles, parabolas and hyperbolas by means
of the distance formula, without the necessity of the machinery of
derivatives. Their curves and equations provide then meaningful
examples for functions, which are introduced in  Chapter 3. Once the
basic operations and transformations of functions are presented, and
the basic vocabulary for the graph of a function is given, the
insufficiency of the methods of Chapter 2 leads us  to look at the
graphs of functions through the methods of  Calculus. The strong
derivative of a function is presented in Chapter 4, where theorems
regarding its influence on the graph of a function are proven. In
Chapter 4 we introduce polynomial functions, the Sum Rule, Product
Rule, and the Chain Rule. A few results from the Theory of Equations
are proved, via the introduction of Taylor polynomials. In Chapter 5
we introduce rational functions and a few algebraic functions. The
Quotient Rule is proved in this Chapter.


\bigskip

I have profitted from conversations with Jos\'{e} Mason and Alain
Schremmer regarding approaches to teaching this course.

\bigskip


\hfill David A. Santos \\

\hfill Please send comments to
\href{mailto:dsantos@ccp.edu}{dsantos@ccp.edu}

\section*{Things to do}
Need to
\begin{itemize}
\item Write a chapter on exponential and logarithmic functions.
\item Write a chapter on goniometric functions.
\item Weave Taylor and McLaurin
\item Write a proof of Rolle's Theorem for polynomials, using Taylor
polynomials and the Bolzano's Theorem.
\item Write a section on Lagrange Interpolation.
\item Write a section on Partial Fractions.
\item Rewrite the big oh appendix.

\end{itemize}

\chapter*{Legal Notice} This material may be distributed only subject
to the terms and conditions set forth in the Open Publication
License, version 1.0 or later (the latest version is presently
available at \url{http://www.opencontent.org/openpub/}.

\bigskip

THIS WORK IS LICENSED AND PROVIDED ``AS IS'' WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
OR A WARRANTY OF NON-INFRINGEMENT.

\bigskip

THIS DOCUMENT MAY NOT BE SOLD FOR PROFIT OR INCORPORATED INTO
COMMERCIAL DOCUMENTS WITHOUT EXPRESS PERMISSION FROM THE AUTHOR(S).
THIS DOCUMENT MAY BE FREELY DISTRIBUTED PROVIDED THE NAME OF THE
ORIGINAL AUTHOR(S) IS(ARE) KEPT AND ANY CHANGES TO IT NOTED.












 \clearpage

 \section*{To the Student} \markboth{}{}
\addcontentsline{toc}{chapter}{To the Student} \markright{To the
Student} These notes are provided for your benefit as an attempt to
organise the salient points of the course. They are a {\em very
terse} account of the main ideas of the course, and are to be used
mostly to refer to central definitions and theorems. The number of
examples is minimal, and here you will not find exercises. The {\em
motivation} or informal ideas of looking at a certain topic, the
ideas linking a topic with another,  the worked-out examples, etc.,
are given in class. Hence  these notes are not  a substitute to
lectures: {\bf you must always attend to lectures}. The order of the
notes may not necessarily be the order followed in the class.

\bigskip
There is a certain algebraic fluency  that is necessary for a course
at this level. These algebraic prerequisites would be difficult to
codify here, as they vary depending on class response and the topic
lectured. If at any stage you stumble in Algebra, seek help! I am
here to help you!

\bigskip

Tutoring can sometimes help,  but bear in mind that whoever tutors
you may not be familiar with my conventions. Again, I am here to
help! On the same vein, other books may help, but the approach
presented here is at times unorthodox and finding alternative
sources might be difficult.

\bigskip

Here are more recommendations:
\begin{itemize}
\item Read a section before class discussion, in particular, read
the definitions.
\item Class provides the informal discussion, and you will profit
from the comments of your classmates, as well as gain confidence by
providing your insights and interpretations of a topic. {\bf Don't
be absent! }
\item I encourage you to form study groups and to discuss the
assignments. Discuss among yourselves and help each other but don't
be  {\em parasites!} Plagiarising your classmates' answers will only
lead you to disaster!
\item Once the lecture of a particular topic has been given, take a fresh look at the notes of the lecture topic.
\item Try to understand a single example well, rather than
ill-digest multiple examples.
\item Start working on the distributed homework ahead of time.
\item {\bf Ask questions during the lecture.} There are two main  types of questions
that you are likely to ask.
\begin{enumerate}
\item {\em Questions of Correction: Is that a minus sign there?} If you think that, for example, I have
missed out a minus sign or wrote $P$ where it should have been
$Q$,\footnote{My doctoral adviser used to say ``I said $A$, I wrote
$B$, I meant $C$ and it should have been $D$!} then by all means,
ask. No one likes to carry an error till line XLV because the
audience failed to point out an error on line I. Don't wait till the
end of the class to point out an error. Do it when  there is still
time to correct it!
\item {\em Questions of Understanding: I don't get it!} Admitting that you do not understand something is
an act requiring utmost courage. But if you don't, it is likely that
many others in the audience also don't. On the same vein, if you
feel you can explain a point to an inquiring classmate, I will allow
you time in the lecture to do so.  The best way to ask a question is
something like: ``How did you get from the second step to the third
step?'' or ``What does it mean to complete the square?''
Asseverations like ``I don't understand'' do not help me answer your
queries. If I consider that you are asking the same questions too
many times, it may be that you need extra help, in which case we
will settle what to do outside the lecture.
\end{enumerate}

\item Don't fall behind! The sequence of topics is closely
interrelated, with one topic leading to another.

\item You will need square-grid paper, a ruler (preferably a
T-square), some needle thread, and a compass.

\item The use of calculators is allowed, especially in the occasional lengthy calculations.
However, when graphing, you will need to provide
algebraic/analytic/geometric support of your arguments. The
questions on assignments and exams will be posed in such a way that
it will be of no advantage to have a graphing calculator.
\item Presentation is critical. Clearly outline your ideas. When writing solutions, outline major steps and write in
complete sentences. As a guide, you may try to emulate the style
presented in the scant examples furnished in these notes.
\end{itemize}
\clearpage \pagestyle{fancy} \fancyhead{}
\renewcommand{\chaptermark}{\markboth{\chaptername\ \thechapter}}
\renewcommand{\sectionmark}{\markright}
\fancyhead[RO]{\itshape\leftmark} \fancyhead[RE]{\itshape\rightmark}
\chapter{Numbers} \pagenumbering{arabic} \setcounter{page}{1}
\thispagestyle{empty}
%%%%%%%%%%%%%%%%FANCY PAGE NUMBER BEGINS

\makeatletter
\newcount\TotalPages
\TotalPages=\z@

% To know the number of pages (we write it in the .aux file)
\def\NumberLastPage{70} % Actual # times 3.

\AtEndDocument{%
\immediate\write\@auxout{%
  \string\gdef\string\NumberLastPage{\the\TotalPages}}}
\fancyput(17.5cm,2.5cm){%
\psframe[linestyle=none,fillstyle=solid,fillcolor=yellow](1,-\paperheight)
\rput(0.5,-\pst@dimh){%
  \pscirclebox[fillstyle=solid,fillcolor=black]{%
    \textcolor{white}{\textbf{\thepage}}}}}
\let\@outputpageORIG\@outputpage
\def\@outputpage{%
\global\advance\TotalPages\@ne \pst@cnth=\NumberLastPage
\advance\pst@cnth\@ne \pst@dimh=\paperheight
\divide\pst@dimh\pst@cnth \pst@dimg=\pst@dimh \divide\pst@dimg\tw@
\pst@cntg=\thepage \advance\pst@cntg\m@ne
\multiply\pst@dimh\pst@cntg \advance\pst@dimh\pst@dimg
\@outputpageORIG} \makeatother



%%%%%%%%%%%%%FANCY PAGE NUMBER ENDS



This chapter introduces essential notation and terminology that will
be used throughout these notes.
\section{The Real Line}

\begin{df}We will mean \index{set}
by a {\em set} a collection of well defined members or {\em
elements}. A {\em subset} is a sub-collection of a set.  We denote
that $B$ is a subset of $A$ by the notation $B \subset A$.\end{df}
\begin{df}Let $A$ be a set. If $a$ belongs to the set $A$, then we
write $a\in A$, read ``$a$ is an element of $A$.'' If $a$ does not
belong to the set $A$, we write $a\not\in A$, read ``$a$ is  not an
element of $A$.'' \end{df}

We denote the set of {\em natural numbers}\index{numbers!natural}
$\{0,1,2, \ldots\}$\footnote{We follow common European usage and
include $0$ among the natural numbers.} by the symbol $\BBN$. The
natural numbers allow us to count things, and they have the property
that addition and multiplication is closed within them: that is, if
we add or multiply two natural numbers, we stay within the natural
numbers. Observe that this is not true for subtraction and division,
since, for example, neither $2-7$ nor $2\div 7$ are natural numbers.
We say that then that the natural numbers enjoy {\em closure} within
multiplication and addition.

\bigskip

By appending the opposite (additive inverse) of every member of
$\BBN$ to $\BBN$ we obtain the set $$\BBZ= \{\ldots, -3,-2,-1,0,1,2,
3, \ldots\}\footnote{$\BBZ$ for the German word {\em Z\"{a}hlen},
meaning {\em number}.}$$ of {\em integers}. The closure of
multiplication and addition is retained by this extension and now we
also have closure under subtraction and we have also the notion of
{\em positivity}. This last property allows us to divide the
integers  into the {\em strictly positive}, the {\em strictly
negative} or zero, and hence introduces an {\em ordering} in the
rational numbers by defining $a\leq b$ if and only if $b-a$ is
positive. \index{numbers!integers}

\bigskip

Enter now in the picture the {\em rational
numbers}\index{numbers!rational}, commonly called {\em fractions},
which we denote by the symbol $\BBQ$.\footnote{$\BBQ$ for {\em
quotients}.} They are the numbers of the form $\dfrac{a}{b}$ with
$a\in\BBZ$, $b\in\BBZ$,  $b\neq 0$, that is, the division of two
integers, with the divisor distinct from zero. Observe that every
rational number $\dfrac{a}{b}$ is a solution to the equation (with
$x$ as the unknown) $bx-a = 0$. It can be shewn that the rational
numbers are precisely those numbers whose decimal representation
either is finite (e.g., $0.123$) or is periodic (e.g.,
$0.\overline{123} = 0.123123123\ldots$). Notice that every integer
is a rational number, since $\dfrac{a}{1} = a$, for any $a\in \BBZ$.
Upon reaching $\BBQ$ we have formed a system of numbers having
closure for  the four arithmetical operations of addition,
subtraction, multiplication, or division.\footnote{ ``Reeling and
Writhing, of course, to begin with,'' the Mock Turtle replied, ``and
the different branches of Arithmetic—--Ambition, Distraction,
Uglification, and Derision.''}

\bigskip

Are there numbers which are not rational numbers? Up until the
Pythagoreans\footnote{Pythagoras lived approximately from 582 to 500
BC. A legend says that the fact that $\sqrt{2}$ was irrational was
secret carefully guarded  by the Pythagoreans. One of them betrayed
this secret, and hence was assassinated by being drowned from a
ship.}, the ancient Greeks thought that all numbers were the ratio
of two integers. It was then discovered that the length of the
hypothenuse of a right triangle having both legs of unit
length---which is $\sqrt{2}$ in modern notation---could not be
represented as the ratio of two integers, that is, that $\sqrt{2}$
is {\em irrational}\index{numbers!irrational}\footnote{An irrational
number is thus one that cannot be written as the quotient of two
integers $\dfrac{a}{b}$ with $b\neq 0$.}. Appending the irrational
numbers to the rational numbers we obtain the {\em real
numbers}\index{numbers!real} $\BBR$.

\bigskip

Observe that $\sqrt{2}$ is a solution to the equation $x^2-2 = 0$. A
further example is $\sqrt[3]{5}$, which is a solution to the
equation $x^5-3 = 0$. A more difficult example to visualise is
$\sqrt[3]{\sqrt{2}+1}$, which  is a solution to $x^6-2x^3
-1=0$.\footnote{To see this, work backwards: if
$x=\sqrt[3]{\sqrt{2}+1}$, then $x^3 = \sqrt{2}+1$, which gives
$(x^3-1)^2 = 2$, which is $x^6-2x^3 -1=0$.} Any number which is a
solution of an equation of the form $a_0x^n+a_1x^{n-1} + \cdots +
a_n = 0$ is called an {\em algebraic number}.

\bigskip

A number $u$ is an {\em upper bound} for a set of numbers $A$ if for
all $a\in A$ we have $a \leq u$. The smallest such upper bound is
called the {\em supremum} of the set $A$.  Similarly,  a number $l$
is a {\em lower bound} for a set of numbers $B$ if for all $b\in B$
we have $l \leq b$. The largest such lower bound is called the {\em
infimum} of the set $B$. The real numbers have the following
property, which we enunciate as an axiom.
\begin{axi}[Completeness of $\BBR$] Any set of real numbers which is
bounded above has a supremum. Any set of real numbers which is
bounded below has a infimum. \index{Completeness Axiom}
\end{axi}

\bigskip

Observe that the rational numbers are not complete. For example,
there is no largest rational number in the set  $$\{x\in\BBQ:
x^2<2\}$$ since $\sqrt{2}$ is irrational and for any good rational
approximation to $\sqrt{2}$ we can always find a better one.


\bigskip

Are there real numbers which are not algebraic? It wasn't till the
XIXth century when it was discovered that there were irrational
numbers which were not algebraic. These irrational numbers are
called {\em transcendental numbers}.\index{numbers!transcendental}
It was later shewn that numbers like $\pi$ and $e$ are
transcendental. In fact, in the XIXth century George Cantor proved
that even though  $\BBN$ and $\BBR$ are both infinite sets, their
infinities are in a way ``different'' because they cannot be put
into  a one-to-one correspondence.


\vspace{1cm}
\begin{figure}[h]
$$\psset{unit=.5}
\renewcommand{\pshlabel}[1]{{\tiny #1}}
\psaxes[yAxis=false](0, 0)(-7,0)(7, 0)
\psline[linestyle=dotted]{->}(7,0)(11,0)
\psline[linestyle=dotted]{->}(-7,0)(-11,0)
\uput[dr](11,0){+\infty}\uput[dl](-11,0){-\infty}
$$\vspace{1cm} \footnotesize\hangcaption{The Real Line.} \label{fig:the_real_line}
\end{figure}

\bigskip
Geometrically, each real number can be viewed as a point on a
straight line. We make the convention that we orient the real line
with $0$ as the origin, the positive numbers increasing towards the
right from $0$ and the negative numbers decreasing towards the left
of $0$, as in figure \ref{fig:the_real_line}. We append the object
$+\infty$, which is larger than any real number, and the object
$-\infty$, which is smaller than any real number. Letting
$x\in\BBR$, we make the following conventions.
\begin{equation} (+\infty) + (+\infty) = +\infty  \end{equation}
\begin{equation} (-\infty) + (-\infty) = -\infty  \end{equation}
\begin{equation} x + (+\infty) = +\infty  \end{equation}
\begin{equation} x + (-\infty) = -\infty  \end{equation}
\begin{equation} x(+\infty) = +\infty\ \ \ \mathrm{if} \ x> 0  \end{equation}
\begin{equation} x(+\infty) = -\infty\ \ \ \mathrm{if} \ x< 0    \end{equation}
\begin{equation} x(-\infty) = -\infty\ \ \ \mathrm{if} \ x> 0  \end{equation}
\begin{equation} x(-\infty) = +\infty\ \ \ \mathrm{if} \ x< 0    \end{equation}
\begin{equation} \label{eq:1/big}\dfrac{x}{\pm \infty} = 0    \end{equation}
Observe that we leave the following undefined: $$\dfrac{\pm
\infty}{\pm \infty}, \ \ \ \ (+\infty) + (-\infty), \ \ \ 0(\pm
\infty).
$$





\bigskip


The square of every real number $x$ is positive\footnote{We use the
word {\em positive} to indicate a quantity $\geq 0$, and use the
term {\em strictly positive} for a quantity $>0$. Similarly with
{\em negative} ($\leq 0$) and {\em strictly negative} ($<0$).}, that
is, for all real numbers $x$ we have $x^2\geq 0$. Introducing the
object $i = \sqrt{-1}$---whose square satisfies $i^2=-1$, a negative
number---and considering the numbers of the form $a+bi$, with $a$
and $b$ real numbers, we obtain the {\em complex
numbers}\index{numbers!complex} $\BBC$.


\bigskip

In summary we have $$ \BBN \subset \BBZ \subset \BBQ \subset \BBR
\subset \BBC .
$$




\section{Intervals}
\begin{df}
An {\em interval}\index{interval} $I$ is a subset of the real
numbers with the following property: if $s\in  I$ and $t\in I$, and
if $s < x < t$, then $x\in I$. In other words, intervals are those
subsets of real numbers with the property that every number between
two elements is also contained in the set. Since there are
infinitely many decimals between two different real numbers,
intervals with distinct endpoints contain infinitely many members.
Table \ref{tab:intervals} shews the various types of intervals.
\end{df}
Observe that we indicate that the endpoints are included by means of
shading the dots at the endpoints and that the endpoints are
excluded by not shading the dots at the endpoints. \footnote{It may
seem like a silly analogy, but think that in $[a;b]$ the brackets
are ``arms'' ``hugging'' $a$ and $b$, but in $]a;b[$ the ``arms''
are repulsed. ``Hugging'' is thus equivalent to including the
endpoint, and ``repulsing'' is equivalent to excluding the
endpoint.}

\renewcommand{\arraystretch}{2}
\begin{table}[h]\begin{center}\begin{tabular}{llc}{\bf Interval Notation}  & {\bf Set Notation}  & {\bf Graphical
Representation} \\
 $[a; b]$ & $\{x\in \BBR: a \leq x \leq b\}$\footnote{This is ``the
set of all real numbers $x$ such that $a$ is less than or equal to
$x$, and $x$ is less than or equal to
 $b$.''} & $  \psset{unit=1pc} \psline[linewidth=1.5pt,
linecolor=red]{*-*}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){b} $ \\
$]a; b[$ & $\{x\in \BBR: a < x < b\}$ & $  \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{o-o}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){b} $ \\
$[a; b[$ & $\{x\in \BBR: a \leq x < b\}$ & $  \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{*-o}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){b} $ \\
$]a; b]$ & $\{x\in \BBR: a < x \leq b\}$ & $  \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{o-*}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){b} $ \\
$]a; +\infty[$ & $\{x\in \BBR: x>a\}$ & $  \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{o->}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){+\infty} $ \\
$[a; +\infty[$ & $\{x\in \BBR: x\geq a\}$ & $  \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{*->}(-5,0)(5,0)\uput[d](-5,0){a}\uput[d](5,0){+\infty} $ \\
$]-\infty; b[$ & $\{x\in \BBR: x< b\}$ & $ \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{<-o}(-5,0)(5,0)\uput[d](-5,0){-\infty}\uput[d](5,0){b} $ \\
$]-\infty; b]$ & $\{x\in \BBR: x\leq b\}$ & $ \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{<-*}(-5,0)(5,0)\uput[d](-5,0){-\infty}\uput[d](5,0){b} $ \\
$]-\infty; +\infty[$ & $\BBR$ & $ \psset{unit=1pc}
\psline[linewidth=1.5pt,
linecolor=red]{<->}(-5,0)(5,0)\uput[d](-5,0){-\infty}\uput[d](5,0){+\infty} $ \\
\end{tabular}\footnotesize\hangcaption{Intervals.} \label{tab:intervals}\end{center}\end{table}


\section{Neighbourhood of a point}
Before stating the main definition of this section, let us consider
the concept of ``nearness.'' What does it mean for one point to be
``near'' another point? We could argue that $1$ is near to $0$, but,
for some purposes, this distance could be ``far.'' We could
certainly see that $0.5$ is closer to $0$ than $1$ is, but then
again, for some purposes, even this distance could be ``far.''
Mentioning a specific number ``near'' $0$, like $1$ or $0.5$ fails
in what we desire for ``nearness'' because mentioning a specific
point immediately gives a ``static'' quality to ``nearness'': once
you mention a specific point, you could mention infinitely many more
points which are closer than the point you mentioned. The points in
the sequence
$$ 0.1,\qquad 0.01,\qquad 0.001,\qquad 0.0001,\qquad \ldots
$$get closer and closer to $0$ with an arbitrary precision. Notice that this sequence approaches $0$ through values
$>0$. This arbitrary precision is what will be the gist of our
concept of ``nearness.'' ``Nearness'' is dynamic: it involves the
ability of getting closer to a point with any desired degree of
accuracy. It is not static.

\bigskip

Again, the points in the sequence $$-\dfrac{1}{2},\qquad
-\dfrac{1}{4},\qquad  -\dfrac{1}{8},\qquad  -\dfrac{1}{16},\qquad
\ldots $$ are arbitrarily close to $0$, but they ``approach''  $0$
from the left. Once again, the sequence
$$+\dfrac{1}{2},\qquad
-\dfrac{1}{3},\qquad  +\dfrac{1}{4},\qquad  -\dfrac{1}{5},\qquad
\ldots $$approaches $0$ from both above and below. After this long
preamble, we may formulate our first definition.
\begin{df}
The notation $x\rightarrow a$, read ``$x$ tends to $a$,'' means that
$x$ is very close, with an arbitrary degree of precision, to $a$.
Here $x$ can approach $a$ through values smaller or larger than $a$.
We write  $x\rightarrow a+$ (read ``$x$ tends to $a$ from the
right'') to mean that $x$ approaches $a$ through values larger than
$a$ and we write $x\rightarrow a-$ (read ``$x$ tends to $a$ from the
left'') we mean that $x$ approaches $a$ through values smaller than
$a$.
\end{df}
\begin{df}
A {\em neighbourhood of a point $a$} is an interval containing $a$.
\end{df}
Notice that the definition of neighbourhood does not rule out the
possibility that $a$ may be an endpoint of the the interval. Our
interests will be mostly on arbitrarily small neighbourhoods of a
point. Schematically we have a diagram like figure
\ref{fig:hyperrealline}.
\begin{figure}[h]
$$\psset{unit=1pc}\psline[linewidth=1.5pt]{<->}(-11, 0)(11,0)\uput[d](-11,0){-\infty}
\uput[d](11,0){+\infty}\uput[d](0,0){a}
\psline{<-}(.3,0)(1,1)\uput[ur](1,1){
a+}\psline{<-}(-.3,0)(-1,-1)\uput[dl](-1,-1){a-}\rput(0,0){|}
$$ \vspace{1cm}\footnotesize\hangcaption{A neighbourhood of $a$.}\label{fig:hyperrealline}
\end{figure}






\section{Miscellaneous Notation}
We will often use the symbol $\iff$ for ``if and only if'', and the
symbol $\implies$, ``implies.'' The symbol $\approx$ means {\em
approximately}. From time to time we use the set theoretic notation
below.


\begin{df}
The {\em union} of two sets $A$ and $B$, is the set
$$A\cup B = \{x:(x\in A)\ \mathrm{or}\ (x\in B)\}.$$
This is read ``$A$ union $B$.'' See figure \ref{fig:a_union_b}.

\bigskip

The {\em intersection} of two sets $A$ and $B$, is
$$A\cap B = \{x:(x\in A)\ \mathrm{and} \ (x\in B)\}.$$
This is read ``$A$ intersection $B$.'' See figure
\ref{fig:a_intersection_b}.
\end{df}
\vspace{1cm}
\begin{figure}[h]
\centering
\begin{minipage}{5cm}$$\psset{unit=1pc}
\pscircle[fillstyle=hlines,
fillcolor=red](-1,0){2}\pscircle[fillstyle=hlines,
fillcolor=red](1,0){2} \uput[d](-1,-2){A}\uput[d](1,-2){B}
$$\vspace{1cm}\footnotesize\hangcaption{$A\cup B$} \label{fig:a_union_b}
\end{minipage}
\begin{minipage}{5cm}$$ \psset{unit=1pc} \pscircle(-1,0){2}\pscircle(1,0){2}
\uput[d](-1,-2){A}\uput[d](1,-2){B}
\pscustom[fillstyle=solid,fillcolor=red]{\psarc(1,0){2}{120}{240}\psarc(-1,0){2}{270}{60}}
$$\vspace{1cm}\footnotesize\hangcaption{$A\cap B$} \label{fig:a_intersection_b}
\end{minipage}

\end{figure}
\vspace{1cm}

\begin{exa} If $A = [-10; 2]$, $B = ]-\infty; 1[$, then $$A \cap B = [-10; 1[,  \ \ \ A \cup B = ]-\infty; 2].    $$
\end{exa}

\chapter{Distance and Curves on the Plane}\thispagestyle{empty} The
main objective of this chapter is to introduce the distance formula
for two points on the plane, and by means of this distance formula,
the linking of certain equations with certain curves on the plane.
Thus the main object of these notes, that of relating a graph to a
formula, is partially answered.



\section{Distance on the Real Line}

\begin{df}
Let $x\in \BBR$.\index{absolute value} The {\em absolute value of
$x$}---denoted by $|x|$---is defined by
\begin{center}
 \fcolorbox{blue}{white}{ $ |x| =
\left\{
\begin{tabular}{ll}
$-x$       & \rm{if} \ $x < 0$, \\
$x$ & \rm{if} \ $x \geq 0$.
\end{tabular}
\right. $}
\end{center}
\end{df}The absolute value of a real number is thus the distance
of that real number to $0$, and hence $|x-y|$ is the distance
between $x$ and $y$ on the real line. Below are some properties of
the absolute value. Here $x, y, t$ are all real numbers.
\begin{equation}\label{eq:abs_val_interval}
-|x| \leq x \leq |x|.
\end{equation}
\begin{equation} |x-y| = |y-x|   \end{equation}
\begin{equation} \sqrt{x^2} = |x|   \end{equation}
\begin{equation} |x|^2 = |x^2| = x^2  \end{equation}
\begin{equation} |x| \leq t \iff -t \leq x \leq t  \ \ \ \ (t\geq 0)  \label{eq:|x|within_t}\end{equation}
\begin{equation}|x| \geq t \iff x \leq -t \ \mathrm{or}\  x \geq t  \ \ \ \ (t\geq 0) \ \end{equation}
\begin{equation}  |x + y| \leq |x| + |y| \label{eq:triangle_inequality1}\end{equation}
\begin{equation}||x| - |y||  \leq |x - y| \label{eq:triangle_inequality2}\end{equation}

\section{Distance on the Real Plane}

We now turn our attention to the plane, which we denote by the
symbol $\BBR^2$.


\bigskip

Consider two points $A = (x_1, y_1), B = (x_2, y_2)$ on the
Cartesian plane, as in figure \ref{fig:distance_formula}. Dropping
perpendicular lines to $C$, as in the figure, we can find their
Euclidean distance $AB$ with the aid of the Pythagorean Theorem. For
$$ AB^2 = AC^2 + BC^2,$$translates into
$$AB = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2.}$$ This motivates the following definition.
\begin{df}
Let $(x_1, y_1), (x_2, y_2)$ be points on the Cartesian plane. The
\index{distance!formula}\index{distance!Euclidean} {\em Euclidean
distance} between them is given by
\begin{equation}\fcolorbox{blue}{white}{$\distance{(x_1, y_1)}{(x_2, y_2)} =
\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}.$}\label{eq:distance_formula}
\end{equation}\end{df}
\vspace{3cm}
\begin{figure}[h]
$$
\psset{unit=2.5pc} \rput(-5, -1){\psline[linewidth=.4pt]{*-*}(3,
1.5)(6,4.5) \psdots[dotstyle=*,dotscale=2](3, 1.5)
(6,4.5)\uput{8pt}[l](3, 1.5){A} \uput{8pt}[l](6,4.5){B}
\uput{8pt}[dr](6,1.5){C} \psdots[dotstyle=*,dotscale=1](6, 1.5)
\psline[linestyle=dashed](3,1.5)(6,1.5)(6,4.5)
\pcline[offset=5pt]{|-|}(6.5, 1.5)(6.5, 4.5)\lput*{:U}{ |y_2 - y_1|}
\pcline[offset=5pt]{|-|}(3, 1)(6, 1) \lput*{:U}{ |x_2 - x_1|} }
$$
\footnotesize\hangcaption{Distance between two
points.}\label{fig:distance_formula}
\end{figure}

\begin{exa}
Find the Euclidean distance between $(-1, 2)$ and $(-3, 8)$.
\end{exa}
Solution: $$\distance{(-1, 2)}{(-3, -8)}   =  \sqrt{(-1 - (-3))^2 +
(2 - 8)^2}
  =  \sqrt{40}
  =  2\sqrt{10}
 \approx  6.32. $$

\section{Circles and Semicircles}
We now study our first curve on the plane: the circle. We will see
that the {\em equation} of a circle on the plane is a consequence of
the distance formula \ref{eq:distance_formula}.

\bigskip

Here is a way to draw a circle on sand: using a string, tie it to
what you wish to be the centre of the circle. Tighten up the string
now and trace the path followed by the other extreme of the string.
You now have a circle, whose radius is the length of the string.
Notice then that every point on the circumference is at a fixed
distance from the centre. This motivates the following.
\begin{thm}
A circle on the plane with radius $R$ and centre $(x_0,y_0)$ has
equation\index{circle!equation of a}
\begin{equation}
(x - x_0)^2 + (y - y_0)^2 = R^2,
\label{eq:canonical_circle}\end{equation}called the {\em canonical
equation} for a circle of radius $R$ and centre $(x_0, y_0)$.
Conversely, the graph  any equation of the form
\ref{eq:canonical_circle} is a circle.
\end{thm}
\begin{pf}
The point $(x, y)$ belongs to circle of radius $R$ and centre
$(x_0,y_0)$ $$ \begin{array}{llll} \iff &  \distance{(x, y)}{(x_0,
y_0)} & = & R \\
\iff & \sqrt{(x - x_0)^2 + (y - y_0)^2} & = & R \\
\iff & (x - x_0)^2 + (y - y_0)^2 & = & R^2\\
  \end{array},$$giving the desired result.
\end{pf}

\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}
$$\psset{unit=.6pc} \psaxes[labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\rput(3.5,3){\pscircle[linewidth=2pt, linecolor=red](0,0){4}
\uput[d](0,0){(x_0,y_0)} \pcline[offset=5pt]{**->}(0,
0)(1,3.87)\lput*{:U}{R}}
$$
\vspace{1cm}\footnotesize\hangcaption{A circle with centre $(x_0,
y_0)$ and radius $R$. } \label{fig:circle}\end{minipage} \hfill
\begin{minipage}{4cm}
$$ \psset{unit=.6pc} \psaxes[labels=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5) \pscircle[linewidth=2pt, linecolor=red](-1,2){6}
\psdots[dotstyle=*,dotscale=1](-1,2)(5,2)(-7,2)(-1,-4)(-1,8)
$$
\vspace{1cm}\footnotesize\hangcaption{Example \ref{ex:circle_1}. }
\label{fig:circle_1}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.6pc}\psaxes[labels=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\psarc[linewidth=2pt, linecolor=red](0,0){1}{0}{180}
$$\vspace{1cm}
\footnotesize\hangcaption{Example
\ref{ex:uppsem_1}}\label{fig:uppsem_1} \end{minipage}\hfill
\begin{minipage}{4cm}
$$\psset{unit=.6pc}\psaxes[labels=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\psarc[linewidth=2pt, linecolor=red](-1,2){3}{180}{360}
$$\vspace{1cm}
\footnotesize\hangcaption{Example
\ref{ex:lowsem_1}}\label{fig:lowsem_1}
\end{minipage}
\end{figure}

\begin{exa}
The equation of the circle with centre $(-1, 2)$ and radius $6$ is
$(x + 1)^2 + (y - 2)^2 = 36$. Observe that the points $(-1 \pm 6,
2)$ and $(-1, 2\pm 6)$ are on the circle. Thus $(-7, 2)$ is the
left-most point on the circle, $(5,2)$ is the right-most, $(-1, -4)$
is the lower-most, and $(-1, 8)$ is the upper-most. The circle is
shewn in figure \ref{fig:circle_1}.\label{ex:circle_1}\end{exa}
Solving for $y$ in $(x - x_0)^2 + (y - y_0)^2  = R^2$, we obtain $$
y = y_0 \pm \sqrt{R^2-(x-x_0)^2}.$$The choice of the $+$ sign gives
the upper half of the circle (the upper semicircle) and the $-$ sign
gives the lower semicircle. \index{semicircle!equation of a}
\begin{exa}
Sketch the curve $y = \sqrt{1 - x^2}$ \label{ex:uppsem_1}\end{exa}
Solution: Squaring, $y^2 = 1 - x^2$. Hence $x^2 + y^2 = 1.$ This is
the equation of a circle with centre at $(0, 0)$ and radius $1$. The
original equation describes the upper semicircle (since $y \geq 0)$.
The graph is shewn in figure \ref{fig:uppsem_1}.
\begin{exa}
Sketch the curve $y = 2-\sqrt{8 - x^2-2x}$
\label{ex:lowsem_1}\end{exa} Solution: We have $y-2 =
-\sqrt{8-x^2-2x}$. Squaring, $(y-2)^2 = 8-x^2-2x$. Hence, by
completing squares,
$$x^2 + 2x + 1 + (y-2)^2 = 9 \implies (x+1)^2 + (y-2)^2 = 9.$$
This is the equation of a circle with centre at $(-1, 2)$ and radius
$3$. The original equation describes the lower semicircle (since $y
\leq 2)$. The graph is shewn in figure \ref{fig:lowsem_1}.


\section{Lines}\label{sec:lines}
\begin{df}
Let $a$ and $b$ be real number constants. A {\em vertical line} on
the plane is a set of the form
$$\{(x, y): x = a\}.   $$Similarly, a {\em horizontal line} on
the plane is a set of the form
$$\{(x, y): y = b\}.$$
\end{df}
\vspace{3cm}
\begin{figure}[h]
\begin{minipage}{4.5cm}
$$ \psset{unit=1pc}
\psaxes[labels=none,
ticks=none,linewidth=1.2pt]{<->}(0,0)(-7,-7)(7,7)
\psline[linewidth=2pt,linecolor=red]{<->}(3,-6.5)(3,6.5)$$
\vspace{2cm}\footnotesize\hangcaption{A vertical line.}
\end{minipage} \hfill
\begin{minipage}{4.5cm}
$$ \psset{unit=1pc}
\psaxes[labels=none,
ticks=none,linewidth=1.2pt]{<->}(0,0)(-7,-7)(7,7)
\psline[linewidth=2pt,linecolor=red]{<->}(-6.5,-1)(6.5, -1)$$
\vspace{2cm}\footnotesize\hangcaption{A horizontal line.}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}
$$
\psset{unit=4pc} \rput(-5, -2.5){\psline[linewidth=2pt]{*-*}(3,
1.5)(6,4.5) \psdots[dotstyle=*,dotscale=2](3, 1.5)(4,
2.5)(6,4.5)\uput{8pt}[l](3, 1.5){(x_1,y_1)} \uput{8pt}[l](4,
2.5){(x, y)} \uput{8pt}[l](6,4.5){(x_2,y_2)}
\psline[linestyle=dashed,linewidth=2pt](3,1.5)(6,1.5)(6,4.5)
\psline[linestyle=dashed, linewidth=2pt](4,2.5)(4,1.5)
\pcline[offset=10pt]{|-|}(6.5, 1.5)(6.5, 4.5) \lput*{:U}{y_2 - y_1}
\pcline[offset=10pt]{|-|}(4.5, 1.5)(4.5, 2.5)\lput*{:U}{y - y_1}
\pcline[offset=10pt]{|-|}(3, 1)(4, 1) \lput*{:U}{x - x_1}
\pcline[offset=10pt]{|-|}(3, .7)(6, .7)\lput*{:U}{x_2 - x_1}}
$$
\vspace{2cm}\footnotesize\hangcaption{Theorem
\ref{thm:graph_mx+k}.}\label{fig:graph_mx+k}
\end{minipage}
\end{figure}
\begin{thm}\label{thm:graph_mx+k}
The equation of any  non-vertical line on the plane can be written
in the form $y = mx + k$, where $m$ and $k$ are real number
constants. Conversely, any  equation of the form $y = ax + b$, where
$a, b$ are fixed real numbers has as a line as a
graph.\index{line!equation of a}
\end{thm}
\begin{pf} If the line is parallel to the $x$-axis, that is, if it is horizontal, then it is of the
form $y = b$, where $b$ is a constant and so we may take $m = 0$ and
$k = b$. Consider now  a line non-parallel to any of the axes, as in
figure \ref{fig:graph_mx+k}, and let $(x,y)$,  $(x_1, y_1)$,  $(x_2,
y_2)$ be three given points on the line.  By similar triangles we
have
$$\dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{y - y_1}{x - x_1}, $$which, upon rearrangement, gives
$$y =  \left(\dfrac{y_2 - y_1}{x_2 - x_1}\right)x -x_1\left(\dfrac{y_2 - y_1}{x_2 - x_1}\right) + y_1,  $$
and so we may take $$m = \dfrac{y_2 - y_1}{x_2 - x_1}, \ \ \ k
=-x_1\left(\dfrac{y_2 - y_1}{x_2 - x_1}\right) + y_1.
$$

\bigskip

Conversely, consider real numbers $x_1 < x_2 < x_3$, and let $P=
(x_1, ax_1 + b)$, $Q= (x_2, ax_2 + b)$, and $R= (x_3, ax_3 + b)$ be
on the graph of the equation $y=ax+b$. We will shew that
$$\distance{P}{Q} + \distance{Q}{R} = \distance{P}{R}.   $$ Since
the points $P, Q, R$ are arbitrary, this means that any three points
on the graph of the equation $y=ax+b$ are collinear, and so this
graph is a line. Then
$$ \distance{P}{Q} = \sqrt{(x_2 - x_1)^2 + (ax_2 - ax_1)^2} = |x_2 - x_1|\sqrt{1 + a^2} = (x_2 - x_1)\sqrt{1 + a^2},  $$
$$ \distance{Q}{R} = \sqrt{(x_3 - x_2)^2 + (ax_3 - ax_2)^2} = |x_3 - x_2|\sqrt{1 + a^2} = (x_3 - x_2)\sqrt{1 + a^2},  $$
$$ \distance{P}{Q} = \sqrt{(x_3 - x_1)^2 + (ax_3 - ax_1)^2} = |x_3 - x_1|\sqrt{1 + a^2} = (x_3 - x_1)\sqrt{1 + a^2},  $$
from where $$\distance{P}{Q} + \distance{Q}{R} = \distance{P}{R}
$$follows. This means that the points $P, Q,$ and $R$ lie on a
straight line, which finishes the proof of the theorem.
\end{pf}
\begin{rem}
The quantity $m = \dfrac{y_2 - y_1}{x_2 - x_1}$ in Theorem
\ref{thm:graph_mx+k} is the {\em slope of the line joining
$(x_1,y_1)$ and $(x_2,y_2)$}. Since $y = m(0) + k$, the quantity $k$
is the {\em $y$-intercept of the line joining $(x_1,y_1)$ and
$(x_2,y_2)$}. \index{line!slope of a}\index{line!intercept}
\end{rem}
\vspace{2cm}
\begin{figure}[h]
\centering
\begin{minipage}{5cm}
$$\psset{unit=1pc} \psline[linewidth=2pt, linecolor=red]{<->}(-4.5, -4.5)(4.5, 4.5) \psaxes[labels=none,linewidth=2pt]{<->}(0, 0)(-4.5,
-4.5)(4.5, 4.5)
$$\vspace{1cm}\footnotesize\hangcaption{Example \ref{ex:y=x}.}\label{fig:y=x}
\end{minipage}
\begin{minipage}{5cm}
$$\psset{unit=1pc}\rput(-1,-2){  \psline[linewidth=2pt, linecolor=red]{<->}(-1, 6.6667)(4, -1.6667)
\psaxes[labels=none,linewidth=2pt]{<->}(0, 0)(-2, -2)(5, 7)
\psdots[dotstyle=*,dotscale=1](0, 5)(3, 0)}
$$\vspace{1cm}\footnotesize\hangcaption{Example \ref{ex:line1}.}\label{fig:line1}
\end{minipage}
\end{figure}
\begin{exa}\label{ex:y=x} By Theorem \ref{thm:graph_mx+k}, the equation
$y=x$ represents a line with slope $1$ and passing through the
origin. Since $y=x$, the line makes a $45^\circ$ angle with the
$x$-axis, and bisects quadrants I and III. See figure \ref{fig:y=x}
\end{exa}
\begin{exa}\label{ex:line1}
A line passes through  $(-3, 10)$ and $(6, -5)$. Find its equation
and draw it. \label{ex_lin_2}\end{exa} Solution: The equation is of
the form $y = mx + k$. We must find the slope and the $y$-intercept.
To find $m$ we compute the ratio
$$m = \frac{10 - (-5)}{-3 - 6} = -\frac{5}{3}.$$Thus the equation is of the form $y = -\dis{\frac{5}{3}}x + k$ and we must now
determine $k$. To do so, we substitute either point, say the first,
into $y = -\dis{\frac{5}{3}}x + k$ obtaining $10 =
-\dis{\frac{5}{3}}(-3) + k$, whence $k = 5$. The equation sought is
thus $y = -\dis{\frac{5}{3}}x + 5$. To draw the graph, first locate
the $y$-intercept (at $(0, 5)$). Since the slope  is
$\dis{-\frac{5}{3}}$, move five units down (to $(0, 0)$) and three
to the right (to $(3, 0)$). Connect now the points $(0, 5)$ and $(3,
0)$. The graph appears in figure \ref{fig:line1}.
\subsection{Parallel and Perpendicular Lines} The material here will be
needed for example \ref{exa:tangent_to_circle} and so it is optional
if this example is omitted.
\begin{df} Two lines are parallel if they have the same
slope.\end{df}
\begin{exa}
Find the equation of the line passing through $(4, 0)$ and parallel
to the line joining $(-1, 2)$ and $(2, -4)$.
\end{exa}
Solution: First we compute the slope  of the line joining $(-1, 2)$
and $(2, -4)$:
$$ m = \frac{2 - (-4)}{-1 - 2} = -2.$$The line we seek is of the form $y = -2x + k$. We
now compute the $y$-intercept, using the fact that the line must
pass through $(4, 0)$. This entails solving $0 = -2(4) + k$, whence
$k = 8$. The equation sought is finally $y = -2x + 8$.


\begin{thm}\label{thm:perpendicular_line_slope} Let $y = mx + k$ be a line non-parallel to the axes.  If the line
$y = m_1x + k_1$ is {\rm perpendicular} to $y = mx + k$ then
$\dis{m_1 = -\frac{1}{m}}.$ \end{thm}
\begin{pf} Refer to figure \ref{fig:perpendicular_line_slope}. Since we may translate lines without affecting the angle
between them, we assume without loss of generality that both $y = mx
+ k$ and $y = m_1x + k_1$ pass through the origin, giving thus $k =
k_1 = 0.$ Now, the line $y = mx$ meets the vertical line $x = 1$ at
$(1, m)$ and the line $y = m_1x$ meets this same vertical line at
$(1, m_1)$ (see figure \ref{fig:perpendicular_line_slope}). By the
Pythagorean Theorem
$$ (m - m_1)^2 = (1 + m^2) + (1 + m_1 ^2). $$ Upon simplifying we
gather that $mm_1 = -1,$ which proves the assertion.
\end{pf}
\vspace{2cm}
\begin{figure}[h]
$$\psset{unit=1.7pc} \psaxes[labels=none, ticks=none,linewidth=1.5pt]{<->}(0, 0)(-3, -3)(3, 3)
\psline[linewidth=2pt, linecolor=red, labels=none,
showpoints=true]{<->}(-2, -2)(0, 0)(2, 2) \psline[linewidth=2pt,
labels=none, showpoints=true, linecolor=blue]{<->}(-2, 2)(0, 0)(2,
-2) \psline[linewidth=2pt, labels=none, showpoints=true,
linecolor=green]{<->}(1, 2.5)(1, -2.5) \rput(2.5, 2.3){\qquad y =
mx} \rput(2.5, -2.3){\qquad y = m_1x} \rput(1, 1){\bullet} \rput(1,
-1){\bullet} \rput(2, 1){\qquad (1, m)} \rput(2, -1){\qquad (1,
m_1)}
$$
\vspace{2cm}\footnotesize\hangcaption{Theorem
\ref{thm:perpendicular_line_slope}.}\label{fig:perpendicular_line_slope}.
\end{figure}


\begin{exa}
Find the equation of the line passing through $(4, 0)$ and
perpendicular to the line joining
 $(-1, 2)$ and $(2, -4)$.
\end{exa}
Solution: By the preceding problem, the slope  of the line joining
$(-1, 2)$ and $(2, -4)$ is $-2.$ The slope  of the perpendicular
line is
$$ m_1 = -\frac{1}{m} = \frac{1}{2}.$$The equation sought has the form
$\dis{y = \frac{x}{2} + k}$. We find the $y$-intercept by solving $0
= \frac{4}{2} + k,$ whence $k = -2$. The equation of the
perpendicular line is thus $y = \frac{x}{2} - 2$.
\begin{exa}
For a given real number $t$, associate the straight line $L_t$ with
the equation
$$ L_t: \ \ (4 - t)y = (t + 2)x + 6t.
$$
\begin{dingautolist}{202}
\item Determine $t$ so that the $L_t$ be parallel to the $x$-axis
and determine the equation of the resulting line.\item Determine $t$
so that the $L_t$ be parallel to the $y$-axis and determine the
equation of the resulting line.  \item Determine $t$ so that the
$L_t$ be parallel to the line $-5y = 3x - 1$.
\item Determine $t$ so that the $L_t$ be perpendicular to the line
$-5y = 3x-1$.
\item Is there a point $(a, b)$ belonging to every line $L_t$
regardless of the value of $t$?
\end{dingautolist}\end{exa}
Solution: \begin{dingautolist}{202} \item We need $t + 2 = 0
\implies t = -2$. In this case $$(4 -(-2))y =  -12 \implies y = -2.
$$ \item    We need $4 - t = 0 \implies t = 4$. In this case
$$0  = (4 + 2)x + 24 \implies x = -4.
$$  \item  The slope of $L_t$ is
$$ \dfrac{t + 2}{4 - t},  $$and the slope of the line $-5y = 3x - 1$ is
$-\dfrac{3}{5}$. Therefore we need $$\dfrac{t + 2}{4 - t} =
-\dfrac{3}{5} \implies -3(4 - t) = 5(t + 2)  \implies t = -11. $$
\item  In this case we need $$\dfrac{t + 2}{4 - t} = \dfrac{5}{3}
\implies 5(4 - t) = 3(t + 2)  \implies t = \dfrac{7}{4}.
$$
\item Yes. From above, the obvious candidate is $(-4,-2)$. To verify
this observe that $$(4-t)(-2) = (t+2)(-4) + 6t,   $$regardless of
the value of $t$.
\end{dingautolist}







\section{Parabolas}
\begin{df}
A {\em parabola}\index{parabola} is the collection of all the points
on the plane whose distance from a fixed point $F$ (called the {\em
focus}\index{parabola!focus} of the parabola) is equal to the
distance to a fixed line $L$ (called the {\em directrix}
\index{parabola!directrix} of the parabola). See figure
\ref{fig:parabola_definition}, where $FD = DP$.
\end{df}
We can draw a parabola as follows. Cut a piece of thread as long as
the trunk of T-square (see figure \ref{fig:drawing_parabola}). Tie
one end to the end of the trunk of the T-square and tie the other
end to the focus, say, using a peg. Slide the crosspiece  of the
T-square along the directrix, while maintaining the thread tight
against the ruler with a pencil. \vspace{1cm}
\begin{figure}[h]
\hfill
\begin{minipage}{5cm}
$$\psset{unit=1pc, algebraic=true} \rput(-1,-2){\psline[linewidth=2pt,linecolor=red]{<->}(-4,-1)(4,-1)
\parabola[linecolor=red,linewidth=2pt]{<->}(3,2.25)(0,0)
\psline[linecolor=blue,linewidth=2pt](0,1)(2,1)(2,-1)\psdots[dotstyle=*,dotscale=1](0,1)(2,1)(2,-1)
\uput[u](0,1){F}\uput[r](2,1){D}\uput[d](2,-1){P}\uput[r](4,-1){L} }
$$
\vspace{1cm}\footnotesize\hangcaption{Definition of a parabola.}
\label{fig:parabola_definition}
\end{minipage}
\hfill
\begin{minipage}{5cm}
$$\psset{unit=1pc, algebraic=true} \rput(-1,-2){\psline[linewidth=2pt,linecolor=red]{<->}(-4,-1)(4,-1)
\parabola[linecolor=red,linewidth=2pt]{<->}(3,2.25)(0,0)
\psline[linecolor=blue,linewidth=2pt](0,1)(2,1)(2,4)
\psdots[dotstyle=*,dotscale=1](0,1)(2,1)(2,4)
%%%T-square cross-section
\pspolygon[fillstyle=solid,fillcolor=black,
linewidth=2pt](1,-1.3)(1,-1.1)(3,-1.1)(3,-1.3)
%%%T-square trunk
\pspolygon[fillstyle=solid,fillcolor=black,
linewidth=2pt](2.15,-1)(2.265,-1)(2.265,4)(2.15,4)}
$$
\vspace{1cm}\footnotesize\hangcaption{Drawing a parabola.}
\label{fig:drawing_parabola}
\end{minipage}
\hfill
\begin{minipage}{5cm}
$$ \psset{unit=1pc}\psaxes[xyLabel={\tiny},linewidth=2pt]{<->}(0,0)(-5,-5)(5,5)\parabola[linecolor=red,linewidth=2pt]{<->}(2.2361,5)(0,0) $$
\vspace{1cm}\footnotesize \hangcaption{Example
\ref{exa:y=x^2}.}\label{fig:y=x^2} \end{minipage}
\end{figure}

\begin{thm}\label{thm:parabola_equation}
Let $d>0$ be a real number. The equation of a parabola with focus at
$(0,d)$ and directrix $y=-d$ is $y=\dfrac{x^2}{4d}$.
\end{thm}
\begin{pf}
Let $(x, y)$ be an arbitrary point on the parabola. Then the
distance of $(x, y)$ to the line $y=-d$ is $|y+d|$. The distance of
$(x, y)$ to the point $(0,d)$ is $\sqrt{x^2+(y-d)^2}$. We  have
$$ \begin{array}{lll}|y+d|= \sqrt{x^2+(y-d)^2} & \implies & (|y+d|)^2 = x^2+(y-d)^2\\
& \implies & y^2+2yd+d^2 = x^2+y^2-2yd+d^2\\
& \implies & 4dy = x^2 \\
& \implies & y = \dfrac{x^2}{4d},
\end{array}$$as wanted.
\end{pf}
\begin{rem}
Observe that the midpoint of the perpendicular line segment from the
focus to the directrix is on the parabola. We call this point the
{\em vertex}\index{parabola!vertex}. For the parabola
$y=\dfrac{x^2}{4d}$ of Theorem \ref{thm:parabola_equation}, the
vertex is clearly $(0,0)$.
\end{rem}
\begin{exa}\label{exa:y=x^2}
Draw the parabola $y = x^2$.
\end{exa}Solution: From Theorem \ref{thm:parabola_equation}, we want
$\dfrac{1}{4d}=1$, that is, $d=\dfrac{1}{4}$. Following Theorem
\ref{thm:parabola_equation}, we locate the focus at
$(0,\frac{1}{4})$ and the directrix at $y=-\dfrac{1}{4}$ and use a
T-square with these references. The vertex of the parabola is at
$(0,0)$. The graph is in figure  \ref{fig:y=x^2}.

\section{Hyperbolas}
\begin{df}
A {\em hyperbola}\index{hyperbola} is the collection of all the
points on the plane whose absolute value of the difference of the
distances from two distinct fixed points $F_1$ and $F_2$ (called the
{\em foci}\footnote{{\em Foci} is the plural of {\em
focus}.}\index{hyperbola!foci} of the hyperbola) is a positive
constant.  See figure \ref{fig:hyperbola_definition}, where
$|F_1D-F_2D| = |F_1D'-F_2D'|$.
\end{df}
We can draw a hyperbola as follows. Put tacks on $F_1$ and $F_2$ and
measure the distance $F_1F_2$. Attach piece of thread to one end of
the ruler, and the other to $F_2$, while letting the other end of
the ruler to pivot around $F_1$. The lengths of the ruler and the
thread must satisfy
$$\mathrm{length\ of\ the\ ruler} - \mathrm{length\ of\ the\ thread}
< F_1F_2.$$Hold the pencil against the side of the rule and tighten
the thread, as in figure \ref{fig:drawing_hyperbola}. \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{5cm}
$$\psset{unit=.8pc, algebraic=true}
\psline[linestyle=dotted](1.414213562,
1.414213562)(2,.5)(-1.414213562,-1.414213562)\psline[linestyle=dashed](1.414213562,
1.414213562)(-5,-.2)(-1.414213562,-1.414213562)
\uput[dl](-1.414213562,-1.414213562){F_1}\uput[ur](1.414213562,1.414213562){F_2}\uput[ur](2,.5){D}
\uput[dl](-5,-.2){D'}\psplot[linewidth=2pt,linecolor=red]{-.166666666}{-6}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666666}{6}{1/x}\psdots[dotscale=1,dotstyle=*](1.414213562,
1.414213562)(-1.414213562,-1.414213562)(2,.5)(-5,-.2)$$
\vspace{2cm}\footnotesize\hangcaption{Definition of a
hyperbola.}\label{fig:hyperbola_definition}\end{minipage}\hfill
\hfill
\begin{minipage}{5cm}
$$\psset{unit=.8pc, algebraic=true}
\psplot[linewidth=2pt,linecolor=red,
linestyle=dotted]{-.166666666}{-6}{1/x}
\psplot[linewidth=2pt,linecolor=red,
linestyle=dotted]{.166666666}{6}{1/x}
 \rput{60.72238682}(-1.6,
-1.2){\pspolygon[fillstyle=solid,fillcolor=black,linewidth=2pt](0,0)(7,0)(7,.5)(0,.5)}
\rput{60.72238682}(.5,2){\psline[linecolor=blue,linewidth=2pt](0,0)(3.2,0)\psdots[dotscale=1,dotstyle=*](0,0)(3.2,0)}
\psline[linecolor=blue,linewidth=2pt](1.414213562,
1.414213562)(.5,2) \psdots[dotscale=1,dotstyle=*](1.414213562,
1.414213562)(-1.414213562,-1.414213562)
$$
\vspace{2cm}\footnotesize\hangcaption{Drawing  a
hyperbola.}\label{fig:drawing_hyperbola}\end{minipage} \hfill
\begin{minipage}{5cm}
$$\psset{unit=.8pc, algebraic=true}
\psaxes[linewidth=1.2pt,labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-.166666666}{-6}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666666}{6}{1/x}$$
\vspace{2cm}\footnotesize\hangcaption{The hyperbola $y =
\dfrac{1}{x}$.}\label{fig:xy=1}\end{minipage}
\end{figure}




\begin{thm}\label{thm:hyperbola_equation}
Let $c>0$ be a real number. The hyperbola with foci at $F_1 =
(-c,-c)$ and $F_2=(c,c)$, and whose  absolute value of the
difference of the distances from its points to the foci is $2c$ has
equation $xy = \dfrac{c^2}{2}$.
\end{thm}
\begin{pf}
Let $(x, y)$ be an arbitrary point on the hyperbola. Then
$$\begin{array}{l} \left|\distance{(x,y)}{(-c,-c)} - \distance{(x,y)}{(c,c)}\right| = 2c \\ \iff
 \left|\sqrt{(x+c)^2+(y+c)^2} - \sqrt{(x-c)^2+(y-c)^2}\right| = 2c\\
 \iff
 (x+c)^2+(y+c)^2 +(x-c)^2+(y-c)^2 - 2\sqrt{(x+c)^2+(y+c)^2}\cdot\sqrt{(x-c)^2+(y-c)^2} = 4c^2\\
 \iff
 2x^2 + 2y^2  = 2\sqrt{(x^2 + y^2 + 2c^2)+(2xc+2yc)}\cdot\sqrt{(x^2 + y^2 + 2c^2)-(2xc+2yc)} \\
 \iff
 2x^2 + 2y^2  = 2\sqrt{(x^2 + y^2 + 2c^2)^2-(2xc+2yc)^2} \\
 \iff
 (2x^2 + 2y^2)^2 = 4\left((x^2 + y^2 + 2c^2)^2-(2xc+2yc)^2\right) \\
\iff 4x^4 + 8x^2y^2 + 4y^4 = 4((x^4+y^4+4c^4+2x^2y^2 + 4y^2c^2 +
4x^2c^2)-(4x^2c^2 + 8xyc^2 + 4y^2c^2)) \\
\iff xy = \dfrac{c^2}{2},
\end{array}
$$ where we have used the identities $$(A + B+C)^2 = A^2+ B^2 + C^2 + 2AB+2AC + 2BC\qquad  \mathrm{and}
\qquad \sqrt{A-B}\cdot \sqrt{A+B} = \sqrt{A^2-B^2}.$$
\end{pf}
\begin{rem}
Observe that the points $\left(-\dfrac{c}{\sqrt{2}},
-\dfrac{c}{\sqrt{2}}\right)$ and $\left(\dfrac{c}{\sqrt{2}},
\dfrac{c}{\sqrt{2}}\right)$ are on the hyperbola $xy=
\dfrac{c^2}{2}$. We call these points the {\em
vertices}\footnote{{\em Vertices} is the plural of {\em
vertex}.}\index{hyperbola!vertices} of the hyperbola  $xy=
\dfrac{c^2}{2}$.
\end{rem}


\begin{exa}\label{exa:y=1/x}To draw the hyperbola $y = \dfrac{1}{x}$
we  proceed as follows. According to Theorem
\ref{thm:hyperbola_equation}, its two foci are at $(-\sqrt{2},
-\sqrt{2})$ and $(\sqrt{2}, \sqrt{2})$. Put $$\mathrm{length\ of\
the\ ruler} - \mathrm{length\ of\ the\ thread} = 2\sqrt{2}.$$ By
alternately pivoting about these points using the procedure above,
we get the picture in figure \ref{fig:xy=1}.
\end{exa}
\chapter{Functions}\thispagestyle{empty} This chapter introduces the
central concept of a function. We concentrate on real-valued
functions whose domains are subsets of the real numbers. We will use
the curves obtained in the last chapter as examples to see how
various transformations affect the graph of a function.
\section{Functions}
\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{7cm}
$$ \psset{unit=.7cm}\rput(-2,0){ \pscircle(-2,0){2}
\psellipse[fillcolor=yellow, fillstyle=solid](6.5,0)(5,2.2)
\pscircle[fillcolor=white, fillstyle=solid](6,0){2}
\psline[linewidth=.7pt, labels=none,
showpoints=true]{*->>}(-1.8,0)(5.9,0) \psline[linewidth=.7pt,
labels=none, showpoints=true]{*->>}(-1.8,.5)(5.9,.5)
\psline[linewidth=.7pt, labels=none,
showpoints=true]{*->>}(-1.8,-.5)(5.9,-.5)
\rput(-2, -1){{\rm domain\ }}%
\rput(6,1){{\rm image\ }}%
\rput(1,1){{\rm rule\ } }%
\rput(10, 0){{\rm target\ set\ }}%
\psdots*[linewidth=.5pt](-2,0)(-2, .5)(-2, -.5)(6,0)(6,.5)(6,
-.5)(8.3,1)(8.3,.5)}
$$ \vspace{3cm}
\footnotesize\hangcaption{The main ingredients of a function.}
\label{df:function}\end{minipage}\hfill
\begin{minipage}{7cm}
$$\psset{unit=1pc, algebraic=true} \psaxes[linewidth=2pt,
labels=none, ticks=none]{<->}(0,0)(-6.5,-6.5)(6.5,6.5)
\psline[linestyle=dotted](0,4.400999546)(2.2,4.400999546)(2.2,0)
\psplot[linewidth=2pt, linecolor=red]{-4}{4}{(x^2)*(sin(x/1.1))}
\psdots[dotscale=1,dotstyle=*](2.2,4.400999546)
\uput[u](2.2,4.400999546){(x, f(x))}\uput[l](0,4.400999546){f(x)}
\uput[d](2.2,0){x}
$$\vspace{3cm}\footnotesize\hangcaption{The graph of a function.}\label{fig:graph_function}
\end{minipage}
\end{figure}

\begin{df}
By a {\em function}\index{function} $f:\dom{f}\rightarrow\target{f}$
we mean the collection of the following ingredients:
\begin{dingautolist}{202} \item a {\em name} for the function.
Usually we use the letter $f$.
\item  a set of real number inputs---usually an interval or a finite union of intervals---called the {\em domain} of the
function. The domain of $f$ is denoted by $\dom{f}$. \item an {\em
input parameter }, also called {\em independent variable} or {\em
dummy variable}. We usually denote a typical input by the letter
$x$.\index{function!domain}
\item a set of possible real number outputs---usually an interval or
a finite union of intervals---of the function, called the {\em
target set} of the function. The target set of $f$ is denoted by
$\target{f}$.\index{function!target set}
\item an {\em assignment rule} or {\em formula}, assigning to {\bf
every  input} a {\bf unique} output. This assignment rule for $f$ is
usually denoted by $x\mapsto f(x)$. The output of $x$ under $f$ is
also referred to as the {\em image of $x$ under $f$},
\index{function!image} and is denoted by $f(x)$.
\index{function!assingment rule}
\end{dingautolist} The notation\footnote{Notice the difference in the arrows. The straight arrow $\longrightarrow$ is
used to mean that a certain set is associated with another set,
whereas the arrow $\mapsto$ (read ``maps to'') is used to denote
that an input becomes a certain output.}
$$\fun{f}{x}{f(x)}{\dom{f}}{\target{f}}
$$ read ``the function $f$, with domain $\dom{f}$, target set
$\target{f}$, and assignment rule $f$ mapping $x$ to $f(x)$''
conveys all the above ingredients.  See figure \ref{df:function}.
\end{df}
\begin{df}
The {\em graph}\index{function!graph} of a function
$\fun{f}{x}{f(x)}{\dom{f}}{\BBR}$ is the set  $\{(x,y)\in\BBR^2 :
y=f(x)\}$ on the plane. For ellipsis, we usually say {\em the graph
of $f$}, or {\em the graph $y=f(x)$} or the {\em the curve
$y=f(x)$}. See figure \ref{fig:graph_function}.
\end{df}
\begin{rem}
From now on, unless otherwise stated, we will take $\BBR$  as the
target set of all the functions below.
\end{rem}
It must be emphasised that the uniqueness of the image of an element
of the domain is crucial. For example, the diagram in figure
\ref{mult_ima} {\em does not} represent a function. The element $1$
in the domain is assigned to more than one element of the target
set. Also important in the definition of a function is the fact that
{\em all the elements} of the domain must be operated on. For
example, the diagram in \ref{non-exhau} {\em does not} represent a
function. The element $3$ in the domain is not assigned to any
element of the target set. Also, by the definition of the graph of a
function, the $x$-axis contains the set of inputs and $y$-axis has
the set of outputs. Therefore, if a vertical line crosses two or
more points of a graph, the graph does not represent a function. See
figures \ref{fig:not_functions1} and \ref{fig:not_functions2}.
\vspace{2cm}

\begin{figure}[h]
%NOTE: Beware of leaving blank spaces whenever you are in the PSTRICKS
%environment. It does not tolerate blank horizontal lines and it will
%give you an error in your LaTeX run
\centering
\begin{minipage}{4cm}$$ \psset{unit=2pc}\rput(5,0){\rput(-7,0){
\rput(0, -.5){3} \psline[linewidth=.4pt, labels=none,
showpoints=true]{*->>}(.2,0)(2.9,-.5) \rput(3, -.5){8} \rput(0,0){1}
\psline[linewidth=.4pt, labels=none,
showpoints=true]{*->>}(.2,0)(2.9,0) \rput(3,0){2} \rput(0, .5){2}
\psline[linewidth=.4pt, labels=none,
showpoints=true]{*->>}(.2,.5)(2.9,.5) \rput(3,.5){4}
\psline[linewidth=.4pt, labels=none,
showpoints=true]{*->>}(0.2,-.5)(2.9,-1) \psellipse(1,2)
\psellipse(3,0)(1,2) \rput(3, -1){16}} }$$\vspace{1cm}
\footnotesize\hangcaption{Not a
function.}\label{mult_ima}\end{minipage}\hfill
\begin{minipage}{4cm}
$$\psset{unit=2pc}\rput(-1,0){\rput(0,0){1} \rput(0,.5){0} \rput(0, -.5){3} \rput(3,.5){4}
\rput(3, -.5){8} \psellipse(1,2) \psellipse(3,0)(1,2)
\psline[linewidth=.4pt, labels=none,
showpoints=true]{*->>}(0.2,0)(2.9,-.5) \psline[linewidth=.4pt,
labels=none, showpoints=true]{*->>}(0.2,.5)(2.9,.5)}
$$ \vspace{1cm}
\footnotesize\hangcaption{Not a function.} \label{non-exhau}
\end{minipage}
\hfill \begin{minipage}{4cm}
$$ \psset{unit=.7pc}
\renewcommand{\pshlabel}[1]{{\tiny #1}}
\renewcommand{\psvlabel}[1]{{\tiny #1}}\psaxes[labels=none](0,0)(-5,-5)(5,5)
\psline[linewidth=2pt,linecolor=red]{<->}(-4,4)(-4,2)(3,2)(3,1)(-3,1)$$
\vspace{1cm}\footnotesize\hangcaption{Not a
function.}\label{fig:not_functions1}
\end{minipage}
\hfill \begin{minipage}{4cm}
$$\psset{unit=.7pc, algebraic=true}
\renewcommand{\pshlabel}[1]{{\tiny #1}}
\renewcommand{\psvlabel}[1]{{\tiny #1}}\psaxes[labels=none](0,0)(-5,-5)(5,5)\psplot[linewidth=2pt,linecolor=red]{-1}{2}{sqrt(x^3+1)} \psplot[linewidth=2pt,linecolor=red]{-1}{2}{-1*sqrt(x^3+1)}
$$\vspace{1cm}\footnotesize\hangcaption{Not a function.} \label{fig:not_functions2}
\end{minipage}
\end{figure}
\begin{exa}[The Identity Function]\index{function!identity}
Consider the function $$\fun{\idefun}{x}{x}{\BBR}{\BBR}.$$ This
function assigns to every real its own value. Thus $\idefun (-1) =
-1$, $\idefun (0) = 0$, $\idefun (4) = 4$, etc. By Theorem
\ref{thm:graph_mx+k}, the graph of identity function is a straight
line, and it is given in figure \ref{fig:idefun}.
\end{exa}
\begin{exa}[The Square Function]\index{function!square}
Consider the function $$\fun{\idefun^2}{x}{x^2}{\BBR}{\BBR}.$$ This
function assigns to every real its square. Thus $\idefun^2 (-1) =
1$, $\idefun^2 (0) = 0$, $\idefun^2 (2) = 4$, etc. By Theorem
\ref{thm:parabola_equation}, the graph of the square function is
given in figure \ref{fig:idefun^2}. \label{exa:square_function}
\end{exa}

\begin{rem}
For ellipsis, we usually refer to the identity function
$\fun{\idefun}{x}{x}{\BBR}{\BBR}$ as ``the function $\idefun$'' or
``the function $x\mapsto x$.'' Similarly, in situations when the
domain of a function is not in question, we will simply give the
assignment rule or the name of the function. So we will speak of
``the function $f$'' or``the function $x\mapsto f(x)$,'' e.g., ``the
function $\idefun^2$'' or ``the function $x\mapsto x^2$.''
\end{rem}
\begin{exa}\label{ex:sqrt(1-x^2)}
Consider the function\footnote{Since we are concentrating
exclusively on real-valued functions, the formula for $f$ only makes
sense in the interval $[-1;1]$.}
$$\fun{f}{x}{\sqrt{1-x^2}}{[-1;1]}{\BBR}.$$ Then  $f(-1) = 0$, $f(0) = 1$,
$f\left(\frac{1}{2}\right) = \dfrac{\sqrt{3}}{2} \approx .866$, etc.
By Example \ref{ex:uppsem_1}, the graph of $f$ is the upper unit
semicircle, which is shewn in  figure \ref{fig:sqrt(1-x^2)}.
\end{exa}
\begin{exa}[The Reciprocal function]\label{exa:reciprocal_function}
Consider the function\footnote{$g$ only makes sense when $x\neq 0$.}
$$\fun{g}{x}{\dfrac{1}{x}}{\BBR\setminus \{0\}}{\BBR}.$$ Then  $g(-1) = -1$, $g(1) = 1$,
$g\left(\frac{1}{2}\right) = 2$, etc. By Example \ref{exa:y=1/x},
the graph of $g$ is the hyperbola shewn in figure \ref{fig:y=1/x}.
\end{exa}
\vspace{1cm} \begin{figure}[h]
\begin{minipage}{3.5cm}
$$\psset{unit=.8pc,algebraic=true}\psaxes[linewidth=1.2pt,labels=none]{<->}(0,0)(-4.5,-4.5)(4.5,4.5)
\psline[linecolor=red,linewidth=2pt]{<->}(-4.5,-4.5)(4.5,4.5) $$
\vspace{1cm}\footnotesize\hangcaption{$\idefun$}\label{fig:idefun}\end{minipage}
\hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.8pc,algebraic=true}\psaxes[linewidth=1.2pt,labels=none]{<->}(0,0)(-4.5,-4.5)(4.5,4.5)
\parabola[linecolor=red,linewidth=2pt]{<->}(2.2,4.84)(0,0)$$
\vspace{1cm}\footnotesize\hangcaption{$\idefun^2$}\label{fig:idefun^2}\end{minipage}
\hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.8pc,algebraic=true}\psaxes[linewidth=1.2pt,labels=none]{<->}(0,0)(-4.5,-4.5)(4.5,4.5)
\psplot[linecolor=red,linewidth=2pt]{-1}{1}{sqrt(1-x^2)}\psdots[dotstyle=*,dotscale=1](-1,
0)(1,0)$$ \vspace{1cm}\footnotesize\hangcaption{$x\mapsto
\sqrt{1-x^2}$}\label{fig:sqrt(1-x^2)}
\end{minipage} \hfill
 \hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.8pc, algebraic=true}
\psaxes[linewidth=1.2pt,labels=none]{<->}(0,0)(-4.5,-4.5)(4.5,4.5)
\psplot[linewidth=2pt,linecolor=red]{-.22222222}{-4.5}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.22222222}{4.5}{1/x}$$
\vspace{1cm}\footnotesize\hangcaption{$x\mapsto
\dfrac{1}{x}$}\label{fig:y=1/x}\end{minipage}
\end{figure}

\section{Piecewise Functions}
Sometimes the assignment rule of a function varies from interval to
interval. We call any such function a {\em piecewise function}.
\index{function!piecewise}
\begin{exa}\label{exa:piecewise1}
A function $f$ is only defined for $x\in [-4;4]$, and it is made of
straight lines, as in figure \ref{fig:piecewise1}. Find a piecewise
formula for $f$.
\end{exa}
Solution: The first line segment $\mathscr{L}_1$ has slope
$$\mathrm{slope}\ \mathscr{L}_1 = \dfrac{1 - (-3)}{-1 - (-4)} = \dfrac{4}{3},    $$
and so the equation of the line containing this line segment is of
the form $y = \dfrac{4}{3}x + k_1$. Since $(-1,1)$ is on the line,
$1 = -\dfrac{4}{3} + k_1 \implies k_1 = \dfrac{7}{3}$, so this line
segment is contained in the line $y = \dfrac{4}{3}x + \dfrac{7}{3}$.
The second line segment $\mathscr{L}_2$ has slope
$$\mathrm{slope}\ \mathscr{L}_2 = \dfrac{1 - 1}{2 - (-1)} = 0,
$$ and so this line segment is contained in the line $y = 1$. Finally,
the third line segment $\mathscr{L}_3$ has slope
$$\mathrm{slope}\ \mathscr{L}_3 = \dfrac{-5 - 1}{4-2} = -3,    $$and
so this line segment is part of the line of the form $y = -3x +
k_2$. Since $(1,2)$ is on the line, we have $2 = -3 + k_2 \implies
k_2 = 5$, and so the line segment is contained on the line $y = -3x
+ 5$. Upon assembling all this we see that the piecewise function
required is
\renewcommand{\arraystretch}{1.5}
$$f(x) = \left\{\begin{array}{ll}\dfrac{4}{3}x + \dfrac{7}{3} & \mathrm{if} \ x\in[-4;-1] \\
1& \mathrm{if} \ x\in[-1;2]\\ -3x + 5 & \mathrm{if} \ x\in[2;4]
\end{array}\right.     $$


 \vspace{2cm}
\begin{figure}[h]
\hfill
\begin{minipage}{5cm} $$\psset{unit=.8pc} \psaxes[linewidth=1.2pt, xyLabel={\tiny}]{<->}(0,0)(-7,-7)(7,7)
\psline[linewidth=2pt,
linecolor=red](-4,-3)(-1,1)(2,1)(4,-5)\psdots[dotstyle=*,dotscale=1](-4,-3)(-1,1)(2,1)(4,-5)
\uput[l](-4,-3){\mathscr{L}_1}\uput[u](2,1){\mathscr{L}_2}\uput[r](4,-5){\mathscr{L}_3}$$
\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:piecewise1}.}
\label{fig:piecewise1}
\end{minipage}
\hfill
\begin{minipage}{5cm} $$\psset{unit=.8pc, algebraic=true}
\psaxes[linewidth=1.2pt, labels=none]{<->}(0,0)(-7,-7)(7,7)
\psline[linewidth=2pt,linecolor=red]{<-o}(-6,-2)(-2,-2)
\psdot[dotscale=1.5,dotstyle=*, linecolor=red](-2,4)
\psplot[linewidth=2pt,linecolor=red]{-2}{1}{x^2}
\psline[linewidth=2pt,linecolor=red]{*-o}(1,1)(4,4)
\psline[linewidth=2pt,linecolor=red]{*->}(4,5)(6,5)
$$
\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:piecewise2}.}
\label{fig:piecewise2}
\end{minipage}\hfill
\begin{minipage}{5cm} $$\psset{unit=.8pc, algebraic=true}
\psaxes[linewidth=1.2pt, labels=none]{<->}(0,0)(-7,-7)(7,7)
\psplot[linewidth=2pt,linecolor=red]{-7}{-1}{1/x}
\psplot[linewidth=2pt,linecolor=red]{1}{7}{1/x}
\psdots[dotscale=1.5,dotstyle=*, linecolor=red](-1,-1)(1,1)
\psplot[linewidth=2pt,linecolor=red]{-1}{1}{x}
$$
\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:piecewise3}.}
\label{fig:piecewise3}\hfill
\end{minipage}
\end{figure}
Sometimes the pieces in a piecewise function do not connect at a
particular point, let us say at $x=a$. Then we write $f(a-)$ for the
value that $f(x)$ would have if we used the assignment rule for
values very close to $a$ but smaller than $a$, and $f(a+)$ for the
value that $f(x)$ would have if we used the assignment rule for
values very close to $a$ but larger than $a$.
\begin{exa}\label{exa:piecewise2}The function $f:\BBR\rightarrow \BBR$ is piecewise defined by
$$f(x) = \left\{\begin{array}{ll} -2 & \mathrm{if}\ x \in ]-\infty; -2[ \\
 x^2 & \mathrm{if}\ x \in [-2; 1] \\
 x & \mathrm{if}\ x \in ]1;4[ \\
5  & \mathrm{if}\ x \in [4;+\infty[ \\
\end{array}\right.$$
Its graph appears in figure \ref{fig:piecewise2}. We have, for
example,
\begin{multicols}{4}\begin{enumerate}
\item $f(-3)= -2$
\item $f(-2-)=-2$
\item $f(-2)=(-2)^2=4$
\item $f(-2+)=(-2)^2 = 4$
\item $f\left(\frac{2}{3}\right) = \left(\frac{2}{3}\right)^2 = \frac{4}{9}$
\item $f(1-)=(1)^2 = 1$
\item $f(1) = (1)^2 = 1 $
\item $f(1+)=1$
\item $f(2)=2$
\item $f(4-) = 4$
\item $f(4) = 5$
\item $f(4+) = 5$

\end{enumerate}\end{multicols}
\end{exa}
\begin{exa}\label{exa:piecewise3}The function $g:\BBR\rightarrow \BBR$ is piecewise defined by
$$g(x) = \left\{\begin{array}{ll} \dfrac{1}{x} & \mathrm{if}\ x \in ]-\infty; -1[ \\
 x & \mathrm{if}\ x \in [-1; 1] \\
\dfrac{1}{x}  & \mathrm{if}\ x \in ]1;+\infty[ \\
\end{array}\right.$$
Its graph appears in figure \ref{fig:piecewise3}. We have, for
example,
\begin{multicols}{3}\begin{enumerate}
\item $g(-\infty)= 0$, using \ref{eq:1/big}
\item $g(-1-)=\dfrac{1}{-1} = -1$
\item $g(-1)= -1$
\item $g(-1+)=-1$
\item $g(0) = 0$
\item $g(1+)=\dfrac{1}{1} = 1$
\item $g(1)= 1$
\item $g(1+)=1$
\item $g(+\infty)= 0$, using \ref{eq:1/big}
\end{enumerate}\end{multicols}
\end{exa}
\section{Translations}
\begin{thm} \label{thm:translations}
Let $f$ be a function and let $v$ and $h$ be real numbers. If
$(x_0,y_0)$ is on the graph of $f$, then $(x_0,y_0+v)$ is on the
graph of $g$, where $g(x)=f(x)+v$, and if $(x_1,y_1)$ is on the
graph of $f$, then $(x_1-h,y_1)$ is on the graph of $j$, where
$j(x)=f(x+h)$.
\end{thm}
\begin{pf}
Let $\Gamma_f, \Gamma_g, \Gamma_j$ denote the graphs of $f, g, j$
respectively.
$$(x_0, y_0) \in \Gamma_f \iff y_0 = f(x_0) \iff y_0 + v = f(x_0) +
v \iff y_0+v = g(x_0) \iff (x_0,y_0+v)\in \Gamma_g.
$$
Similarly,
$$(x_1, y_1) \in \Gamma_f \iff y_1 = f(x_1) \iff y_1 = f(x_1-h + h)
\iff y_1 = j(x_1-h) \iff (x_1-h,y_1)\in \Gamma_j.
$$
\end{pf}

\begin{df}
Let $f$ be a function and let $v$ and $h$ be real numbers. We say
that the curve $y = f(x) + v$ is a {\em vertical translation} of the
curve $y = f(x)$. If $v>0$ the translation is $v$ up, and if $v<0$,
it is $v$ units down. Similarly, we say that the curve $y = f(x +
h)$ is a {\em horizontal translation} of the curve $y = f(x)$. If $h
> 0$, the translation is $h$ units left, and if $h<0$, then the
translation is $h$ units right. \index{translation!vertical}
\index{translation!horizontal}
\end{df}
\pagebreak
\begin{exa}
If $f(x) = x^2$, then figures \ref{fig:y=x^2vertran},
\ref{fig:y=f(x)+3} and \ref{fig:y=f(x)-3} shew vertical translations
$3$ units up and $3$ units down, respectively. Figures
\ref{fig:y=f(x-3)}, \ref{fig:y=f(x+3)}, and \ref{fig:y=f(x+3)-3},
respectively  shew a horizontal translation $3$ units right, $3$
units left, and a simultaneous translation $3$ units left and down.
\end{exa}

 \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x)=x^2$}
\label{fig:y=x^2vertran}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(0,3){\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x)+3=x^2+3$}
\label{fig:y=f(x)+3}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(0,-3){\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x)-3=x^2-3$}
\label{fig:y=f(x)-3}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(3,0){\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)}
$$
\vspace{1cm}\tiny\hangcaption{$y=f(x-3)=(x-3)^2$}
\label{fig:y=f(x-3)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(-3,0){\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x+3)=(x+3)^2$}
\label{fig:y=f(x+3)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(-3,-3){\parabola[linewidth=2pt,linecolor=red]{<->}(2.445,6)(0,0)}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x+3)-3=(x+3)^2-3$}
\label{fig:y=f(x+3)-3}
\end{minipage}
\end{figure}
\begin{exa}
If $g(x) = x$ (figure \ref{fig:y=xvertran}), then figures ,
\ref{fig:y=g(x)+3} and \ref{fig:y=g(x)-3} shew vertical translations
$3$ units up and $3$ units down, respectively. Notice than in this
case $g(x+t)= x+t = g(x) + t $, so a vertical translation by $t$
units has exactly the same graph as a horizontal translation $t$
units.
\end{exa}

 \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psline[linewidth=2pt,linecolor=red]{<->}(-5.5,-5.5)(5.5,5.5)
$$
\vspace{2cm} \tiny\hangcaption{$y=g(x)=x$} \label{fig:y=xvertran}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(0,3){\psline[linewidth=2pt,linecolor=red]{<->}(-5.5,-5.5)(5.5,5.5)}
$$
\vspace{2cm} \tiny\hangcaption{$y=g(x)+3=x+3$} \label{fig:y=g(x)+3}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(0,-3){\psline[linewidth=2pt,linecolor=red]{<->}(-5.5,-5.5)(5.5,5.5)}
$$
\vspace{2cm} \tiny\hangcaption{$y=g(x)-3=x-3$} \label{fig:y=g(x)-3}
\end{minipage}
\end{figure}


\begin{df}
Given a function $f$ we write $f(-\infty)$ for the value that $f$
may eventually approach for large  (in absolute value) and negative
inputs and $f(+\infty)$ for the value that $f$ may eventually
approach for large (in absolute value) and positive input. The line
$y = b$ is a  (horizontal) {\em asymptote} for the function $f$ if
either $$f(-\infty) = b \qquad \mathrm{or} \qquad f(+\infty) = b. $$
\end{df}\index{asymptote!horizontal}

\begin{df}
Let $k>0$ be an integer. A function $f$ has a {\em pole of order
$k$} at the point $x = a$ if $ \lim _{\tends{x}{a}} (x-a)^{k-1}f(x)
= \pm \infty $ but $ \lim _{\tends{x}{a}} (x-a)^kf(x)  $ is finite.
Some authors prefer to use the term {\em vertical asymptote}, rather
than pole. \index{asymptote!vertical} \index{pole}
\end{df}
\begin{exa}
Since $xf(x) = 1$, $f(0-) = -\infty$,  $f(0+) = +\infty$ for $
\fun{f}{x}{\dfrac{1}{x}}{\BBR\setminus\{0\}}{\BBR}$,  $f$ has a pole
of order $1$ at $x=0$.
\end{exa}

\begin{exa}
Figures \ref{fig:a(x)=1/x} through \ref{fig:a(x+2)+3=1/(x+2)+3}
exhibit various transformations of $y = a(x) = \dfrac{1}{x}$. Notice
how the poles and the asymptotes move with the various
transformations.
\end{exa}
\vspace{1cm}

\begin{figure}[h]
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x}$}
\label{fig:a(x)=1/x}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}}
$$\vspace{1cm}\tiny\hangcaption{$x\mapsto \dfrac{1}{x-1} -1$}
\label{fig:a(x-1)-1=1/(x-1)-1}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(-2,3){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}}
$$\vspace{1cm}\tiny\hangcaption{$x\mapsto \dfrac{1}{x+2} +3$}
\label{fig:a(x+2)+3=1/(x+2)+3}
\end{minipage}
\end{figure}
\section{Distortions}
\begin{thm}\label{thm:distortions}
Let $f$ be a function and let $V\neq 0$ and $H\neq 0$ be real
numbers. If $(x_0,y_0)$ is on the graph of $f$, then $(x_0,Vy_0)$ is
on the graph of $g$, where $g(x)=Vf(x)$, and if $(x_1,y_1)$ is on
the graph of $f$, then $\left(\dfrac{x_1}{H},y_1\right)$ is on the
graph of $j$, where $j(x)=f(Hx)$.
\end{thm}
\begin{pf}
Let $\Gamma_f, \Gamma_g, \Gamma_j$ denote the graphs of $f, g, j$
respectively.
$$(x_0, y_0) \in \Gamma_f \iff y_0 = f(x_0) \iff Vy_0  = Vf(x_0)
\iff Vy_0 = g(x_0) \iff (x_0,Vy_0)\in \Gamma_g.
$$
Similarly,
$$(x_1, y_1) \in \Gamma_f \iff y_1 = f(x_1) \iff y_1 = f\left(\dfrac{x_1}{H}\cdot H\right)
\iff y_1 = j\left(\dfrac{x_1}{H}\right) \iff
\left(\dfrac{x_1}{H},y_1\right)\in \Gamma_j.
$$
\end{pf}





\begin{df}Let  $V>0$, $H>0$, and  let $f$ be a function.
The curve  $y = Vf(x)$ is called a {\em vertical distortion} of the
curve $y = f(x)$. The graph of $y = Vf(x)$ is a {\em vertical
dilation} of the graph of $y = f(x)$ if $V > 1$ and a {\em vertical
contraction} if $0< V < 1.$ The curve $y = f(Hx)$ is called a {\em
horizontal distortion} of the curve $y = f(x)$ The graph of $y =
f(Hx)$ is a {\em horizontal dilation} of the graph of $y = f(x)$ if
$0< H < 1$ and a {\em horizontal contraction} if $H > 1.$
\index{distortion!vertical}\index{distortion!horizontal}
\end{df} \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2}{2}{sqrt(4-x^2)}
$$
\vspace{1cm} \tiny\hangcaption{$y=a(x)=\sqrt{4-x^2}$}
\label{fig:y=sqrt(4-x^2)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2}{2}{2*sqrt(4-x^2)}
$$
\vspace{1cm} \tiny\hangcaption{$y=2a(x)=2\sqrt{4-x^2}$}
\label{fig:y=2a(x)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{1}{sqrt(4-4*x^2)}
$$
\vspace{1cm} \tiny\hangcaption{$y=a(2x)=\sqrt{4-4x^2}$}
\label{fig:y=a(2x)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(2,0){\psplot[linewidth=2pt,linecolor=red]{-2}{2}{sqrt(4-x^2)}}
$$
\vspace{1cm} \tiny\hangcaption{$y=a(x-2)=\sqrt{-x^2+4x}$}
\label{fig:y=a(x-2)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{1}{2*sqrt(4-4*x^2)}
$$
\vspace{1cm} \tiny\hangcaption{$y=2a(2x)=2\sqrt{4-4x^2}$}
\label{fig:y=2a(2x)}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\rput(0,1){\psplot[linewidth=2pt,linecolor=red]{-1}{1}{2*sqrt(4-4*x^2)}}
$$
\vspace{1cm} \tiny\hangcaption{$y=2a(2x)+1=2\sqrt{4-4x^2}+1$}
\label{fig:y=2a(2x)+1}
\end{minipage}
\end{figure}


\begin{exa}
Let $a(x) = \sqrt{4-x^2}$. If $y=\sqrt{4-x^2}$,  then $x^2+y^2=4$,
which is a circle with centre at $(0,0)$ and radius $2$ by virtue of
\ref{eq:canonical_circle}. Hence $y = a(x) = \sqrt{4-x^2}$ is the
upper semicircle of this circle.  Figures \ref{fig:y=sqrt(4-x^2)}
through \ref{fig:y=2a(2x)+1} shew various transformations of this
curve.
\end{exa}
\begin{exa}\label{exa:y=2x^2-4x+1}
Draw the graph of the curve $y = 2x^2 - 4x+1$.
\end{exa}
Solution: We complete squares.
$$ \begin{array}{lll}y = 2x^2 - 4x+1 & \iff & \dfrac{y}{2} = x^2-2x + \dfrac{1}{2} \\
& \iff &  \dfrac{y}{2} + 1 = x^2-2x+1 + \dfrac{1}{2} \\
& \iff &  \dfrac{y}{2} + 1 = (x-1)^2 + \dfrac{1}{2} \\
& \iff &  \dfrac{y}{2} = (x-1)^2 - \dfrac{1}{2} \\
& \iff &  y = 2(x-1)^2 - 1, \\
\end{array}$$whence to obtain  the graph of $y=2x^2-4x+1$ we (i)
translate $y=x^2$ one unit right, (ii) dilate the above graph by
factor of two, (iii) translate the above graph one unit down. This
succession is seen in figures \ref{fig:y=(x-1)^2} through
\ref{fig:y=2c(x-1)-1}.
 \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{3}{(x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=(x-1)^2$} \label{fig:y=(x-1)^2}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{3}{2*(x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=2(x-1)^2$} \label{fig:y=2c(x-1)}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{3}{2*x^2-4*x+1}
$$
\vspace{1cm} \tiny\hangcaption{$y=2(x-1)^2-1$}
\label{fig:y=2c(x-1)-1}
\end{minipage}
\end{figure}









\section{Reflexions}
\begin{thm}\label{thm:reflexions}
Let $f$ be a function  If $(x_0,y_0)$ is on the graph of $f$, then
$(x_0,-y_0)$ is on the graph of $g$, where $g(x)=-f(x)$, and if
$(x_1,y_1)$ is on the graph of $f$, then $\left(-x_1,y_1\right)$ is
on the graph of $j$, where $j(x)=f(-x)$.
\end{thm}
\begin{pf}
Let $\Gamma_f, \Gamma_g, \Gamma_j$ denote the graphs of $f, g, j$
respectively.
$$(x_0, y_0) \in \Gamma_f \iff y_0 = f(x_0) \iff -y_0  = -f(x_0)
\iff -y_0 = g(x_0) \iff (x_0,-y_0)\in \Gamma_g.
$$
Similarly,
$$(x_1, y_1) \in \Gamma_f \iff y_1 = f(x_1) \iff y_1 = f\left(-(-x_1)\right)
\iff y_1 = j\left(-x_1\right) \iff \left(-x_1,y_1\right)\in
\Gamma_j.
$$
\end{pf}
\begin{df}
Let $f$ be a function. The curve $y = -f(x)$ is said to be the {\em
reflexion of $f$ about the $x$-axis} and the curve $y = f(-x)$ is
said to be the {\em reflexion of $f$ about the $y$-axis}.
\end{df}
\begin{exa}
Figures \ref{fig:y=d(x)=(x-1)^2} through \ref{fig:y=-(-x-1)^2} shew
various reflexions about the axes.
\end{exa}
\begin{thm}
Let $f$ be a function  If $(x_0,y_0)$ is on the graph of $f$, then
$(x_0,|y_0|)$ is on the graph of $g$, where $g(x)=|f(x)|$.
\end{thm}
\begin{pf}
Let $\Gamma_f, \Gamma_g$ denote the graphs of $f, g$, respectively.
$$(x_0, y_0) \in \Gamma_f \implies y_0 = f(x_0) \implies |y_0|  = |f(x_0)|
\implies |y_0| = g(x_0) \implies (x_0,|y_0|)\in \Gamma_g.
$$
\end{pf}


\begin{exa}
Figures \ref{fig:y=f(x)=x} and \ref{fig:y=|x|} display $y=x$ and
$y=|x|$ respectively. Figures  \ref{fig:y=x^2-1} and
\ref{fig:y=|x^2-1|} shew $y=x^2-1$ and $y=|x^2-1|$ respectively.
Figures \ref{fig:b(x)=1/x} through \ref{fig:-|b(x)|=-|1/x|} exhibit
various transformations of $x\mapsto \dfrac{1}{x}$.
\end{exa}
 \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{3}{(x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=d(x)=(x-1)^2$}
\label{fig:y=d(x)=(x-1)^2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-1}{3}{-1*(x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=-d(x)=-(x-1)^2$}
\label{fig:y=-(x-1)^2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-3}{1}{(-1*x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=d(-x)=(-x-1)^2$}
\label{fig:y=(-x-1)^2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-3}{1}{-1*(-1*x-1)^2}
$$
\vspace{1cm} \tiny\hangcaption{$y=-d(-x)=-(-x-1)^2$}
\label{fig:y=-(-x-1)^2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psline[linewidth=2pt,linecolor=red]{<->}(-5.5,-5.5)(5.5,5.5)
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x)=x$} \label{fig:y=f(x)=x}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psline[linewidth=2pt,linecolor=red]{<->}(-5.5,5.5)(0,0)(5.5,5.5)
$$
\vspace{1cm} \tiny\hangcaption{$y=|f(x)|=|x|$} \label{fig:y=|x|}
\end{minipage}
\end{figure}
\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{x^2-1}
$$
\vspace{1cm} \tiny\hangcaption{$y=g(x)=x^2-1$} \label{fig:y=x^2-1}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$ \psset{unit=.5pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{abs(x^2-1)}
$$
\vspace{1cm} \tiny\hangcaption{$y=|g(x)|=|x^2-1|$}
\label{fig:y=|x^2-1|}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x}$}
\label{fig:b(x)=1/x}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{-1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{-1/x}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto -\dfrac{1}{x}$}
\label{fig:b(-x)=-1/x}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/abs(x)}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \left| \dfrac{1}{x}\right|$}
\label{fig:|b(x)|=|1/x|}
\end{minipage}
\hfill\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true}
\psaxes[linewidth=1pt, labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{-1/abs(x)}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{-1/abs(x)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto -\left|\dfrac{1}{x}\right|$}
\label{fig:-|b(x)|=-|1/x|}
\end{minipage}
\end{figure}


\vspace{1cm}

\begin{figure}[h]
\centering
\begin{minipage}{8cm}
 $$\psset{unit=.8pc, algebraic=true} \psaxes[labels=none,ticks=none,linewidth=1.2pt]{<->}(0, 0)(-5,
-5)(5, 5)
\psplot[linewidth=2pt,linecolor=red]{-1.85}{1.85}{abs(x)*abs(x^2-1)}$$\vspace{1cm}\footnotesize\hangcaption{Example
\ref{exa:even_odd}. The graph of an even function.} \label{fig:even}
\end{minipage}
 \begin{minipage}{8cm}
$$
\psset{unit=.8pc,algebraic=true}
\psaxes[labels=none,ticks=none,linewidth=1.2pt]{<->}(0, 0)(-5,
-5)(5,
5)\psplot[linewidth=2pt,linecolor=red]{-1.85}{1.85}{x*abs(x^2-1)}
$$ \vspace{1cm}\footnotesize\hangcaption{Example
\ref{exa:even_odd}. The graph of an odd function.} \label{fig:odd}
\end{minipage}
  \end{figure}

\section{Symmetry}
\begin{df}
A function $f$ is {\em even} if for all $x$  it is verified that
$f(x) = f(-x)$, that is, if the portion of the graph for $x<0$ is a
mirror reflexion of the part of the graph for $x> 0$. This means
that the graph of $f$ is symmetric about the $y$-axis. A function
$g$ is {\em odd} if for all $x$ it is verified that $g(-x) = -g(x)$,
in other words, $g$ is odd if it is symmetric about the origin. This
implies that the portion of the graph appearing in quadrant I is a
$180^\circ$ rotation of the portion of the graph appearing in
quadrant III, and the portion of the graph appearing in quadrant II
is a $180^\circ$ rotation of the portion of the graph appearing in
quadrant IV.
\end{df}


\begin{exa}
The curve in figure \ref{fig:even} is even. The curve in figure
\ref{fig:odd} is odd. \label{exa:even_odd}\end{exa}

\begin{thm}
Let $f$ be a function. Then both $x\mapsto f(|x|)$ and $x\mapsto
f(-|x|)$ are even functions.
\end{thm}
\begin{pf}
Put $a(x) = f(|x|)$. Then $a(-x) = f(|-x|) = f(|x|) = a(x)$, whence
$x\mapsto a(x)$ is even. Similarly, if $b(x) = f(-|x|)$, then $b(-x)
= f(-|-x|) = f(-|x|) = b(x)$ proving that   $x\mapsto b(x)$ is even.
\end{pf}
Notice that  $f(x) = f(|x|)$ for $x>0$. Since $x\mapsto f(|x|)$ is
even, the graph of $x\mapsto f(|x|)$ is thus obtained by erasing the
portion of the graph of $x \mapsto f(x)$ for $x<0$ and reflecting
the part for $x>0$. Similarly, since $f(x) = f(-|x|)$ for $x<0$, the
graph of $x\mapsto f(-|x|)$ is obtained by erasing the portion of
the graph of $x \mapsto f(x)$ for $x>0$ and reflecting the part for
$x<0$.
\begin{exa}
Figures \ref{fig:y=f(x)=(x-1)^2-3} through \ref{fig:y=|(|x|-1)^2-3|}
exhibit various transformations of $x\mapsto (x-1)^2-3$.
\end{exa}
 \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2}{4}{(x-1)^2-3}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(x)=(x-1)^2-3$}
\label{fig:y=f(x)=(x-1)^2-3}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-4}{4}{(abs(x)-1)^2-3}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(|x|)|=(|x|-1)^2-3$}
\label{fig:y=(|x|-1)^2-3}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-2}{2}{(-1*abs(x)-1)^2-3}
$$
\vspace{1cm} \tiny\hangcaption{$y=f(-|x|)=(-|x|-1)^2-3$}
\label{fig:y=(-|x|-1)^2-3}
\end{minipage}
\hfill
\begin{minipage}{4cm}$$ \psset{unit=.7pc, algebraic=true}
\psaxes[labels=none,tickstyle=bottom]{<->}(0,0)(-6, -6)(6, 6)
\psplot[linewidth=2pt,linecolor=red]{-4}{4}{abs((abs(x)-1)^2-3)}
$$
\vspace{1cm} \tiny\hangcaption{$y=|f(|x|)|=|(|x|-1)^2-3|$}
\label{fig:y=|(|x|-1)^2-3|}
\end{minipage}
\end{figure}



\begin{exa} Figures \ref{fig:1/(x-1)-1} through
\ref{fig:1/(|x|-1)-1} shew a few transformations of $x \mapsto
\dfrac{1}{x-1}-1$.
\end{exa}

\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}}
$$\vspace{1cm}\tiny\hangcaption{$x\mapsto \dfrac{1}{x-1} -1$}
\label{fig:1/(x-1)-1}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\rput(1,1){\psplot[linewidth=2pt,linecolor=red]{-6}{-.25}{1/abs(x)}}\rput(1,-1){
\psline[linestyle=dashed](0,1)(0,6)\psline[linestyle=dashed](-6,2)(6,2)
\psplot[linewidth=2pt,linecolor=red]{.166666667}{1}{1/x}}
\rput(1,1){\psplot[linewidth=2pt,linecolor=red]{1}{6}{-1/x}}
$$\vspace{1cm}\tiny\hangcaption{$x\mapsto \left|\dfrac{1}{x-1} -1\right|$}
\label{fig:1/|x-1|-1}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=2pt,linecolor=red]{-1}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}}
\rput(-1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{-1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{1}{-1/x}}
$$\vspace{1cm}\tiny\hangcaption{$x\mapsto \dfrac{1}{|x|-1}-1$}
\label{fig:1/(|x|-1)-1}
\end{minipage}
\hfill

\end{figure}








\section{Algebra of Functions}
\begin{df}
Let $f$ and $g$ be two functions and let the point $x$ be in the
intersection of their domains. Then $f+g$ is their sum, defined at
each point $x$ by \index{functions!sum of}
$$(f+g)(x) = f(x) + g(x).
$$The difference $f-g$ is defined by \index{functions!difference of}
$$(f-g)(x) = f(x) - g(x),  $$and their product $fg$ is defined by \index{functions!product of}$$(fg)(x) = f(x)\cdot g(x).  $$
Furthermore, if $g(x) \neq 0$, then their quotient is defined
as\index{functions!quotient of}
$$\left(\dfrac{f}{g}\right)(x) = \dfrac{f(x)}{g(x)}.  $$
The composition $f\circ g$ (``$f$ composed with $g$'') is defined at
the point $x$ by
$$(f\circ g)(x) = f(g(x)).
$$

\end{df}


\begin{exa}
Figure \ref{fig:functions_f_g} shews two functions $x \mapsto f(x) =
x + 1$ and $x \mapsto g(x) = x-1$. Figure \ref{fig:functions_f+g}
shews their sum $x \mapsto 2x$, a line, figure
\ref{fig:functions_f-g} shews the difference $x \mapsto (f-g)(x) =
2$, a horizontal line, and figure \ref{fig:functions_ftimesg} shews
their product $x \mapsto x^2-1$, a parabola. We also have $x \mapsto
\left(\frac{g}{f}\right)(x) = \dfrac{x-1}{x+1} = 1 -\dfrac{2}{x+1}$,
a hyperbola with pole at $x = -1$ and asymptote at $y=1$ (figure
\ref{fig:functions_g/f});  $x \mapsto \left(\frac{f}{g}\right)(x) =
\dfrac{x+1}{x-1} = 1 +\dfrac{2}{x-1}$, a hyperbola with pole at $x =
1$ and asymptote at $y=1$ (figure \ref{fig:functions_f/g}); $(f\circ
g) = \idefun$ (figure \ref{fig:functions_fog}); and $x\mapsto(f\circ
f)(x) = x+2$ (figure \ref{fig:functions_fof}).
\end{exa}



 \vspace{2cm}


\begin{figure}[h]
\begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)\psline[linewidth=2pt,linecolor=blue]{<->}(-7.5,-6.5)(7.5,8.5)
\uput[r](7.5,8.5){f}\psline[linewidth=2pt,linecolor=red]{<->}(-7.5,-8.5)(7.5,6.5)
\uput[l](-7.5,-8.5){g}
$$\vspace{1cm}\tiny\hangcaption{$f(x) = x+1$  and $g(x) = x-1$} \label{fig:functions_f_g}
\end{minipage}
\hfill \begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\psline[linewidth=2pt,linecolor=red]{<->}(-4,-8)(4,8)
$$\vspace{1cm}\tiny \hangcaption{$x\mapsto (f+g)(x)=2x$ }\label{fig:functions_f+g}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\psline[linewidth=2pt,linecolor=red]{<->}(-7.5,2)(7.5,2)
$$\vspace{1cm}\tiny \hangcaption{$x\mapsto (f-g)(x) = 2$}\label{fig:functions_f-g}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)
\parabola[linewidth=2pt,linecolor=red]{<->}(2.828427125,7)(0,-1)
$$\vspace{1cm}\tiny \hangcaption{$x\mapsto (fg)(x) = x^2-1$}\label{fig:functions_ftimesg}
\end{minipage}
\end{figure}
\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}
$$\psset{unit=.5pc, algebraic=true}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5) \rput(-1,1){
\psplot[linewidth=2pt,linecolor=red]{.3333333333}{6}{-2/x}
\psplot[linewidth=2pt,linecolor=red]{-6}{-.333333333}{-2/x}
\psline[linestyle=dashed,
linecolor=blue,linewidth=2pt](-6,0)(6,0)\psline[linestyle=dashed,linecolor=blue,linewidth=2pt](0,-6)(0,6)}
$$\vspace{1cm}\tiny\hangcaption{$\left(\dfrac{g}{f}\right)(x) = 1 - \dfrac{2}{x+1} $} \label{fig:functions_g/f}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.5pc, algebraic=true}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5) \rput(1,1){
\psplot[linewidth=2pt,linecolor=red]{.3333333333}{6}{-2/x}
\psplot[linewidth=2pt,linecolor=red]{-6}{-.333333333}{-2/x}
\psline[linestyle=dashed,
linecolor=blue,linewidth=2pt](-6,0)(6,0)\psline[linestyle=dashed,linecolor=blue,linewidth=2pt](0,-6)(0,6)}
$$\vspace{1cm}\tiny\hangcaption{$\left(\dfrac{f}{g}\right)(x) = 1 + \dfrac{2}{x-1} $} \label{fig:functions_f/g}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)\psline[linewidth=2pt,linecolor=blue]{<->}(-7.5,-7.5)(7.5,7.5)
$$\vspace{1cm}\tiny\hangcaption{$(f\circ g)(x)=x$} \label{fig:functions_fog}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=.5pc}
\psgrid[subgriddiv=0,linewidth=1pt, gridlabels=0](0,0)(-7,-7)(7,7)
\psaxes[linewidth=1.2pt, labels=none,
ticks=none]{<->}(0,0)(-7.5,-7.5)(7.5,7.5)\psline[linewidth=2pt,linecolor=blue]{<->}(-7.5,-5.5)(5.5,7.5)
$$\vspace{1cm}\tiny\hangcaption{$(f\circ f)(x)=x+2$} \label{fig:functions_fof}
\end{minipage}
\end{figure}

\section{Behaviour of the Graphs of Functions}
So far we have limited our study of functions to those families of
functions whose graphs are known to us: lines, parabolas,
hyperbolas, or semicircles. Through some arguments involving
symmetry we have been able to extend this collection to compositions
of the above listed functions with the absolute value function. We
would now like  to increase our repertoire of functions that we can
graph. For that we need the machinery of Calculus, which will be
developed in the subsequent chapters. This section introduces the
basic definitions of the essential features that we will be
interested in when we examine the graphs of more functions.
\begin{df}
A function $f$ is said to be {\em
continuous}\index{function!continuous} at the point $x=a$ if $f(a-)
= f(a) = f(a+)$. It is continuous on the interval $I$ if it is
continuous on every point of $I$. \index{continuity}
\end{df}
Heuristically speaking, a continuous function is one whose graph has
no ``breaks.''
\begin{exa}\label{exa:continuous1}
Given that $$ f(x) = \left\{ \begin{array}{lr}6 + x & \mathrm{if}\ x
\in ]-\infty; -2]
\\ 3x^2 + xa &\mathrm{if}\ x\in  ]-2; +\infty[ \\\end{array} \right.
$$ is continuous, find $a$.
\end{exa}
Solution: Since $f(-2-) =f(-2)= 6-2 = 4$ and $f(-2+) = 3(-2)^2 -2a =
12-2a$ we need $$f(-2-) = f(-2+) \implies 4 = 12-2a \implies a = 4.
$$The graph of $f$ is given in figure \ref{fig:continuous1}.
\begin{exa}\label{exa:continuous2}
Given that $$ f(x) = \left\{ \begin{array}{lr}\dfrac{x^2-1}{x-1} &
\mathrm{if}\ x\neq 1
\\ a &\mathrm{if}\ x=1 \\\end{array} \right.
$$ is continuous, find $a$.
\end{exa}
Solution: For $x\neq 1$ we have $f(x) = \dfrac{x^2-1}{x-1} = x+1$.
Since $f(1-) =2$ and $f(1+) = 2$ we need $a= f(1) = 2$. The graph of
$f$ is given in figure \ref{fig:continuous2}.

 \vspace{2cm}

\begin{figure}[h]\centering
\begin{minipage}{5cm}
$$\psset{unit=.8pc,algebraic=true}\psaxes[labels=none,linewidth=1.2pt]{<->}(0,0)(-6,-6)(6,6)
\psplot[linecolor=red,linewidth=2pt]{-5.5}{-2}{6+x}\psplot[linecolor=red,linewidth=2pt]{-2}{1}{3*x^2+4*x}
\psdots[dotstyle=*,dotscale=2](-2,4)
$$\vspace{1cm}\footnotesize\hangcaption{Example
\ref{exa:continuous1}.}\label{fig:continuous1} \end{minipage}
\begin{minipage}{5cm}
$$\psset{unit=.8pc,algebraic=true}\psaxes[labels=none,linewidth=1.2pt]{<->}(0,0)(-6,-6)(6,6)
\psline[linecolor=red,linewidth=2pt]{<->}(-6,-5)(6,7)
\psdots[dotstyle=*,dotscale=2](1,2)
$$\vspace{1cm}\footnotesize\hangcaption{Example
\ref{exa:continuous2}.}\label{fig:continuous2}
\end{minipage}
\end{figure}

We will accept the following results without proof.
\begin{thm}[Bolzano's Intermediate Value Theorem]\label{thm:bolzano}
\index{Theorem!Bolzano}If $f$ is continuous on the interval $[a; b]$
and $f$ and there are two different values in this interval for
which $f$ changes sign, then $f$ is vanishes somewhere in this
interval, that is, there is $c\in [a;b]$ such that $f(c)=0$.
\end{thm}
\begin{cor}
If $f$ is continuous on the interval $[a; b]$ with $f(a)\neq f(b)$
then  $f$ assumes every value between $f(a)$ and $f(b)$, that is,
for $d$ with $\min (f(a), f(b)) \leq d \leq \max (f(a), f(b))$ there
is $c\in [a;b]$ such that $f(c)=d$.
\end{cor}

\begin{thm}[Weierstrass's Theorem]\label{thm:weierstrass}
A continuous function on a finite closed interval $[a; b]$ assumes a
maximum value and a minimum value.
\index{Theorem!Weierstrass}\end{thm}




\begin{df}
A function $f$ is said to be {\em increasing} (respectively, {\em
strictly increasing}) if $a <b \implies f(a) \leq f(b)$
(respectively, $a <b \implies f(a) < f(b)$). A function $g$ is said
to be {\em decreasing} (respectively, {\em strictly decreasing}) if
$a <b \implies g(a) \leq g(b)$ (respectively, $a <b \implies g(a) <
g(b)$). A function is {\em monotonic} if it is either (strictly)
increasing or decreasing. By the {\em intervals of monotonicity of a
function} we mean the intervals where the function might be
(strictly) increasing or decreasing. \index{function!increasing}
\index{function!decreasing} \index{function!strictly
increasing}\index{function!strictly
decreasing}\index{function!monotonic}\index{monotonicity}
\end{df}
\begin{rem}
If the function $f$ is (strictly) increasing, its opposite $-f$ is
(strictly) decreasing, and viceversa.
\end{rem}
The following theorem is immediate.
\begin{thm}\label{thm:increasing_equivalence1}
A function $f$ is (strictly) increasing if for all $a<b$ for which
it is defined $$\dfrac{f(b)-f(a)}{b-a} \geq 0\qquad
\mathrm{(respectively}, \dfrac{f(b)-f(a)}{b-a} > 0).$$ Similarly, a
function $g$ is (strictly) decreasing if for all $a<b$ for which it
is defined
$$\dfrac{g(b)-g(a)}{b-a} \leq 0 \qquad \mathrm{(respectively},
\dfrac{g(b)-g(a)}{b-a} < 0).$$
\end{thm}
\begin{exa}
Prove that an affine function $x\mapsto mx+k$ is strictly increasing
if $m>0$ and strictly decreasing if $m<0$.
\end{exa}Solution: This is geometrically obvious. To prove it
analytically, put $f(x)=mx+k$ and observe that $$
\dfrac{f(b)-f(a)}{b-a} = \dfrac{(mb+k)-(ma+k)}{b-a}=m.
$$Now apply Theorem \ref{thm:increasing_equivalence1}.
\begin{exa}
Prove that  $x\mapsto x^2$ is strictly increasing if $x>0$ and
strictly decreasing if $x<0$.
\end{exa}Solution: This is geometrically obvious. To prove it
analytically, put $t(x)=x^2$ observe that $$ \dfrac{t(b)-t(a)}{b-a}
= \dfrac{b^2-a^2}{b-a}=\dfrac{(b-a)(b+a)}{b-a} = b+a.
$$This quantity is strictly negative or strictly positive
depending on whether $a<b<0$ or $0<a<b$. We now apply Theorem
\ref{thm:increasing_equivalence1}. We summarise this information by
means of the table

 $$
   \begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & 0 &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

 f(x) =x^2 &  & \searrow  & & \nearrow &     \\

  &  &  & 0 &  &    \\
 \hline
            \end{array}
 $$


\vspace{1cm}
\begin{figure}[h]
\centering
\begin{minipage}{7cm}
$$ \psset{unit=.8pc}
 \rput(0,-4){\parabola[linewidth=2pt,linecolor=red]{<->}(2.25,5.0625)(0,0)
 \psline[linewidth=2pt,linecolor=blue](2,4)(-1,1)\psdots[dotscale=1,dotstyle=*](2,4)(-1,1)(.5,2.5)(.5,.25)
 }
$$\vspace{1cm}\footnotesize \hangcaption{Example  \ref{exa:convex1}. A convex curve }\label{fig:convex1}\end{minipage}
\begin{minipage}{7cm}
$$ \psset{unit=.8pc}
 \parabola[linewidth=2pt,linecolor=red]{<->}(-2.25,-5.0625)(0,0)
 \psline[linewidth=2pt,linecolor=blue](2,-4)(-1,-1)\psdots[dotscale=1,dotstyle=*](2,-4)(-1,-1)(.5,-2.5)(.5,-.25)
$$\vspace{1cm}\footnotesize \hangcaption{Example  \ref{exa:convex1}. A concave curve. }\label{fig:convex2}\end{minipage}

\end{figure}

\begin{df}
A  function $f$ is said to  be (midpoint strictly) {\em convex} if
given $a< b$ we have $$f\left(\dfrac{a+b}{2}\right) <
\dfrac{f(a)+f(b)}{2}.$$ A function $g$ is said to  be (midpoint
strictly) {\em concave} if given $a< b$ we have
$$g\left(\dfrac{a+b}{2}\right) > \dfrac{g(a)+g(b)}{2}.$$ By the {\em
intervals of convexity (concavity) of a function} we mean the
intervals where the function is convex (concave). An {\em inflexion
point}\index{inflexion point} is a point where a graph changes
convexity. \label{df:convexity_concavity}\end{df}
\index{convexity}\index{concavity}\index{function!concave}\index{function!convex}



\begin{rem}
Geometrically speaking, a convex function is one such that if two
distinct points on its graph are taken and the straight line joining
these two points drawn, then the midpoint of that straight line is
above the graph. In other words, the graph of the function bends
upwards. Notice that if $f$ is convex, then its opposite $-f$ is
concave.
\end{rem}


\begin{exa}
Prove that the square function $x\mapsto x^2$ is convex.
\label{exa:convex1}\end{exa} Solution: Put $f(x)=x^2$. We need to
prove that
$$f\left(\dfrac{a+b}{2}\right) = \left(\dfrac{a+b}{2}\right)^2 = \dfrac{a^2 + 2ab + b^2}{4}   $$
is strictly smaller than
$$ \dfrac{f(a)+f(b)}{2} = \dfrac{a^2+b^2}{2}.  $$
This would occur if  $$\dfrac{a^2 + 2ab + b^2}{4} <
\dfrac{a^2+b^2}{2},
$$that is $$\dfrac{a^2 - 2ab + b^2}{4} > 0.$$But since we always have $$\dfrac{a^2 - 2ab + b^2}{4} =
\dfrac{(a-b)^2}{4}>0, $$and the above steps are reversible, the
assertion is proved. Incidentally, this also proves that $x \mapsto
-x^2$ is concave. See figures \ref{fig:convex1} and
\ref{fig:convex2}.
\begin{df}
Let  $f$ be a function. If $f$ is defined at $x=0$, then $(0,f(0))$
is its {\em $y$-intercept}. The points $(x, 0)$ on the $x$-axis for
which $f(x)=0$, if any, are the {\em $x$-intercepts} of $f$.
\index{intercept!$x$}\index{intercept!$y$}
\end{df}
\begin{df}
A {\em zero} or {\em root} of a function $f$ is a solution to the
equation $f(x) = 0$. \index{zero!of a function}\index{root!of a
function}

\end{df}
















\chapter{The Strong Derivative  of a Function}\thispagestyle{empty}
In this chapter we introduce the concept of the strong derivative.
We do not give formul\ae---with the exception of example
\ref{exa:tangent_to_circle} where the formula is obtained through a
geometric argument---here to calculate derivatives, we scatter those
throughout the text.
\section{The Strong Derivative}
Given a finite number of points, we can find infinitely many curves
passing through them. See for example figure
\ref{fig:few_point_graph}, where we see three very different curves
$f, g, h$ each simultaneously passing through the points $A$, $B$,
$C$. Thus plotting a few points of the graph of a function can give
a misleading picture.


\vspace{1cm}
\begin{figure}[h]
$$ \psset{unit=1pc,algebraic=true}
\psline[linewidth=2pt,linecolor=red](-3,-3)(3,3)
\psplot[linewidth=2pt,linecolor=blue]{-1.5}{1.5}{x^3}
\psplot[linecolor=magenta,linewidth=2pt,algebraic=true,
plotpoints=1000]{0}{6}{x^.3333333}
\psplot[linecolor=magenta,linewidth=2pt,algebraic=true,
plotpoints=1000]{-6}{0}{-1*abs(x)^.3333333}\psdots[dotstyle=*,dotscale=1](0,0)(-1,-1)(1,1)
\uput[dr](1,1){A}\uput[dr](-1,-1){C}\uput[ul](0,0){B}
\uput[l](-3,-3){f}\uput[d](-1.5,-3.375){g}\uput[r](6,1.82){h}$$\vspace{1cm}\footnotesize\hangcaption{A
few points do not a graph determine.}\label{fig:few_point_graph}
\end{figure}

\bigskip

By the same token, given a formula, the plotting of a few points
does not give the salient features of a graph. For example, let us
say that we wanted to graph $y = 4x-x^3$.  In figures
\ref{fig:approx_by_lines_begin} through
\ref{fig:approx_by_lines_end} we have chosen a few selected points
on the curve and interpolated between them through lines. But
relying on this method does not give proof that the graph will not
have more turns or bends, say, or that it will grow indefinitely for
values of $x$ of large magnitude.


\vspace{1cm}

\begin{figure}[h]
\begin{minipage}{3cm}$$\psset{unit=.7pc, plotpoints=4, algebraic=true}
\psaxes[linewidth=1.5pt,labels=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{-1*(x+2)*((x-2))*x}
$$\vspace{1cm}\footnotesize\hangcaption{Four plot points.}\label{fig:approx_by_lines_begin}
\end{minipage}
\hfill
\begin{minipage}{3cm}$$\psset{unit=.7pc, plotpoints=7, algebraic=true}
\psaxes[linewidth=1.5pt,labels=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{-1*(x+2)*((x-2))*x}
$$\vspace{1cm}\footnotesize\hangcaption{Seven plot points.}
\end{minipage}\hfill
\begin{minipage}{3cm}$$\psset{unit=.7pc, plotpoints=10, algebraic=true}
\psaxes[linewidth=1.5pt,labels=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{-1*(x+2)*((x-2))*x}
$$\vspace{1cm}\footnotesize\hangcaption{Ten plot points.}
\end{minipage}\hfill
\begin{minipage}{3cm}$$\psset{unit=.7pc,plotpoints=1000, algebraic=true}
\psaxes[linewidth=1.5pt,labels=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-2.5}{2.5}{-1*(x+2)*((x-2))*x}
$$\vspace{1cm}\footnotesize\hangcaption{One thousand plot points.}\label{fig:approx_by_lines_end}
\end{minipage}
\end{figure}

But for all its faults, the progression of shapes in figures
\ref{fig:approx_by_lines_begin} through
\ref{fig:approx_by_lines_end} suggests that a ``reasonable'' graph
can  be approximated by a series of straight lines. By a
``reasonable'' graph we mean one that does not have many sharp
turns, does not oscillate wildly, does not have many jumps or many
asymptotes, and that it is mostly continuous and ``smooth.''
Admittedly, these concepts are vague, but we will gain more insight
into them as we progress.

\bigskip

How do we choose the lines to approximate a given ``reasonable''
curve? Given a function $f$ consider the point $(a, f(a))$ on the
graph of the function. What happens around this point? If we
approached $a$ through values $x<a$ and joined the line with
endpoints $(x,f(x))$ and $(a,f(a))$, we would obtain a secant line
like that of figure \ref{fig:left_secant}. If we approached $a$
through  values $x>a$ and joined the line with endpoints $(a,f(a))$
and $(x,f(x))$, we would obtain a secant line like that of figure
\ref{fig:right_secant}. Eventually, on getting closer to $(a, f(a))$
we obtain a line just barely grazing the curve---that is,
``tangent'' to the curve---at the point $(a, f(a))$, as in figure
\ref{fig:grazing}. \vspace{2cm}
\begin{figure}[h]
\begin{minipage}{5cm}
$$ \psset{unit=1pc}\psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-4,-4)(4,4)
\rput(-3,1){\psplot[linewidth=1.5pt,
linecolor=red]{-1.2}{4}{2.718282 x -1 mul
exp}\psline[linewidth=1.5pt,
linecolor=blue]{<->}(-1.5,3.305882425)(2,-.8073217528)
\psdots[dotscale=1,dotstyle=*](1,.3678794412)(-1, 2.718281828)}
\uput[d](-2,0){a}\rput(-2,0){|}
$$ \vspace{1cm} \footnotesize\hangcaption{Left secant through $(a,f(a))$.}
\label{fig:left_secant}
\end{minipage} \hfill
\begin{minipage}{5cm}
$$ \psset{unit=1pc}\psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-4,-4)(4,4)\rput(-3,1){\psplot[linewidth=1.5pt, linecolor=red]{-1.2}{4}{2.718282
x -1 mul exp}\psline[linewidth=1.5pt,
linecolor=blue]{<->}(4,-.1092591180)(-1.5,.7654949072)
\psdots[dotscale=1,dotstyle=*](1,.3678794412)(3,.04978706839)}
\uput[d](-2,0){a}\rput(-2,0){|} $$ \vspace{1cm}
\footnotesize\hangcaption{Right secant through $(a,f(a))$.}
\label{fig:right_secant}
\end{minipage} \hfill
\begin{minipage}{5cm}
$$ \psset{unit=1pc}\psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-4,-4)(4,4) \rput(-3,1){\psplot[linewidth=1.5pt, linecolor=red]{-1.2}{4}{2.718282
x -1 mul exp}\psline[linewidth=1.5pt,
linecolor=blue]{<->}(3.5,-.5518191618)(-2,1.471517765)
\psdots[dotscale=1,dotstyle=*](1,.3678794412)}
\uput[d](-2,0){a}\rput(-2,0){|}$$ \vspace{1cm}
\footnotesize\hangcaption{Line grazing  $(a,f(a))$.}
\label{fig:grazing}
\end{minipage}
\end{figure}

\bigskip

In the simplest of cases, if our curve is the line  $L: y=mx+k$,
then in a neighbourhood of the point $x=a$ the tangent line to $L$
should be itself! It is not true that every curve we consider would
have a unique ``tangent line'' at every point. For example, a curve
with a sharp edge as as $y=|x|$ at $x=0$ in figure
\ref{fig:smooth_func2} or the curve in figure \ref{fig:smooth_func3}
have infinitely many tangents at $x=0$. The curve $y=\dfrac{1}{x}$
is not even defined at $x=0$ and hence it does not have a tangent
there. On the other hand, the parabola $y=x^2$ is ``smooth'' at
$x=0$ and appears to have a unique tangent there. \vspace{1cm}
\begin{figure}[h]
\begin{minipage}{3.5cm}
$$\psset{unit=.5pc}  \psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-5,-5)(5,5)
\psline[linewidth=2pt,linecolor=red]{<->}(-2,4)(0,0)(2,4)
$$\vspace{1cm}\footnotesize \hangcaption{$y=|x|$ is non-smooth function at $x=0$.}
\label{fig:smooth_func2}
\end{minipage}
\hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.5pc, plotpoints=1000}  \psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-4}{4}{x abs .66666666 exp}
$$\vspace{1cm}\footnotesize \hangcaption{A non-smooth function at $x=0$.}
\label{fig:smooth_func3}
\end{minipage}\hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.5pc, algebraic=true}
\psaxes[linewidth=1.2pt,labels=none,ticks=none]{<->}(0,0)(-5,-5)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-.2}{-5}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.2}{5}{1/x}$$
\vspace{1cm}\footnotesize\hangcaption{ $y =
\dfrac{1}{x}$.}\label{fig:xy=1}\end{minipage} \hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.5pc}  \psaxes[linewidth=1.2pt,labels=none, ticks=none](0,0)(-5,-5)(5,5)
\psplot[linewidth=2pt,linecolor=red]{-2}{2}{x 2
exp}$$\vspace{1cm}\footnotesize\hangcaption{A smooth function at
$x=0$.} \label{fig:smooth_func}
\end{minipage}
\end{figure}

\vspace{1cm}


\begin{figure}[h]
\begin{minipage}{3.5cm}$$\psset{unit=.7pc}
\rput(0,-2){\psplot[linewidth=2pt,linecolor=red]{-3}{2}{2.718282 x
exp}
\psline[linewidth=1.2pt,linecolor=blue]{<->}(-3,-2)(2,3)}$$\vspace{1cm}\footnotesize\hangcaption{An
increasing curve.} \label{fig:increasing_curve}
\end{minipage}\hfill
\begin{minipage}{3.5cm}
$$\psset{unit=.7pc} \rput(0,-2){\psplot[linewidth=2pt,linecolor=red]{-2}{3}{0.3678794
x exp}
\psline[linewidth=1.2pt,linecolor=blue]{<->}(-3,4)(2,-1)}$$\vspace{1cm}\footnotesize\hangcaption{A
decreasing curve.} \label{fig:decreasing_curve}
\end{minipage}
\hfill
\begin{minipage}{3.5cm}
$$ \psset{unit=.7pc}
\parabola[linewidth=2pt,linecolor=red](2,4)(0,0)
\psline(-1,0)(1,0)\psline(-1.3,1.6)(0,-1)\psline(1.5,2.21)(0,-1.69)
$$ \vspace{1cm} \footnotesize\hangcaption{Convex curve.}
\label{fig:convex_curve}
\end{minipage} \hfill
\begin{minipage}{3.5cm}
$$ \psset{unit=.7pc} \rput{-180}(0,0){\parabola[linewidth=2pt,linecolor=red](2,4)(0,0)
\psline(-1,0)(1,0)\psline(-1.3,1.6)(0,-1)\psline(1.5,2.21)(0,-1.69)}$$
\vspace{1cm} \footnotesize\hangcaption{Concave curve.}
\label{fig:concave_curve}
\end{minipage}
\end{figure}
\begin{rem}
Notice that gathering tangent lines at diverse points of a curve
also gives us information about the monotonicity and convexity of
the curve. If the tangent line at a point to a curve has positive
slope, then the curve appears to increase. If inside an open
interval the curve appears to have a maximum or a minimum point,
then the tangent line there appears to be horizontal, that is, its
slope is $0$. It decreases otherwise (see figures
\ref{fig:increasing_curve} and \ref{fig:decreasing_curve}). It also
appears that if the slope of the tangent to a curve increases, that
is, if the tangent lies always below the curve, then the curve is
convex. Otherwise it is concave (see figures \ref{fig:convex_curve}
and \ref{fig:concave_curve}).
\end{rem}

Given now the formula for a function $f$ and a point $(a, f(a))$ on
the graph of $f$, how do we determine the tangent line to $f$ at
$(a, f(a))$?  Recall that if $\tends{\epsilon}{0}$, then
$a+\epsilon$ is in a neighbourhood of $a$. The slope of the secant
line joining $(a+\epsilon, f(a+\epsilon))$ and $(a,f(a))$ is
\begin{equation}  \dfrac{f(a+\epsilon)-f(a)}{\epsilon}\label{eq:slope_def_strong derivative } \end{equation}
We denote the value---if there is one---of \ref{eq:slope_def_strong
derivative }--- as $\tends{x}{\epsilon}$ by $f'(a)$. Hence for fixed
but small $\epsilon$ we have
$$\dfrac{f(a+\epsilon)-f(a)}{\epsilon} \approx f'(a) \implies f(a+\epsilon) \approx f(a) + f'(a)\epsilon .   $$
There is, generally, an error in taking the dextral side as an
approximation for the sinistral side on the above formula. We will
settle for having an error of the order of  $O(\epsilon^2)$, which
will normally will be a good compromise for most of the formul\ae\
we will encounter. This prepares the ground for our main definition
of this section.
\begin{df}Let $f$ be a function and let $a\in\dom{f}$.
When there is a number $f'(a)$ such that
$$f(a+\epsilon)=f(a)+f'(a)\epsilon+O(\epsilon^2) \qquad
\mathrm{as}\qquad \tends{\epsilon}{0}  $$ then we say that the
function  $f$ has a {\em strong derivative } $f'(a)$ or that $f$ is
{\em strongly differentiable } at $x=a$. If we consider the set
$\{x\in\dom{f}: f'(x) \ \mathrm{exists}\}$ then we may form the
function $x\mapsto f'(x)$ with domain $\dom{f'} = \{x\in\dom{f}:
f'(x) \ \mathrm{exists}\}$. We call the function $f'$ the {\em
strong derivative} of $f$. We will also often use the  symbol
$\diff{f(x)}{x}$ to denote the function $x\mapsto
f'(x)$.\index{strong
derivative}\index{differentiable}\index{derivative}\index{strongly
differentiable}
\end{df}
\begin{df}
If $f'$ is itself differentiable, then the function $(f')' = f''$ is
the {\em second derivative} of $f$. It is also denoted by
$\dfrac{\mathrm{d}^2}{\mathrm{d}x^2}\ f(x)$. We similarly define the
third, fourth, etc., derivatives. It is customary to denote the
first three derivatives of a function with primes, as in $f', f'',
f'''$, and any higher derivative with either roman numbers or with
the order of the derivative enclosed in parenthesis, as in $f^{iv},
f^{v}$ or $f^{(4)}, f^{(5)}$, etc.
\end{df}
\section{Graphical Differentiation}
Before we attack the problem of deducing the formula for the
derivative of a function through the formula of the function, let us
address the problem of obtaining an approximate value for the
derivative of a function through the graph of the function. It is
possible to estimate graphically the strong derivative of the
function by appealing to the interpretation that the strong
derivative  of a function at given point is the value of the slope
of the tangent at that given point.


\begin{exa}\label{exa:graphical_differentiation2}
Find an approximate graph for the derivative of $f$ given in figure
\ref{fig:graphical_differentiation2}.
\end{exa}
Solution: Observe that from the remarks following figure
\ref{fig:concave_curve}, we expect $f'$ to be positive in
$[-1.4;-0.6]$, since $f$ increases there. We expect $f'$ to be $0$
at $x=-0.6$, since $f$ appears to have a (local) maximum there. We
expect $f'$ to be negative in $[-0.6;0;6]$ since $f$ decreases
there. We expect  $f'$ to be $0$ at $x=0.6$, since $f$ appears to
have a (local) minimum there. Finally we expect $f'$ to be positive
for $[0.6;1.4]$ since $f$ is increasing there.

\bigskip

We now perform the following steps.
\begin{enumerate}
\item We first divide up the domain of $f$ into intervals of the same
length, in this case we will take intervals of length $0.2$.
\item For each endpoint $x$ of an interval above, we look at the
point $(x,f(x))$ on the graph of $f$.
\item We place a ruler so that it is tangent to the curve at $(x,
f(x))$.
\item We find the slope of the ruler. Recall that any two points on
the tangent line (the ruler) can serve to find the slope.
\item We tabulate the slopes obtained and we plot these values,
obtaining thereby an approximate graph of $f'$.
\end{enumerate}
In our case we obtain the following (approximate) values for
$f'(x)$.
$$
\begin{array}{|c|lllllllllllllll|}
\hline x &  -1.4 & -1.2 & -1 & -0.8 & -0.6 & -0.4 & -0.2 & 0 & 0.2 &
0.4 & 0.6 &  0.8 & 1 & 1.2 & 1.4 \\
\hline f'(x) &4.88  & 3.32&2 &0.92 & 0.08& -0.52&-0.88 & -1 &-0.88 &-0.52 & 0.08& 0.92&2 & 3.32 & 4.88 \\
\hline
\end{array}
$$

An approximate graph of the strong derivative  appears in figure
\ref{fig:graphical_differentiation2y'}.

 \vspace{3cm}
\begin{figure}[h]
\centering
\begin{minipage}{8cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-2,-2)(-2,-2)(2,2)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1.414213562}{1.414213562}{x*(x-1)*(x+1)}
\psaxes[xyLabel={\tiny}, Ox=-2,Oy=-2](-2,-2)(-2,-2)(2,2)
$$\vspace{3cm}\footnotesize\hangcaption{Example \ref{exa:graphical_differentiation2}. $y=f(x)$}
\label{fig:graphical_differentiation2}\end{minipage}
\begin{minipage}{8cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-2,-2)(-2,-2)(2,2)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1}{1}{3*x^2-1} \psaxes[xyLabel={\tiny},
Ox=-2,Oy=-2](-2,-2)(-2,-2)(2,2)
$$\vspace{3cm}\footnotesize\hangcaption{Example \ref{exa:graphical_differentiation2}. $y=f'(x)$}
\label{fig:graphical_differentiation2y'}\end{minipage}
\end{figure}




\begin{exa}\label{exa:graphical_differentiation1}
Figure \ref{fig:graphical_differentiation1y'} gives an approximate
graph of the strong derivative of the graph appearing in figure
\ref{fig:graphical_differentiation1}. \vspace{2cm}

\begin{figure}[h]
\centering
\begin{minipage}{7cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-1,-1)(-1,-1)(1,1)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{0}{1}{x^.3333333}
\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1}{0}{-1*abs(x)^.3333333}\psaxes[ xyLabel={\tiny},
Ox=-1,Oy=-1](-1,-1)(-1,-1)(1,1)
$$\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:graphical_differentiation1}. $y=f(x)$}\label{fig:graphical_differentiation1}\end{minipage}
\begin{minipage}{7cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-1,-1)(-1,-1)(1,1)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{.1924500897}{1}{.333333333*(1/x^.66666666)}
\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1}{-.1924500897}{.33333333333*(1/abs(x)^.6666666)}\psaxes[
xyLabel={\tiny}, Ox=-1,Oy=-1](-1,-1)(-1,-1)(1,1)
$$\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:graphical_differentiation1}. $y=f'(x)$}\label{fig:graphical_differentiation1y'}\end{minipage}
\end{figure}
To obtain it, we have served ourselves of the table below.
$$
\begin{array}{|c|rrrrrrrrrrr|}
\hline
x  &-1.0&-0.8&-0.6&-0.4&-0.2&0.0 &0.2&0.4&0.6&0.8&1.0\\
\hline f'(x) &0.3 &0.4 & 0.5 &0.6 &1.0 &+\infty &1.0&0.6&0.5&0.4&0.3
\\ \hline
\end{array}\\
$$

\end{exa}
\begin{exa}\label{exa:tangent_to_circle}
Consider the function $x\mapsto \sqrt{1-x^2}$ for $x\in [-1;1]$.
From example \ref{ex:sqrt(1-x^2)}, its graph is the upper unit
semicircle. A line from the origin to a point $(a, b)$ on the circle
has equation $y = \dfrac{b}{a}x$ (assume $ab \neq 0$).  Since a line
tangent to the semicircle at $(a, b)$ is perpendicular to the line
$y = \dfrac{b}{a}x$, the slope of the perpendicular line is
$-\dfrac{a}{b}$ in view of Theorem
\ref{thm:perpendicular_line_slope}. Hence the strong derivative  at
the point $x=a$ is $-\dfrac{a}{b}$. Since $b = \sqrt{1-a^2}$, we
find that for $a\in ]-1;1[$, the strong derivative  when $x=a$ is
$-\dfrac{a}{\sqrt{1-a^2}}.$ We will shew how to graph the function
$x\mapsto -\dfrac{x}{\sqrt{1-x^2}}$ in example
\ref{exa:y=-x/sqrt(1-x^2)}, but for now, an approximate tabulation
gives

$$
\begin{array}{|c|rrrrrrrrrrr|}
\hline
x  &-1.0&-0.8&-0.6&-0.4&-0.2&0.0 &0.2&0.4&0.6&0.8&1.0\\
\hline f'(x) &+\infty &1.33 & 0.75 &0.44 &0.20 &0
&-0.20&-0.44&-0.75&-1.33&-\infty
\\ \hline
\end{array}\\
$$

\bigskip

The approximate graph appears in figure
\ref{fig:tangent_to_circley'}.

\vspace{2cm}

\begin{figure}[h]
\centering
\begin{minipage}{7cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-1,-1)(-1,-1)(1,1)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1}{1}{sqrt(1-x^2)} \psaxes[ xyLabel={\tiny},
Ox=-1,Oy=-1](-1,-1)(-1,-1)(1,1)
$$\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:tangent_to_circle}. $y=f(x)$}
\label{fig:tangent_to_circle}\end{minipage}
\begin{minipage}{7cm}$$\psset{unit=4pc}
\psgrid[subgriddiv=5,
gridlabels=0](-1,-1)(-1,-1)(1,1)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-.7071067810}{.7071067810}{-1*x/sqrt(1-x^2)}
\psaxes[ xyLabel={\tiny}, Ox=-1,Oy=-1](-1,-1)(-1,-1)(1,1)
$$\vspace{2cm}\footnotesize\hangcaption{Example \ref{exa:tangent_to_circle}. $y=f'(x)$}
\label{fig:tangent_to_circley'}\end{minipage}
\end{figure}
\end{exa}

\section{Derivatives and Graphs}
In this section we prove the remarks following figure
\ref{fig:concave_curve} which will be the main tools for graphing in
subsequent chapters.
\begin{thm}
If $f$ is strongly differentiable  at $x$ then $f$ is continuous at
$x$.
\end{thm}
\begin{pf}
We have $f(x+\epsilon) = f(x) + f'(x)\epsilon + O(\epsilon^2)$. If
$\epsilon > 0$ and $\tends{\epsilon}{0}$ then $f(x+\epsilon) =
f(x+)$ and similarly if $\epsilon < 0$ and $\tends{\epsilon}{0}$
$f(x+\epsilon) = f(x-)$. Hence we have $f(x+)=f(x)=f(x-)$, and $f$
is continuous at $x$.
\end{pf}

\begin{thm}\label{thm:monotonicity_criteria} Let $f$ be
strongly differentiable  at $x$. If $f'(x)>0$ then  $f$ is
increasing in a neighbourhood of $x$, if $f'(x) <0$ then $f$ is
decreasing in a neighbourhood of $x$.
\end{thm}
\begin{pf}We have $f(x+\epsilon) - f(x) = f'(x)\epsilon +
O(\epsilon^2)$. For $\epsilon$ very small, this means that
$$f(x+\epsilon) - f(x) \approx f'(x)\epsilon,$$ that is, the sign of
$f(x+\epsilon) - f(x)$ is the same as the sign of $f'(x)\epsilon$.
Thus if $\epsilon > 0$ and $f'(x) > 0$, then $f(x+\epsilon)> f(x)$,
that is, $f$ is increasing. If $\epsilon > 0$ and $f'(x) < 0$, then
$f(x+\epsilon)< f(x)$, that is, $f$ is decreasing. Similar
conclusions are reached when considering $\epsilon < 0$ and the
theorem is proved.
\end{pf}
\begin{df}
If $f$ is strongly differentiable  at $x$ and $f'(x) = 0$, then we
say that $x$ is a {\em stationary point of $f$.}
\end{df}
\begin{df}
If there is a point $a$ for which $f(x) \leq f(a)$ for all $x$ in a
neighbourhood centred at  $x=a$ then we say that $f$ has a {\em
local maximum} at $x=a$. Similarly, if there is a point $b$ for
which $f(x) \geq f(b)$ for all $x$ in a neighbourhood centred at
$x=b$ then we say that $f$ has a {\em local minimum} at $x=b$.
\end{df}
\begin{thm}\label{thm:local_extrema}
If $f$ is strongly differentiable  at $x=a$, $f'(a) = 0$, and $f'$
changes from $+$ to $-$ in a neighbourhood of $a$ then $x=a$ is a
local maximum. If $f$ is strongly differentiable  at $x=b$,
$f'(b)=0$, and $f'$ changes from $-$ to $+$ in a neighbourhood of
$b$ then $x=b$ is a local minimum.
\end{thm}
\begin{pf}
By Theorem \ref{thm:monotonicity_criteria}, when $f'$ changes from
$+$ to $-$, $f$ is increasing and then decreasing in a neighbourhood
of $x=a$. By Weierstrass's Theorem (Theorem \ref{thm:weierstrass}),
$f$ assumes a maximum on a closed neighbourhood containing $a$. It
cannot be to the left of $a$ since the function is increasing there,
and it cannot be to the right of $a$ since the function is
decreasing there. Hence the maximum must be at $x=a$ and so
$f(x)\leq f(a)$ for $x$ in a neighbourhood of $a$. The result just
obtained applied to $-f$ yields the second half of the theorem.
\end{pf}


\begin{exa}
\label{exa:graph_maxima_minima} The graph of the strong derivative
$f'$ of a function $f$ is given in figure
\ref{fig:graph_maxima_minima}. Then according to Theorem
\ref{thm:local_extrema} $f$ has a local minimum at $x = -2$ and
$x=2$, and a local maximum at $x=0$ and $x=4$.
\end{exa}

\vspace{1cm}
\begin{figure}[h]
\centering
\begin{minipage}{5cm}
$$\psset{unit=.7pc}\psaxes[xyLabel={\tiny},linewidth=1.2pt](0,0)(-4,-3)(6,6)
\psplot[linewidth=2pt,linecolor=red,
algebraic=true]{-2.5}{4.5}{-.1*x*(x+2)*(x-2)*(x-4)}
$$
 \vspace{1cm}\footnotesize \hangcaption{Example \ref{exa:graph_maxima_minima}.} \label{fig:graph_maxima_minima}
\end{minipage}
\end{figure}


\begin{lem}\label{lem:convexity_criteria}
If $f'$ increases in a neighbourhood of $x$, then $f$ is convex in a
neighbourhood of $x$. Similarly, if $f'$ decreases in a
neighbourhood of $x$, then $f$ is concave in a neighbourhood of $x$.
\end{lem}
\begin{pf}
Let $\epsilon > 0$.  Then
$$f(x) = f(x-\epsilon+\epsilon) = f(x-\epsilon) + f'(x-\epsilon)\epsilon + O(\epsilon^2),$$
$$f(x) = f(x+\epsilon-\epsilon) = f(x+\epsilon) - f'(x+\epsilon)\epsilon + O(\epsilon^2).$$
Adding, $$2f(x)   = f(x+\epsilon) + f(x-\epsilon) + \left(
f'(x-\epsilon) - f'(x+\epsilon)\right)\epsilon + O(\epsilon^2).$$
For $\epsilon$ very small we then have
$$2f(x)  \approx  f(x+\epsilon) + f(x-\epsilon) + \left(
f'(x-\epsilon) - f'(x+\epsilon)\right)\epsilon .$$ If $f'$ is
increasing then $f'(x-\epsilon) - f'(x+\epsilon) < 0$. Since
$\epsilon > 0$ this implies that
$$2f(x)  <  f(x+\epsilon) + f(x-\epsilon), $$
which means that $f$ is convex in a neighbourhood of $x$. This
result now applied to $-f$ gives the second half of the theorem.
\end{pf}




\begin{thm}\label{thm:convexity_criteria} A twice strongly differentiable -function $f$ is convex in a neighbourhood of  $x=a$ if
$f''(a) > 0$. It is concave in a neighbourhood of  $x=b$ if $f''(b)
< 0$.
\end{thm}
\begin{pf}This follows from Lemma \ref{lem:convexity_criteria} and
Theorem \ref{thm:monotonicity_criteria}.
\end{pf}



\chapter{Polynomial Functions}\thispagestyle{empty}
In this chapter we study polynomials and their graphs. In order to
do the latter, we demonstrate the Power Rule, the Sum Rule, the
Product Rule, and the Chain Rule for derivatives. We also study some
algebraic topics related to the roots of a polynomial.
\section{Power Functions and the Power Rule}
By a {\em power function} we mean a function of the form $x\mapsto
x^\alpha$, where $\alpha \in \BBR$. In this chapter we will only
study the case when $\alpha$ is a positive integer.
\index{function!power}

\bigskip
If $n$ is a positive integer, we are interested in how to graph
$x\mapsto x^n$. We have already encountered a few instances of power
functions. For $n = 0$, the function $x\mapsto 1$ is a constant
function, whose graph is the straight line $y=1$ parallel to the
$x$-axis. For $n=1$, the function $x\mapsto x$ is the identity
function, whose graph is the straight line $y=x$, which bisects the
first and third quadrant. For $n=2$, we have the square  function
$x\mapsto x^2$ whose graph is the parabola $y=x^2$  encountered in
example \ref{exa:y=x^2}. We reproduce their graphs below in figures
\ref{fig:poly_y=1} through \ref{fig:poly_y=x^2} for easy reference.

\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{4cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none,
linewidth=1.5pt]{->}(0,0)(-2.5,-2.5)(2.5,2.5) \psline[linewidth=2pt,
linecolor=red]{<->}(-2.5,1)(2.5,1)
$$
\vspace{1cm}\tiny\hangcaption{$x\mapsto 1$.} \label{fig:poly_y=1}
\end{minipage}\hfill
\begin{minipage}{4cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none,
linewidth=1.5pt]{->}(0,0)(-2.5,-2.5)(2.5,2.5) \psline[linewidth=2pt,
linecolor=red]{<->}(-2.5,-2.5)(2.5,2.5)
$$
\vspace{1cm}\tiny\hangcaption{$x\mapsto x$.} \label{fig:poly_y=x}
\end{minipage}\hfill
\begin{minipage}{4cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none,
linewidth=1.5pt]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\parabola[linewidth=2pt, linecolor=red]{<->}(1.58,2.5)(0,0)
$$
\vspace{1cm}\tiny\hangcaption{$x\mapsto x^2$.}
\label{fig:poly_y=x^2}
\end{minipage}
\end{figure}

\bigskip

By the groundwork from the preceding chapter, we know we can gather
information about the monotonicity and convexity of the function
$x\mapsto x^n$ by studying its first and second derivatives. For
that we first establish a series of lemmata.

\begin{lem}\label{exa:D(k)=0}The strong derivative of a constant
function is the $0$ function. In symbols, if $f$ is a function with
assignment rule $f(x) = k$, constant, then for all $x$, $f'(x) = 0$.
\end{lem}
\begin{pf}
We have
$$f(x+\epsilon)=k= k+0\cdot\epsilon+0\epsilon^2, $$which proves the
assertion.
\end{pf}
\begin{rem}
For ellipsis we will write $(k)' = 0$ or $\diff{k}{x} = 0$.
\end{rem}

\begin{lem}\label{exa:D(x)=x} The strong derivative of the identity
function $x\mapsto x$ is the constant function $x \mapsto 1$.
\end{lem}
\begin{pf}
If $ f(x)=x$ we have
$$f(x+\epsilon)=x+\epsilon=x+1\cdot\epsilon+0\epsilon^2,$$ and so
$f'(x) = 1$.
\end{pf}
\begin{rem}
For ellipsis we will write $(x)' = 1$ or $\diff{x}{x} = 1$.
\end{rem}
\begin{lem}\label{exa:D(x^2)=2x} The strong derivative of the square function
$x\mapsto x^2$ is the function $x\mapsto 2x$.
\end{lem}
\begin{pf}
If $ f(x)=x^2$ we have
$$f(x+\epsilon) = (x+\epsilon)^2=x^2+2x\epsilon+\epsilon^2 =f(x)+2x\epsilon+O(\epsilon^2),
$$proving the assertion. For ellipsis we will write
 $(x^2)' = 2x$ or $\diff{x^2}{x} = 2x$.
\end{pf}
\begin{lem}\label{exa:D(x^3)=3x^2} The strong derivative of the
cubic function $x\mapsto x^3$ is the function $x\mapsto 3x^2$.
\end{lem}
\begin{pf}If $ f(x)=x^3$ we have, using Lemma
\ref{exa:D(x^2)=2x},
$$\begin{array}{lll}(x+\epsilon)^3& = & (x+\epsilon)(x^2+2x\epsilon+O(\epsilon^2))\\
& = & x^3 + 2x^2\epsilon +O(x\epsilon^2)+ x^2\epsilon +
2x\epsilon^2+ O(\epsilon ^3) \\
& = & x^3 + 3x^2\epsilon +O(\epsilon^2),
\end{array}$$as $\tends{\epsilon}{0}$, and  so $(x^3)' = 3x^2$ (or $\diff{x^3}{x} = 3x^2$).
\end{pf}
We will now see that the pattern
$$\diff{x^0}{x} = 0, \qquad \diff{x^1}{x} = 1, \qquad \diff{x^2}{x} = 2x, \qquad \diff{x^3}{x} = 3x^2,   $$
is preserved for higher powers of the exponent. Arguing as in Lemma
\ref{exa:D(x^3)=3x^2}, we obtain the following theorem.
\begin{thm}[Power Rule] If $n$ is a positive integer, $\diff{x^n}{x} =
nx^{n-1}$. \label{thm:power_rule} \index{differentiation!power rule}
\end{thm}

\begin{pf} If the strong derivative  of $\diff{x^n}{x} = d_n(x)$, we have
$$\begin{array}{lll} (x+\epsilon)^{n+1}&=&(x+\epsilon)\left(x^n+d_n(x)\epsilon
+O(\epsilon^2)\right)\\
&=&x^{n+1}+\left(xd_n(x)+x^n\right)\epsilon+O(\epsilon^2)\\
\end{array}$$from where the strong derivative  of $x^{n+1}$ is $xd_n(x)+x^n$. Since $d_1(x) = 1$, we have by recurrence,
 $$\begin{array}{llllll} d_2(x) & = & xd_1(x)+x^1 & = x\cdot 1 + x & = & 2x\\
d_3(x) & = & xd_2(x)+x^2 & = x\cdot (2x) + x^2 & = & 3x^2\\
d_4(x) & = & xd_3(x)+x^3 & = x\cdot (3x^2) + x^3 & = & 4x^3\\
d_5(x) & = & xd_4(x)+x^4 & = x\cdot (4x^3) + x^4 & = & 5x^4\\
d_6(x) & = & xd_5(x)+x^5 & = x\cdot (5x^4) + x^5 & = & 6x^5\\
d_7(x) & = & xd_6(x)+x^6 & = x\cdot (6x^5) + x^6 & = & 7x^6,\\
 \end{array} $$
and so, by recursion, $d_n(x)=nx^{n-1}$.
\end{pf}
\begin{exa}
We have $$ \diff{x^3}{x} = 3x^2, \qquad \diff{x^7}{x} = 7x^6, \qquad
\diff{x^{1000}}{x} = 1000x^{999},
$$etc.

\end{exa}

\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^2}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^2$.} \label{fig:xmapsx^2}
\end{minipage}\hfill
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^4}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^4$.} \label{fig:xmapsx^4}
\end{minipage}\hfill
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^6}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^6$.} \label{fig:xmapsx^6}
\end{minipage}\hfill
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^3}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^3$.} \label{fig:xmapsx^3}
\end{minipage}\hfill
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^5}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^5$.} \label{fig:xmapsx^5}
\end{minipage}\hfill
\begin{minipage}{2cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
\psplot[linewidth=2pt, linecolor=red]{-1.2}{1.2}{x^7}
$$
\vspace{2cm}\tiny\hangcaption{$y = x^7$.} \label{fig:xmapsx^7}
\end{minipage}

\end{figure}


We now address the problem of how to graph $x\mapsto x^n$.
\begin{thm}\label{thm:power_functions}
Let $n \geq 2$ be an integer and $f(x) = x^n$. Then
\begin{itemize}
\item if $n$ is even, $f$ is convex, $f$ is decreasing for $x<0$,
and $f$ is increasing for $x>0$. Also, $f(-\infty) = f(+\infty) =
+\infty$.
\item if $n$ is odd, $f$ is increasing, $f$ is concave for $x<0$,
and $f$ is convex for $x>0$.  Also, $f(-\infty)= -\infty$ and $
f(+\infty) = +\infty$.
\end{itemize}
\end{thm}
\begin{pf}If $n \geq 2$ is even, $n-1 \geq 1$ is odd, and $n-2$ is even. Now $f'(x) =
nx^{n-1}$ and $f''(x) = n(n-1)x^{n-2}$. Since $x^{n-2}>0$ for all
$x\neq 0$, $f''(x) > 0$ for $x\neq 0$ and so it is convex. Since $x
< 0 \implies x^{n-1}<0 \implies f'(x) <0$, $f$ is decreasing for
$x<0$. A similar argument shews that $f$ is increasing for $x> 0$.
It is clear that  $f(-\infty) = f(+\infty) = +\infty$.
\bigskip
If $n \geq 3$ is odd, $n-1 \geq 1$ is even, and $n-2$ is odd. Now
$f'(x) = nx^{n-1}$ and $f''(x) = n(n-1)x^{n-2}$. Since $x^{n-1}>0$
for all $x\neq 0$, $f'(x) > 0$ for $x\neq 0$ and so it is
increasing. Since $x < 0 \implies x^{n-2}<0 \implies f''(x) <0$, $f$
is concave for $x<0$. A similar argument shews that $f$ is convex
for $x> 0$. It is clear that $f(-\infty)= -\infty$ and $ f(+\infty)
= +\infty$.
\end{pf}
The graphs of $y = x^2$, $y = x^4$, $y = x^6$, etc., resemble one
other. For $-1 \leq x \leq 1$, the higher the exponent, the flatter
the graph (closer to the $x$-axis) will be, since $$|x|<1 \implies
\cdots < x^6 < x^4 < x^2 < 1.
$$ For $|x| \geq 1$, the higher the exponent, the steeper the graph
will be since $$|x|>1 \implies \cdots > x^6 > x^4 > x^2 > 1.
$$Similarly for the graphs of $y=x^3$, $y=x^5$, $y=x^7$ etc.
This information is summarised in the tables below.
\begin{table}[h]\centering
\begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & 0 &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

  &  &   & & \nearrow &     \\

 f(x) = x^n &  &  & 0 &  &    \\
     & & \nearrow & &  &    \\
 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto x^n$, with $n>0$ integer and odd.}
            \end{minipage} \begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & 0 &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

  &  & \searrow  & & \nearrow &     \\

 f(x) = x^n &  &  & 0 &  &    \\
 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto x^n$, with $n>0$ integer and even.}
            \end{minipage}
\end{table}
\begin{exa}
Figures \ref{fig:poly_y=(x-1)^3} through
\ref{fig:poly_y=(|x|-1)^3+1} shew a few transformations of the
function $x\mapsto x^3$.
\end{exa}
\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4cm}
$$\psset{unit=1pc, algebraic=true} \psaxes[linewidth=1.2pt,
labels=none]{->}(0,0)(-6.5,-6.5)(6.5,6.5)
\psplot[linewidth=2pt,linecolor=red]{-.9129311828}{2.709975947}{(x-1)^3+1}
$$\vspace{2cm}\footnotesize\hangcaption{$y=(x-1)^3
+1$}\label{fig:poly_y=(x-1)^3}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=1pc, algebraic=true} \psaxes[linewidth=1.2pt,
labels=none]{->}(0,0)(-6.5,-6.5)(6.5,6.5)
\psplot[linewidth=2pt,linecolor=red]{-.9129311828}{2.709975947}{abs((x-1)^3+1)}$$
\vspace{2cm}\footnotesize\hangcaption{$y=|(x-1)^3 +1|$}
\label{fig:poly_y=|(x-1)^3+1|}
\end{minipage}
\hfill
\begin{minipage}{4cm}
$$\psset{unit=1pc,algebraic=true} \psaxes[linewidth=1.2pt,
labels=none]{->}(0,0)(-6.5,-6.5)(6.5,6.5)
\psplot[linewidth=2pt,linecolor=red]{-2.709975947}{2.709975947}{(abs(x)-1)^3+1}$$\vspace{2cm}\footnotesize\hangcaption{$y=(|x|-1)^3
+1$}\label{fig:poly_y=(|x|-1)^3+1}
\end{minipage}
\end{figure}

\section{Sum Rule}
In this section we prove two more differentiation rules.
\begin{thm}[Constant-Times-Function Rule]If $k\in\BBR$ is a real
number constant, and $f$ is a strongly differentiable   function at
$x$, then $kf$ is strongly differentiable  at $x$ and $(kf)'(x) =
kf'(x)$.
\label{thm:constant-times-function_rule}\index{differentiation!constant
times a function rule}
\end{thm}
\begin{pf}We have
$$\begin{array}{lll}
(kf)(x+\epsilon)& = & k(f(x+\epsilon)) \\
& = & k\left(f(x)+f'(x)\epsilon +
O(\epsilon^2)\right) \\
& = & kf(x) +kf'(x)\epsilon + O(\epsilon^2),
\end{array}$$from where the theorem follows.
\end{pf}

\begin{exa}
We have proved that $(x^2)' = 2x$. Hence $(-3x^2)' = -3(x^2)' =
-3(2x) = -6x$.
\end{exa}


\begin{thm}[Sum Rule]If $f, g$ are strongly differentiable   functions at $x$,
then $f+g$ is strongly differentiable  at $x$ and $$(f+g)'(x) =
f'(x)+g'(x).$$ \label{thm:sum_rule}\index{differentiation!sum rule}
\end{thm}
\begin{pf}We have
$$\begin{array}{lll}
f(x+\epsilon)+g(x+\epsilon)& = &(f(x)+f'(x)\epsilon +
O(\epsilon^2))+(g(x)+g'(x)\epsilon + O(\epsilon^2)) \\
& = & (f(x)+g(x)) +(f'(x)+g'(x))\epsilon + O(\epsilon^2),
\end{array}$$from where the theorem follows.
\end{pf}

\begin{exa}
We have proved that $(x^2)' = 2x$ and that $(x)' = 1$. Hence $(x^2 +
x)' = (x^2)' + (x)'= 2x + 1$.
\end{exa}

\begin{exa} Let $f(x)=2x^3 -x^2 + 5x - 1$. Find $f'(1)$ and $f''(-1)$. \end{exa}
Solution: We have $$f'(x)= 2(3x^2) -2x + 5 = 6x^2 -2x + 5,\qquad
f''(x) = 2(6x) -2 = 12x -2.$$ Hence $f'(1) = 9$ and $f''(-1)= -14$.

\section{Affine Functions}\label{sec:affine_functions}
\begin{df}
Let $m, k$ be real number constants. A function of the form
$x\mapsto mx + k$ is called an {\em affine function}. In the
particular case that $m = 0$,  we call $x\mapsto k$  a {\em constant
function}. If, however, $k = 0$, then we call the function $x\mapsto
mx$ a {\em linear function}.
\index{function!linear}\index{function!affine}\index{function!constant}
\end{df}
By virtue of Theorem \ref{thm:graph_mx+k}, the graph of the function
$x\mapsto mx + k$ is a straight line. Since the derivative of
$x\mapsto mx + k$ is $(mx+k)' = m$, we see that $x\mapsto mx + k$ is
strictly increasing if $m>0$ and strictly decreasing if $m<0$ in
view of Theorem \ref{thm:monotonicity_criteria}. If $m\neq 0$ then
$mx +k = 0\implies x=-\dfrac{k}{m}$, meaning that $x\mapsto mx+k$
has a unique zero (crosses the $x$-axis) at $x=-\dfrac{k}{m}$. This
information is summarised in the following tables.

\begin{table}[h]\centering
\begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & -\dfrac{k}{m} &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

  &  &   & & \nearrow &     \\

 f(x)=mx+k &  &  & 0 &  &    \\
     & & \nearrow & &  &    \\
 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto mx+k$, with $m>0$.}
            \end{minipage}
            \begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & -\dfrac{k}{m} &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

  &  & \searrow  & &  &     \\

 f(x)=mx+k &  &  & 0 &  &    \\
     & &  & & \searrow &    \\
 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto mx+k$, with $m<0$.}
            \end{minipage}
\end{table}


\section{Quadratic Functions}\label{sec:quadratic_functions}

\begin{df}Let $a, b, c$ be real numbers, with $a\neq 0$.
A function of the form $$\fun{f}{x}{ax^2+bx+c}{\BBR}{\BBR}   $$ is
called a {\em quadratic function}.
\end{df}
\begin{thm}\label{thm:behaviour_of_a_quadratic}Let $a\neq 0, b, c$ be real numbers and let $x \mapsto ax^2 + bx + c$  be a quadratic
function. Then its graph is a parabola. If $a>0$ the parabola has a
local minimum at $x=-\dfrac{b}{2a}$ and it is convex. If $a < 0$ the
parabola  has a local maximum at $x=-\dfrac{b}{2a}$ and it is
concave.
\end{thm}
\begin{pf}Put $f(x) =ax^2+bx + c$. Completing squares,
$$\begin{array}{lll} ax^2 + bx + c  & = &
a\left(x^2 + 2\dfrac{b}{2a}x + \dfrac{b^2}{4a^2}\right) +
c-\dfrac{b^2}{4a} \\ & = & a\left(x + \dfrac{b}{2a}\right)^2 +
\dfrac{4ac - b^2}{4a},
\end{array}$$
and hence this is a horizontal translation $-\dfrac{b}{2a}$ units
and a vertical translation $\dfrac{4ac - b^2}{4a}$ units of the
square function $x\mapsto x^2$ and so it follows from example
\ref{exa:square_function} and Theorems \ref{thm:translations} and
\ref{thm:distortions}, that the graph of $f$ is a parabola.

\bigskip

We have $f'(x) = 2ax+b$. Assume first that $a>0$. Then $$f'(x) > 0
\iff x>-\dfrac{b}{2a},\qquad  f'(x) < 0 \iff x<-\dfrac{b}{2a}.$$Thus
the function decreases for values $<-\dfrac{b}{2a}$ and increases
otherwise. Hence in view of Theorem \ref{thm:local_extrema}, it must
have a minimum at $x=-\dfrac{b}{2a}$. Since $f''(x) = 2a >0$, $f$ is
convex by virtue of Theorem \ref{thm:convexity_criteria}. The case
when $a<0$ can be similarly treated.
\end{pf}The information of Theorem
\ref{thm:behaviour_of_a_quadratic} is summarised in the following
tables.
\begin{table}[h]\centering
\begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & -\dfrac{b}{2a} &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

  &  & \searrow   & & \nearrow &     \\

 f(x)=ax^2+bx+c &  &  & 0 &  &    \\
 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto ax^2+bx+c$, with $a>0$.}
            \end{minipage}
            \begin{minipage}{8cm}
$$
\begin{array}{|c|ccccc|}
 \hline
  x& -\infty &  & -\dfrac{b}{2a} &  & +\infty   \\
 \hline
  &  &  &  &  &    \\

 f(x)=ax^2+bx+c &  &  & 0 &  &    \\

  &  & \nearrow  & & \searrow &     \\

 \hline
            \end{array}$$ \footnotesize\hangcaption{$x\mapsto ax^2+bx+c$, with $a<0$.}
            \end{minipage}
\end{table}

\begin{df}
The point  $\left(-\dfrac{b}{2a},  \dfrac{4ac - b^2}{4a}\right)$
lies on the parabola and it is called the {\em vertex} of the
parabola $y=ax^2+bx+c$. The quantity $b^2-4ac$ is called the {\em
discriminant} of $ax^2+bx+c$. The equation
$$ y = a\left(x + \dfrac{b}{2a}\right)^2 +
\dfrac{4ac - b^2}{4a}  $$ is called the {\em canonical equation of
the parabola} $y=ax^2+bx+c$.
\end{df}

\begin{rem}The parabola $x\mapsto ax^2+bx+c$ is symmetric about the
vertical line $x=-\dfrac{b}{2a}$ passing through its vertex.
\end{rem}

\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4.5cm}$$
\psset{unit=1pc} \psaxes[labels=none, ticks=none](0,0)(-4,-4)(4,4)
\rput(-1,1){\parabola[linewidth=2pt,linecolor=red]{<->}(2,4)(0,0)}
\rput{180}(1,-1){\parabola[linewidth=2pt,linecolor=blue]{<->}(2,4)(0,0)}$$
\vspace{1cm}\footnotesize\hangcaption{No real zeroes.}
\label{fig:no_real_zero}
\end{minipage} \hfill
\begin{minipage}{4.5cm}$$
\psset{unit=1pc} \psaxes[labels=none, ticks=none](0,0)(-4,-4)(4,4)
\rput(-1,0){\parabola[linewidth=2pt,linecolor=red]{<->}(2,4)(0,0)}
\rput{180}(1,0){\parabola[linewidth=2pt,linecolor=blue]{<->}(2,4)(0,0)}$$
\vspace{1cm}\footnotesize\hangcaption{One real
zero.}\label{fig:one_real_zero}
\end{minipage} \hfill
\begin{minipage}{4.5cm}$$
\psset{unit=1pc} \psaxes[labels=none, ticks=none](0,0)(-4,-4)(4,4)
\rput(-2,-2){\parabola[linewidth=2pt,linecolor=red]{<->}(2,4)(0,0)}
\rput{180}(2,2){\parabola[linewidth=2pt,linecolor=blue]{<->}(2,4)(0,0)}$$
\vspace{1cm}\footnotesize\hangcaption{Two real
zeros.}\label{fig:two_real_zeros}
\end{minipage}

\end{figure}

\begin{cor}[Quadratic Formula] \label{cor:quadratic_formula}
The roots of the equation $ ax^2+bx+c=0$ are given by the formula
\begin{equation} ax^2 + bx + c = 0  \iff  x = \dfrac{-b\pm\sqrt{b^2 -4ac}}{2a}
 \label{eq:quadratic_formula}\index{Formula!Quadratic}\end{equation}
If $a\neq 0, b, c$ are real numbers and $b^2-4ac= 0$, the parabola
$x\mapsto ax^2+bx+c$ is tangent to the $x$-axis and has one
(repeated) real root. If $b^2-4ac
> 0$ then the parabola has two distinct real roots. Finally,  if $b^2-4ac < 0$ the
parabola has two complex roots.
\end{cor}
\begin{pf}
By Theorem \ref{thm:behaviour_of_a_quadratic} we have
$$ax^2 + bx + c  =  a\left(x + \dfrac{b}{2a}\right)^2 +
\dfrac{4ac - b^2}{4a},  $$ and so
$$\begin{array}{lll} ax^2 + bx + c = 0
& \iff & \left(x + \dfrac{b}{2a}\right)^2
=\dfrac{b^2 -4ac}{4a^2} \\
& \iff & x + \dfrac{b}{2a}
=\pm\dfrac{\sqrt{b^2 -4ac}}{2|a|} \\
& \iff & x = \dfrac{-b\pm\sqrt{b^2 -4ac}}{2a}, \\
\end{array}$$
where we have dropped the absolute values on the last line because
the only effect of having $a<0$ is to change from    $\pm$ to $\mp$.

\bigskip

If $b^2-4ac=0$ then the vertex of the parabola is at
$\left(-\dfrac{b}{2a}, 0\right)$ on the $x$-axis, and so the
parabola is tangent there. Also, $x=-\dfrac{b}{2a}$ would be the
only root of this equation. This is illustrated in figure
\ref{fig:one_real_zero}.

\bigskip

If $b^2-4ac>0$, then $\sqrt{b^2-4ac}$ is a real number $\neq 0$ and
so $\dfrac{-b-\sqrt{b^2 -4ac}}{2a}$ and $\dfrac{-b+\sqrt{b^2
-4ac}}{2a}$ are distinct numbers. This is illustrated in figure
\ref{fig:two_real_zeros}.

\bigskip

If $b^2-4ac<0$, then $\sqrt{b^2-4ac}$ is a complex number $\neq 0$
and so $\dfrac{-b-\sqrt{b^2 -4ac}}{2a}$ and $\dfrac{-b+\sqrt{b^2
-4ac}}{2a}$ are distinct complex numbers. This is illustrated in
figure \ref{fig:no_real_zero}.
\end{pf}

\begin{rem}
If a quadratic has real roots, then the vertex lies on a line
crossing the midpoint between the roots.
\end{rem}

\begin{exa}\label{exa:parabola4}
Consider the quadratic function $f(x) = x^2 - 5x + 3$.
\begin{multicols}{2}
\begin{dingautolist}{202}
\item Find $f'(x)$. Solve $f'(x) = 0$ and hence find the vertex of $f$. Determine the
intervals of monotonicity of $f$.
\item Write this parabola in canonical form.
\item Determine $f''(x)$  and find the
convexity intervals of $f$.
\item Find the $x$-intercepts and $y$-intercepts of $f$.
\item Graph $y = f(x)$, $y = |f(x)|$, and $y = f(|x|)$.
\item Determine the set of real numbers $x$ for which $f(x) > 0$.
\end{dingautolist}\end{multicols}
\end{exa}Solution:
\begin{dingautolist}{202}
\item We have $f'(x)=2x-5$. Now, $2x-5 = 0\implies x = \dfrac{5}{2}$. At $x=
\dfrac{5}{2}$ we have $f\left(\dfrac{5}{2}\right) = -\dfrac{13}{4}$,
whence the vertex is at $\left(\dfrac{5}{2}, -\dfrac{13}{4}\right)$.
Also,
$$f'(x) > 0 \implies 2x-5 > 0 \implies x > \dfrac{5}{2},$$and $f$
will be increasing for $x>\dfrac{5}{2}$. It will be decreasing for
$x < \dfrac{5}{2}$.
\item Completing squares $$ y = x^2-5x+3 = \left(x-\dfrac{5}{2}\right)^2  -\dfrac{13}{4}. $$
\item We have $f''(x) = (2x)' = 2$. Since $f''(x) = 2 > 0$ for all real values $x$, $f$ is
concave for all real values of $x$.
\item For $x = 0$, $f(0) = 0^2 - 5\cdot 0 + 3 = 3$, and hence $y = f(0) =
3$ is the $y$-intercept. By the quadratic formula,
$$f(x) = 0 \iff x^2-5x+3 = 0 \iff x = \dfrac{-(-5)\pm\sqrt{(-5)^2-4(1)(3)}}{2(1)} = \dfrac{5\pm \sqrt{13}}{2}. $$
Observe that $\dfrac{5- \sqrt{13}}{2} \approx 0.697224362$ and
$\dfrac{5+ \sqrt{13}}{2} \approx 4.302775638$.
\item The graphs appear in figures \ref{fig:parabola4} through \ref{fig:parabola4f(|.|)}.
\item From the graph in figure \ref{fig:parabola4}, $x^2 -5x + 3 > 0$ for values $x\in \loro{-\infty}{ \dfrac{5-
\sqrt{13}}{2}}$ or $x\in \loro{\dfrac{5+ \sqrt{13}}{2}}{ +\infty }$.
\end{dingautolist}
\vspace{2.5cm}
\begin{figure}[h]
\begin{minipage}{5cm}
$$\psset{algebraic=true, unit=.5pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none, linewidth=1.5pt]{->}(0,0)(-10,-10)(10,10)
\psplot[linewidth=2pt, linecolor=red]{-1}{6}{x^2-5*x+3}$$
\vspace{2cm}\footnotesize\hangcaption{$y = x^2-5x + 3$}
\label{fig:parabola4}
\end{minipage}
\hfill
\begin{minipage}{5cm}
$$\psset{algebraic=true, unit=.5pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none, linewidth=1.5pt]{->}(0,0)(-10,-10)(10,10)
\psplot[linewidth=2pt, linecolor=red]{-1}{6}{abs(x^2-5*x+3)}$$
\vspace{2cm}\footnotesize\hangcaption{$y = |x^2-5x + 3|$}
\label{fig:parabola4|f|}
\end{minipage}
\hfill
\begin{minipage}{5cm}
$$\psset{algebraic=true, unit=.5pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none, linewidth=1.5pt]{->}(0,0)(-10,-10)(10,10)
\psplot[linewidth=2pt, linecolor=red]{-6}{6}{x^2-5*abs(x)+3}$$
\vspace{2cm}\footnotesize\hangcaption{$y = |x|^2-5|x| + 3$}
\label{fig:parabola4f(|.|)}
\end{minipage}
\end{figure}


\begin{cor}\label{cor:sign_of_a_quadratic}
If $a\neq 0, b, c$ are real numbers and if $b^2-4ac<0$, then $ax^2 +
bx + c$ has the same sign as $a$.
\end{cor}
\begin{pf}
Since
$$ax^2 + bx + c  =  a\left(\left(x + \dfrac{b}{2a}\right)^2 +
\dfrac{4ac - b^2}{4a^2}\right),  $$and $4ac-b^2>0$, $\left(\left(x +
\dfrac{b}{2a}\right)^2 + \dfrac{4ac - b^2}{4a^2}\right)>0$ and so
$ax^2+bx+c$ has the same sign as $a$.
\end{pf}

\begin{exa}
Prove that the quantity $q(x) = 2x^2+x+1$ is positive regardless of
the value of $x$.
\end{exa}Solution: The discriminant is $1^2 - 4(2)(1) = -7 < 0$,
hence the roots are complex. By Corollary
\ref{cor:sign_of_a_quadratic}, since its leading coefficient is
$2>0$, $q(x)> 0$ regardless of the value of $x$. Another way of
seeing this is to complete squares and notice the inequality
$$ 2x^2+x+1 = 2\left(x + \dfrac{1}{4}\right)^2 + \dfrac{7}{8} \geq \dfrac{7}{8},  $$
since $\left(x + \dfrac{1}{4}\right)^2$ being the square of a real
number, is $\geq 0$.

\bigskip

By Corollary \ref{cor:quadratic_formula}, if $a\neq 0, b, c$ are
real numbers and if $b^2-4ac\neq 0$ then
 the numbers $$r_1 = \dfrac{-b-\sqrt{b^2 -4ac}}{2a}\qquad \mathrm{and}\qquad r_2 = \dfrac{-b+\sqrt{b^2
-4ac}}{2a}$$ are distinct solutions of the equation $ax^2+bx+c=0$.
Since
$$ r_1+r_2 = -\dfrac{b}{a},\qquad \mathrm{and}\qquad r_1r_2 =
\dfrac{c}{a},
$$any quadratic can be written in the form $$ ax^2+bx+c =a\left(x^2+\dfrac{bx}{a} + \dfrac{c}{a}\right)
= a\left(x^2 - (r_1+r_2)x + r_1r_2\right) = a(x-r_1)(x-r_2).  $$ We
call $a(x-r_1)(x-r_2)$ a {\em factorisation} of the quadratic
$ax^2+bx+c$.\index{factorisation!of a quadratic}\index{quadratic
equation!factorisation of a}
\begin{exa}
A quadratic polynomial $p$ has $1 \pm \sqrt{5}$ as roots and it
satisfies $p(1) = 2$. Find its equation.
\end{exa}Solution:
Observe that the sum of the roots is $$r_1+r_2 = 1-\sqrt{5} +
1+\sqrt{5} = 2$$ and the product of the roots is $$r_1r_2 =
(1-\sqrt{5})(1+\sqrt{5}) = 1-(\sqrt{5})^2 = 1-5=-4.\footnote{As a
shortcut for this multiplication you may wish to recall the {\em
difference of squares identity}: $(a-b)(a+b) = a^2-b^2$.}$$ Hence
$p$ has the form
$$p(x) = a\left(x^2-(r_1+r_2)x+r_1r_2\right) = a(x^2-2x-4).
$$Since $$2= p(1)\implies 2 = a(1^2-2(1)-4) \implies a = -\dfrac{2}{5},$$
the polynomial sought is $$ p(x) =
-\dfrac{2}{5}\left(x^2-2x-4\right).
$$



\section{Product Rule and Chain Rule}
We now develop tools for differentiating more complex formul\ae.
\begin{thm}[Product Rule]If $f, g$ are are strongly differentiable   functions at $x$,
then $fg$ is strongly differentiable  at $x$ and then $(fg)'(x) =
f'(x)g(x) + f(x)g'(x)$.\label{thm:product_rule}

\end{thm}
\begin{pf}We have
$$\begin{array}{lll}f(x+\epsilon)g(x+\epsilon)& = &  \left(f(x)+f'(x)\epsilon + O(\epsilon^2)\right)
\left(g(x)+g'(x)\epsilon + O(\epsilon^2)\right) \\
& = & f(x)g(x)+\left(f'(x)g(x)+f(x)g'(x)\right)\epsilon
+O(\epsilon^2), \end{array}$$from where the theorem follows.
\end{pf}
\begin{rem}
It is {\bf not true} in general that $(fg)' = f'g'$.
\end{rem}
\begin{exa}
Let $f(x) = x^3$ and $g(x) = x^4$. Then from the Product Rule
$$ (x^7)' = (x^3\cdot x^4)' = x^4(x^3)' + x^3(x^4)' = x^4(3x^2) + x^4(4x^2) = 3x^6 + 4x^6 = 7x^6,  $$
which is what we expect from the Power Rule.
\end{exa}
By recurrence we can apply the product rule to more than two
functions.
\begin{exa}
$$\begin{array}{lll}(x(x+x^2)(1+x+x^2))' & = & (x)'(x+x^2)(1+x+x^2) + x(x+x^2)'(1+x+x^2) +
x(x+x^2)(1+x+x^2)'\\
& = & 1(x+x^2)(1+x+x^2)+ x(1+2x)(1+x+x^2) + x(x+x^2)(1+
2x)\\
& = & (x+2x^2+2x^3+x^4) +  (x+3x^2+3x^3+2x^4) + (x^2+3x^3+2x^4) \\
& = & 2x + 6x^2+8x^3 +5x^4.
\end{array}$$
\end{exa}


\begin{thm}[Chain Rule] If $g$ is strongly differentiable  at $x$ and  $f$ is  strongly differentiable  at $g(x)$,
then $f\circ g$ is strongly differentiable  at $x$ and $(f\circ
g)'(x)=f'\left(g(x)\right)g'(x)$ \label{thm:chain_rule}
\end{thm}
\begin{pf}We have, putting $\epsilon_1 = g'(x)\epsilon +
O(\epsilon^2)$,

$$\begin{array}{lll}f\left(g(x+\epsilon)\right)
& = & f(g(x)+g'(x)\epsilon + O(\epsilon^2))
\\ & = &
f(g(x) + \epsilon_1)\\
& = & f(g(x)) + f'(g(x))\epsilon_1 + O(\epsilon_1 ^2) \\
& = & f(g(x)) + f'(g(x))(g'(x)\epsilon + O(\epsilon^2)) + O((g'(x)\epsilon + O(\epsilon^2)) ^2) \\
 & = & f\left(g(x)\right)+f'\left(g(x)\right)g'(x)\epsilon
+O(\epsilon^2)\end{array}$$ and the theorem follows.
\end{pf}

\begin{exa}Consider $h(x) = (x+1)^2$. Then $h(x) = (f\circ g)(x)$ with
$f(x)=x^2$ and $g(x)=x+1$. Hence
$$((x+1)^2)' = (f\circ g)'(x) = f'(g(x))g'(x) =  2(x+1)^1(1) = 2x+2. $$
\end{exa}
\begin{exa}
$$((x^2 + x)^3)' = 3(x^2+x)^2(2x+1). $$
\end{exa}

\begin{exa}Using the Product Rule and the Chain Rule,
$$ (x(x+a)^2)' = (x+a)^2(x)' + x((x+a)^2)' = (x+a)^2 + 2x(x+a) = (x+a)(3x+a).  $$
\end{exa}
\begin{exa}Using the Product Rule and the Chain Rule,
$$ \begin{array}{lll}
(x(x+a)^2(x+b)^3)' & = & (x+a)^2(x+b)^3(x)' +
x(x+b)^3((x+a)^2)'+ x(x+a)^2((x+b)^3)' \\
& = & (x+a)^2(x+b)^3 + 2x(x+a)(x+b)^3 + 3x(x+a)^2(x+b)^2\\
& = & (x+a)(x+b)^2((x+a)(x+b) + 2x(x+b)+ 3x(x+a)) \\
& = & (x+a)(x+b)^2(6x^2+x(4a+3b)+ab).
\end{array}
$$
\end{exa}
\begin{exa}Let $f$ be strongly differentiable  with $f(4) = a$ and  $f'(4) =
b$. If $g(x) = x^2f(x^2)$, find $g'(2)$.
\end{exa}Solution: Using both the Product Rule and the Chain Rule $$g'(x) = 2xf(x^2) + x^2f'(x^2)(2x) =
2xf(x^2) + 2x^3f'(x^2).$$ Hence $g'(2) = 2(2)f(4) + 2(8)f'(4) = 4a +
16b$.

\section{Polynomials}
\subsection{Roots}
In sections \ref{sec:affine_functions} and
\ref{sec:quadratic_functions} we learned how to find the roots of
equations (in the unknown $x$) of the type $ax+b = 0$ and $ax^2+bx+c
= 0$, respectively. We would like to see what can be done for
equations where the power of $x$ is higher than $2$. We recall that
\begin{df}
A {\em polynomial} $p(x)$ of degree $n\in\BBN$ is an expression of
the form
$$p(x) = a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0,  \qquad
a_n \neq 0,\qquad a_k\in \BBR,$$where the $a_k$ are constants. If
the $a_k$ are all integers then we say that $p$ has integer
coefficients, and we write $p(x)\in\BBZ[x]$; if the $a_k$ are real
numbers then we say that $p$ has real coefficients  and we write
$p(x)\in \BBR[x]$; etc. The degree of the polynomial $p$ is denoted
by $\deg p$. The coefficient $a_n$ is called the {\em leading
coefficient} of $p(x)$. \index{polynomial}\index{polynomial!leading
coefficient}\index{polynomial!degree of a} A {\em root}  of $p$ is a
solution to the equation $p(x) =
0$.\index{root!polynomial}\index{polynomial!root}\index{function!polynomial}
\end{df}
\begin{exa}Here are a few examples of polynomials.
\begin{itemize}
\item $a(x) = 2x+1 \in \BBZ[x]$, is a polynomial of degree $1$, and leading coefficient $2$. It has $x=-\dfrac{1}{2}$ as its only root.
A polynomial of degree $1$ is also known as an {\em affine
function}.
\item $b(x) = \pi x^2+x-\sqrt{3}\in\BBR[x]$,  is a polynomial of degree $2$ and leading coefficient
$\pi$. By the quadratic formula $b$ has the two roots $$ x=
\dfrac{-1+\sqrt{1+4\pi\sqrt{3}}}{2\pi}\qquad\mathrm{and}\qquad x=
\dfrac{-1-\sqrt{1+4\pi\sqrt{3}}}{2\pi}.
$$

A polynomial of degree $2$ is also called a {\em quadratic
polynomial} or {\em quadratic function}.
\item $C(x) = 1\equiv 1\cdot x^0$\footnote{The symbol $\equiv$ is read ``identically equal to'' and it means that both expressions
are always the same, regardless of the value of the input
parameter.}, is a constant polynomial, of degree $0$. It has no
roots, since it is never zero.
\end{itemize}
\end{exa}

\begin{thm}The degree of the product of two polynomials is the sum
of their degrees. In symbols, if $p, q$ are polynomials, $\deg pq =
\deg p + \deg q$. \label{thm:degree_of_product}
\end{thm}
\begin{pf}
If $p(x) = a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0,$ and
$q(x) = b_mx^m + b_{m - 1}x^{m - 1} + \cdots + b_1x + b_0$, with
$a_n\neq 0$ and $b_m\neq 0$ then upon multiplication,
$$ p(x)q(x) = (a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0)(b_mx^m + b_{m - 1}x^{m - 1} + \cdots + b_1x + b_0)
= a_nb_mx^{m+n} + \cdots +    ,$$ with non-vanishing leading
coefficient $a_nb_m$.
\end{pf}
\begin{exa}
The polynomial $p(x) = (1+2x+3x^3)^{4}(1-2x^2)^5$ has leading
coefficient $3^4(-2)^5 =-2592$ and degree $3\cdot 4 + 2\cdot 5 =
22$.
\end{exa}
\begin{exa}
What is the degree of the polynomial identically equal to $0$? Put
$p(x) \equiv 0$ and, say, $q(x) = x+1$. Then by Theorem
\ref{thm:degree_of_product} we must have    $\deg pq = \deg p + \deg
q = \deg p + 1$. But $pq$ is identically $0$, and hence $\deg pq =
\deg p$. But if $\deg p$ were finite then  $$\deg p = \deg pq = \deg
p + 1 \implies 0 = 1\footnote{Much to the chagrin of our
Vice-President for Academic Affairs---who claims that $1=2$---it is
not true that $0=1$.},
$$nonsense. Thus the $0$-polynomial does not have any finite degree. We attach to it, by convention, degree
$-\infty$.
\end{exa}
\begin{df}\label{df:splitting_ring} If
all the roots of a polynomial are in $\BBZ$ (integer roots), then we
say that the {\em polynomial splits  or factors over $\BBZ$}. If all
the roots of a polynomial are in $\BBQ$ (rational roots), then we
say that the {\em polynomial splits  or factors over $\BBQ$}. If all
the roots of a polynomial are in $\BBC$ (complex roots), then we say
that the {\em polynomial splits (factors) over $\BBC$}.
\index{polynomial!splitting}
\end{df}
\begin{rem}
Since $\BBZ \subset \BBQ \subset\BBR \subset \BBC$, any polynomial
splitting on a smaller set immediately splits over a larger set.
\end{rem}
\begin{exa}
The polynomial $l(x)= x^2-1 = (x-1)(x+1)$ splits over $\BBZ$. The
polynomial $p(x) = 4x^2-1=(2x-1)(2x+1)$ splits over $\BBQ$ but not
over $\BBZ$. The polynomial $q(x) = x^2-2=(x-\sqrt{2})(x+\sqrt{2})$
splits over $\BBR$ but not over $\BBQ$. The polynomial $r(x) = x^2 +
1 = (x-i)(x+i)$ splits over $\BBC$ but not over $\BBR$. Here $i =
\sqrt{-1}$ is the imaginary unit.
\end{exa}
\subsection{Taylor Polynomials}
In order to motivate the following theorem, let us consider the next
example.
\begin{exa} Write $x^2$ as a sum of powers of $x-1$.
\end{exa}
Solution: Observe that $x = x-1 + 1$ and use the identity
$(a+b)^2=a^2+2ab + b^2$ to obtain $$ x^2 = (x-1+1)^2 = (x-1)^2 +
2(x-1) + 1.
$$If such an identity is not known, one can proceed as follows,
giving an idea of a general procedure. Put
$$ x^2 = a + b(x-1) + c(x-1)^2, $$where we stop at the second power
since $x^2$ has degree $2$. Let $x=1$. Then $1 = a$. Differentiate
to obtain
$$2x = b + 2c(x-1).  $$Let again $x=1$. This gives $2=b$.
Differentiate a second time to obtain
$$ 2 = 2c, $$whence $c=1$. Hence we have $a = 1, b= 2, c= 1$ and so
$$ x^2 = a+b(x-1)+c(x-1)^2 = 1 + 2(x-1) + (x-1)^2,  $$as before.
\begin{thm}[Taylor
Polynomials]\label{thm:taylor_polynomials}
\index{polynomial!Taylor}Let $a\in \BBR$. Then any polynomial $p(x)$
of degree $n$ can be written as
$$ p(x) = b_0 + b_1(x-a) + b_2(x-a)^2 + \cdots + b_n(x-a)^n , $$for
some constants $b_k$.
\end{thm}
\begin{pf}First observe that we stop at $(x-a)^n$ since $p$ has
degree $n$. Differentiating $k$ times we obtain $$ p^{(k)}(x) =
b_kk!\qquad +\qquad  (k+1)(k)\cdots (2)b_{k+1}(x-a)\qquad +\qquad
\cdots \qquad + \qquad (n)(n-1)\cdots
(n-k+1)b_n(x-a)^{n-k}.\footnote{The symbol $k!$---read ``$k$
factorial''---is the product $1\cdot 2 \cdots k$. Thus for example
$5! = 1\cdot 2 \cdot 3 \cdot 4 \cdot 5 = 120$. We define $0! = 1$.}
$$Letting $x=a$ we obtain   $$ b_k = \dfrac{p^{(k)}(a)}{k!},$$ proving
the theorem.
\end{pf}
\begin{df}
The expansion
\begin{equation}\label{eq:taylor_polynomial}
p(x) = p(a) + p'(a)(x-a) + \dfrac{p''(a)}{2!}(x-a)^2 + \cdots
+\dfrac{p^{(n)}(a)}{n!}(x-a)^n
\end{equation}is known as the {\em Taylor polynomial expansion} about $x=a$ of
$p$.
\end{df}
\begin{exa}
Find the Taylor polynomial expansion about $x=-2$ of $p(x) = x^3 +
2x + 1$.
\end{exa}Solution: We have
$$p'(x) = 3x^2+2, \qquad p''(x) = 6x, \qquad p'''(x) = 6.   $$
Hence $$p(-2) = -11,\qquad p'(-2) = 14, \qquad p''(-2) = -12, \qquad
p'''(-2) = 6,
$$ and
$$ x^3 +
2x + 1 = -11 + 14(x+2) + \dfrac{-12}{2}(x+2)^2 + \dfrac{6}{6}(x+2)^3
= -11 + 14(x+2) - 6(x+2)^2 + (x+2)^3.
$$

\subsection{Ruffini's Factor Theorem}
\begin{thm}[Ruffini's Factor Theorem] The polynomial $p(x)$ is divisible by $x - a$ if
and only if $p(a) = 0.$ Thus if $p$ is a polynomial of degree $n$,
then $p(a) = 0$ if and only if $p(x) = (x-a)q(x)$ for some
polynomial $q$ of degree $n-1$.
\label{thm:ruffini}\index{Theorem!Ruffini}\end{thm}
\begin{pf}The Taylor expansion of $p$ about $x=a$ is
$$p(x) = p(a) + (x-a)\left(p'(a) + \dfrac{p''(a)}{2!}(x-a) + \cdots
+\dfrac{p^{(n)}(a)}{n!}(x-a)^{n-1}\right),   $$ from where the
result quickly follows.
 \end{pf}
\begin{exa}
Find the value of $a$ so that the polynomial $$t(x) = x^3 - 3ax^2 +
2$$ be divisible by $x + 1$.
\end{exa}
Solution: By Ruffini's Theorem \ref{thm:ruffini}, we must have
$$0 = t(-1) = (-1)^3 - 3a(-1)^2 + 2 \implies  a = \frac{1}{3}.$$
\begin{df}
Let $a$ be a root of a polynomial $p$. We say that $a$ is a root of
{\em multiplicity} $m$ if $p(x)$ is divisible by  $(x-a)^m$ but not
by  $(x-a)^{m+1}$. This means that $p$ can be written in the form
$p(x) = (x-a)^mq(x)$ for some polynomial $q$ with $q(a)\neq 0$.
\end{df}
\begin{cor}
The number $a$ is a root of multiplicity $m$ if an only if $$p(a) =
p'(a) = p''(a) = \cdots = p^{(m-1)}(a) = 0, \qquad p^{(m)}(a) \neq
0.$$
\end{cor}
\begin{pf}
This follows immediately by considering the Taylor expansion of $p$
about $x=a$.
\end{pf}
\begin{exa}
Factor the polynomial $p(x) = x^5-5x^4+11x^3-13x^2+8x-2$ over
$\BBZ[x]$.
\end{exa}Solution: We see that $p(1) = 0, p'(1) = 0, p''(1) = 0, p'''(1) \neq
0$. Hence $(x-1)^3 = x^3-3x^2+3x-1$ divides $p$. By long division
$$ \polylongdiv{x^5-5x^4+11x^3-13x^2+8x-2}{x^3-3x^2+3x-1}  $$and so
$$x^5-5x^4+11x^3-13x^2+8x-2 = (x-1)^3(x^2-2x+2). $$Observe that
$x^2-2x+2$ does not factor over $\BBZ[x]$ and hence we are finished.

\begin{cor}\label{cor:ruffini2}If a polynomial of degree $n$ had any roots at all, then it has at
most $n$ roots.
\end{cor}
\begin{pf}
If it had at least $n+1$ roots then it would have at least $n+1$
factors of degree $1$ and hence degree $n+1$ at least, a
contradiction.
\end{pf}
Notice that the above theorem only says that if a polynomial has any
roots, then it must have at most its degree number of roots. It does
not say that a polynomial must possess a root. That all polynomials
have at least one root is much more difficult to prove. We will
quote the theorem, without a proof.
\begin{thm}[Fundamental Theorem of Algebra]\index{Theorem!Fundamental of Algebra}
A polynomial of degree at least one with complex number coefficients
has at least one complex root.
\end{thm}
\begin{rem}
The Fundamental Theorem of Algebra implies then that a polynomial of
degree $n$ has {\em exactly} $n$ roots (counting multiplicity).
\end{rem}

A more useful form of Ruffini's Theorem is given in the following
corollary.
\begin{cor}
If the polynomial  $p$ with integer coefficients,
$$p(x) = a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0.$$  has a
rational root $\frac{s}{t}\in\BBQ$ (here $\frac{s}{t}$ is assumed to
be in lowest terms), then $s$ divides $a_0$ and $t$ divides $a_n$.
\label{cor:ruffini}\end{cor}
\begin{pf}
We are given that
$$0 = p\left(\frac{s}{t}\right) = a_n\left(\frac{s^n}{t^n}\right) + a_{n - 1}\left(\frac{s^{n - 1}}{t^{n - 1}}\right)
 + \cdots + a_1\left(\frac{s}{t}\right) + a_0.$$Clearing denominators,
 $$0 = a_ns^n + a_{n - 1}s^{n - 1}t + \cdots + a_1st^{n - 1} + a_0t^n.$$
This last equality implies that
$$-a_0t^n = s(a_ns^{n - 1} + a_{n - 1}s^{n - 2}t + \cdots + a_1t^{n - 1}).$$Since both sides are integers, and since
$s$ and $t$ have no factors in common, then $s$ must divide $a_0.$
We also gather that
$$-a_ns^n = t(a_{n - 1}s^{n - 1} + \cdots + a_1st^{n - 2} + a_0t^{n - 1}),$$from where we deduce that $t$ divides $a_n$, concluding the
proof.
\end{pf}
\begin{exa}
Factorise $a(x) = x^3 - 3x - 5x^2 + 15$ over $\BBZ[x]$ and over
$\BBR[x]$.
\end{exa}
Solution: By Corollary \ref{cor:ruffini}, if $a(x)$ has integer
roots then they must be in the set $\{-1, 1, -3, 3, -5, 5\}$. We
test $a(\pm 1), a(\pm 3), a(\pm 5)$ to see which ones vanish. We
find that $a(5) = 0$. By the Factor Theorem, $x - 5$ divides $a(x).$
Using long division,
$$\polylongdiv{x^3-3x-5x^2+15}{x-5}  $$we find

$$a(x) =  x^3 - 3x - 5x^2 + 15 = (x - 5)(x^2 - 3),$$which is the required factorisation over
$\BBZ[x]$. The factorisation over $\BBR[x]$ is then
$$a(x) =  x^3 - 3x - 5x^2 + 15 = (x - 5)(x - \sqrt{3})(x + \sqrt{3}).$$
\begin{exa}
Factorise $b(x) = x^5 - x^4 - 4x  + 4$ over $\BBZ[x]$ and  over
$\BBR[x]$.
\end{exa}
Solution: By Corollary \ref{cor:ruffini}, if $b(x)$ has integer
roots then they must be in the set $\{-1, 1, -2, 2, -4, 4\}$. We
quickly see that $b(1) = 0$, and so, by the Factor Theorem, $x - 1 $
divides $b(x)$. By long division
$$\polylongdiv{x^5 - x^4 - 4x  + 4}{x-1}  $$
 we see that
$$b(x) = (x - 1)(x^4 - 4) = (x - 1)(x^2 - 2)(x^2 + 2),$$which is the desired factorisation over
$\BBZ[x]$. The factorisation over $\BBR$ is seen to be
$$b(x) = (x - 1)(x - \sqrt{2})(x + \sqrt{2})(x^2 + 2).$$Since the discriminant of $x^2+2$ is $-8<0$, $x^2+2$ does
not split over $\BBR$.
\begin{lem}Complex roots of a polynomial with real coefficients
occur in conjugate pairs, that is, if $p$ is a polynomial with real
coefficients and if $u+vi$ is a root of $p$, then its conjugate
$u-vi$ is also a root for $p$. Here $i=\sqrt{-1}$
 is the imaginary unit. \end{lem}
 \begin{pf}
Assume $$p(x) =a_0 + a_1x+ \cdots + a_nx^n $$ and that $p(u+vi) =
0$. Since the conjugate of a real number is itself, and conjugation
is multiplicative (Theorem \ref{thm:multiplicative_conjugation}), we
have
$$\begin{array}{lll} 0 & = & \overline{0}\\
 & = & \overline{p(u+vi)} \\
& = &\overline{a_0 + a_1(u+vi)+ \cdots + a_n(u+vi)^n} \\
& = &\overline{a_0} +\overline{ a_1(u+vi)}+ \cdots + \overline{a_n(u+vi)^n} \\
& = & a_0 + a_1(u-vi) + \cdots + a_n(u-vi)^n\\
& = & p(u-vi),\\
   \end{array}$$
whence $u-vi$ is also a root.
 \end{pf}
 Since the complex pair root $u\pm vi$ would give the polynomial
 with real coefficients
$$ (x-u-vi)(x-u+vi) = x^2 - 2ux + (u^2+v^2),  $$
we deduce the following theorem.
 \begin{thm}
Any polynomial with real coefficients can be factored in the form
$$ A(x-r_1)^{m_1}(x-r_2)^{m_2}\cdots (x-r_k)^{m_k}(x^2+a_1x+b_1)^{n_1}(x^2+a_2x+b_2)^{n_2} \cdots (x^2+a_lx+b_l)^{n_l},  $$
where each factor is distinct, the $m_i, l_k$ are positive integers
and $A, r_i, a_i, b_i$
 are real numbers.\end{thm}

\section{Graphs of Polynomials} We
start with the following theorem, which we will state without proof.
\begin{thm}
A polynomial function $x\mapsto p(x)$ is an everywhere continuous
function.
\end{thm}
\begin{thm}\label{thm:behaviour_polynomials_at_infty}
Let $p(x) = a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0  \ \ \
a_n \neq 0$, be a polynomial with real number coefficients. Then
$$p(-\infty) = (\sgn{a_n})(-1)^n\infty,\qquad p(+\infty) =
(\sgn{a_n})\infty.$$ Thus a polynomial of odd degree will have
opposite signs for values of large magnitude and different sign, and
a polynomial of even degree will have the same sign for values of
large magnitude and different sign.
\end{thm}
\begin{pf}
If $x\neq 0$ then
$$p(x) = a_nx^n + a_{n - 1}x^{n - 1} + \cdots + a_1x + a_0 = a_nx^n\left(1 + \dfrac{a_{n - 1}}{x} + \cdots +
\dfrac{a_1}{x^{n-1}} + \dfrac{a_0}{x^n}\right) \sim a_nx^n,$$since
as $\tends{x}{\pm \infty}$, the quantity in parenthesis tends to $1$
and so the eventual sign of $p(x)$ is  determined by $a_nx^n$, which
gives the result.
\end{pf}
\begin{cor}
A polynomial of odd degree with real number coefficients always has
a real root.
\end{cor}
\begin{pf}
Since a polynomial of odd degree eventually changes sign, since it
is continuous, the corollary follows from Bolzano's Intermediate
Value Theorem \ref{thm:bolzano}.
\end{pf}


\begin{exa}\label{exa:polynom1}
Consider the polynomial $p(x) =x^3+4x^2+x-6$.
\begin{enumerate}
\item Prove that $p$ splits over $\BBZ$ and find its factorisation.
Also, determine its $y$-intercept.
\item Determine $p(-\infty)$ and $p(+\infty)$
\item Find $p'$ and determine the intervals of monotonicity of $p$.
\item Determine any local extrema of $p$.
\item Find $p''$ and determine the inflexion points of $p$ and its
convexity intervals.
\item Obtain an approximate graph of $p$.
\end{enumerate}
\end{exa}
Solution:
\begin{enumerate}
\item By Corollary \ref{cor:ruffini}, if there are integral roots of
$p$ they must divide $-6$. A quick inspection shews that $p(1)=0$
and so $x-1$ divides $p(x)$. By long division
$$\polylongdiv{x^3+4x^2+x-6}{x-1}  $$
whence $$p(x) = (x-1)(x^2+5x+6) = (x-1)(x+2)(x+3). $$This means that
$p$ crosses the $x$-axis at $x=-3$, $x=-2$, and $x=1$. Its
$y$-intercept is $(0,p(0)) = (0,-6)$.
\item Since the leading coefficient of $p$ is $1>0$ and since $p$
has odd degree, by Theorem \ref{thm:behaviour_polynomials_at_infty},
$p(x) \sim (x)(x)(x) = x^3$, as $\tends{x}{+\infty}$ and so
$p(-\infty) = -\infty$ and $p(+\infty) = +\infty$.
\item $p'(x) =3x^2+8x+1$, whose graph is a convex parabola. Using
the Quadratic Formula
$$ 3x^2+8x+1 = 0 \iff x = \dfrac{-4-\sqrt{13}}{3}\qquad  \mathrm{or}\qquad x = \dfrac{-4+\sqrt{13}}{3}  $$
and so $x\approx -2.54$ or $x\approx -0.13$. Since $p'$ is a convex
parabola this means that $$p'(x) > 0 \iff
x\in\loro{-\infty}{\dfrac{-4-\sqrt{13}}{3}}\cup
\loro{\dfrac{-4+\sqrt{13}}{3}}{+\infty},$$ and so $p$ is increasing
(approximately) in the intervals $\loro{-\infty}{-2.54}$ and
$\loro{-0.13}{+\infty}$.


\item Since at $x=-2.54$ $p'$ changes sign from $+$ to $-$, $p$ has
a local maximum there by virtue of Theorem \ref{thm:local_extrema},
which is $p(-2.54) \approx 0.88$. Also, $p'$ changes sign from $-$
to $+$ at $x=-0.13$  and so $p$ has a local minimum there, which is
$p(-0.13) \approx -6.06$.
\item We find $p''(x) = 6x+8$. Now, $p''(x) =0 \implies x = -\dfrac{4}{3} \approx
-1.33$ and $p(-1.33) \approx -2.61$. Hence $p$ changes convexity
(approximately) at $(-1.33,-2.61)$.
\item The graph of $p$ can be found in figure
\ref{fig:polynom1}. \end{enumerate}
\begin{exa}\label{exa:polynom2} Consider the polynomial
$p(x) =x^3+x+1$.
\begin{enumerate}
\item Prove that $p$ is strictly increasing.
\item Prove that $p$ has no positive roots.
\item Determine $p(-\infty)$ and $p(+\infty)$
\item Prove that $p$ has a unique real root and find an interval
$[a;b]$ of length $<\dfrac{1}{4}$ containing this root.
\item Find $p''$ and determine the inflexion points of $p$ and its
convexity intervals.
\item Obtain an approximate graph of $p$.
\end{enumerate}
\end{exa}
Solution:
\begin{enumerate}
\item We have $p'(x) = 3x^2+1\geq 1>0$ since $x^2$ is always
positive.\footnote{Another way of seeing that $3x^2+1>0$ always is
by checking its discriminant.} Since the derivative of $p$ is always
strictly positive, $p$ is always strictly increasing.
\item Since  $p$ is strictly increasing, $p(x) > p(0)=1$ for $x>0$.
Hence values $x>0$ can never make $p$ zero.
\item By Theorem \ref{thm:behaviour_polynomials_at_infty}, $p(-\infty) =
-\infty$ and $p(+\infty) = +\infty$.
\item Since $p$ changes sign, it must have a root. Since $p$ is
strictly increasing, it can cross the $x$-axis only once. Now,
observe that $$p(0) = 1, \qquad p(-1) = -1$$ so the root must lie in
$[-1;0]$. We bisect this interval and find   $p(-0.5) \approx
0.375$, so the root must lie in $[-1;-0.5]$. We again bisect this
interval and find that  $p(-0.75) \approx-0.171875$, so the root
must lie in $[-0.75;-0.5]$. Again, we bisect this interval and find
that $p(-0.625)\approx 0.13$, so the root must lie in
$[-0.75;-0.625]$. We now stop since we have reached an interval of
within the desired length.
\item $p''(x) = 6x$ and so $p$ is convex for $x>0$ and concave for
$x<0$.
\item An approximate graph is shewn in figure \ref{fig:polynom2}
\end{enumerate}
\vspace{2cm}
\begin{figure}[h]
\centering
\begin{minipage}{7cm}
$$\psset{unit=.8pc,algebraic=true} \psgrid[subgriddiv=3,
gridlabels=0,
gridwidth=1pt](-7,-7)(-7,-7)(7,7)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-3.7}{1.34}{(x-1)*(x+2)*(x+3)}
\psaxes[xyLabel={\tiny}, Ox=-7,Oy=-7](-7,-7)(-7,-7)(7,7)
 $$\vspace{2cm}\footnotesize\hangcaption{Example
 \ref{exa:polynom1}.}\label{fig:polynom1}
\end{minipage}
\begin{minipage}{7cm}
$$\psset{unit=.8pc,algebraic=true} \psgrid[subgriddiv=3,
gridlabels=0,
gridwidth=1pt](-7,-7)(-7,-7)(7,7)\psplot[linecolor=red,linewidth=2pt,algebraic=true,
plotpoints=1000]{-1.63}{1.34}{x^3+x+1} \psaxes[xyLabel={\tiny},
Ox=-7,Oy=-7](-7,-7)(-7,-7)(7,7)
 $$\vspace{2cm}\footnotesize\hangcaption{Example
 \ref{exa:polynom2}.}\label{fig:polynom2}

\end{minipage}


\end{figure}
We now consider polynomials with real number coefficients and that
split in $\BBR$. Such polynomials have the form
$$p(x) = a(x-r_1)^{m_1}(x-r_2)^{m_2} \cdots (x-r_k)^{m_k},
$$where $a\neq 0$ and the $r_i$ are real numbers and the $m_i \geq
1$ are integers. Graphing such polynomials will be achieved by
referring to the following theorem.
\begin{thm}\label{thm:graph_splitting_polynomials}
Let  $a\neq 0$ and the $r_i$ are real numbers and the $m_i$ be
positive integers. Then the graph of the polynomial
 $$p(x) = a(x-r_1)^{m_1}(x-r_2)^{m_2} \cdots (x-r_k)^{m_k},
$$
\begin{itemize}
\item crosses the $x$-axis at $x=r_i$ if $m_i$ is odd.
\item is tangent to the $x$-axis at $x=r_i$ if $m_i$
is even.
\item has a convexity change at $x=r_i$ if $m_i\geq 3$ and $m_i$ is odd.
\end{itemize}
\end{thm}
\begin{pf}
Since the local behaviour of $p(x)$ is that of $c(x-r_i)^{m_i}$
(where $c$ is a real number constant) near $r_i$, the theorem
follows at once from Theorem \ref{thm:power_functions}.
\end{pf}
\begin{exa}
Make a rough sketch of the graph of $y = (x+2)x(x-1)$. Determine
where it achieves its local extrema and their values. Determine
where it changes convexity.
\end{exa}Solution: We have  $p(x) = (x+2)x(x-1)\sim (x)\cdot x(x) = x^3$, as $\tends{x}{+\infty}$. Hence  $p(-\infty) = (-\infty)^3 = -\infty$
and $p(+\infty) = (+\infty)^3 = +\infty$. This  means that for large
negative values of $x$ the graph will be on the negative side of the
$y$-axis and that for  large positive values of $x$ the graph will
be on the positive side of the $y$-axis. By Theorem
\ref{thm:graph_splitting_polynomials}, the graph crosses the
$x$-axis at $x=-2$, $x=0$, and $x=1$.
\bigskip

Now, by the Product Rule,
$$\begin{array}{lll} p'(x) & = &  x(x-1) + (x+2)(x-1) + (x+2)x \\
& = & 3x^2+2x-2. \end{array}$$Using the quadratic formula,
$$3x^2+2x-2=0\implies x=-\dfrac{1}{3}-\dfrac{\sqrt{7}}{3} \approx -1.22; \ \ \ x = -\dfrac{1}{3}+\dfrac{\sqrt{7}}{3}
\approx 0.55.$$From geometrical considerations, $x \approx -1.22$
will be the $x$-coordinate of a local maximum,  with $y$-coordinate
$p(-1.22)\approx 2.11$ and $x \approx 0.55$ will be the
$x$-coordinate of a local minimum,  with $y$-coordinate
$p(0.55)\approx -0.63$.

\bigskip

Also $$p''(x) = 6x + 2,$$so $p''(x) > 0$ for $x > -\dfrac{1}{3}$ and
$p''(x) < 0$ for $x< -\dfrac{1}{3}$. This means that $p$ is convex
for $x>-\dfrac{1}{3}$ and concave for $x<-\dfrac{1}{3}$. The graph
is shewn in figure \ref{y=(x+2)x(x-1)}.

\begin{exa}
Make a rough sketch of the graph of $y=(x+2)^3x^2(1-2x)$.
\end{exa}Solution: We have  $(x+2)^3x^2(1-2x) \sim x^3\cdot x^2 (-2x) = -2x^6$. Hence if $p(x) = (x+2)^3x^2(1-2x)$ then
$p(-\infty) = -2(-\infty)^6 = -\infty$ and $p(+\infty) =
-2(+\infty)^6 = -\infty$, which means that for both large positive
and negative values of $x$ the graph will be on the negative side of
the  $y$-axis. By Theorem \ref{thm:graph_splitting_polynomials}, in
a neighbourhood of $x=-2$, $p(x)\sim 20(x+2)^3$, so the graph
crosses the $x$-axis changing convexity at $x=-2$. In a
neighbourhood of $0$, $p(x)\sim 8x^2$ and the graph is tangent to
the $x$-axis at $x=0$. In a neighbourhood of $x=\dfrac{1}{2}$,
$p(x)\sim \dfrac{25}{16}(1-2x)$, and so the graph crosses the
$x$-axis at $x= \frac{1}{2}$.

\bigskip


Now, $$\begin{array}{lll}p'(x) & = &  3(x+2)^2x^2(1-2x) +
2(x+2)^3x(1-2x) -2(x+2)^3x^2 \\
& = & x(x+2)^2(3x(1-2x) + 2(x+2)(1-2x) -2(x+2)x) \\
& = & -x(x+2)^2(12x^2 + 7x - 4), \end{array}$$ and $p'(x) = 0$ when
$x = 0, -2,$ $-\dfrac{7}{24}+\dfrac{\sqrt{241}}{24} \approx 0.36$,
$-\dfrac{7}{24}-\dfrac{\sqrt{241}}{24}\approx -0.94$. From
geometrical considerations, $x = 0$ and $x=-2$ are local minima,
both with $y$-coordinate $y=0$, and both $x\approx 0.36$ (with
corresponding $y = p(0.36) \approx 0.48$) and  $x \approx -0.94 $
(with corresponding $y$-coordinate $y =p(-0.94) \approx 3.03$) are
local maxima. The graph is shewn in figure \ref{y=(x+2)^3x^2(1-2x)}.


\begin{exa}
Make a rough sketch of the graph of $y=(x+2)^2x(1-x)^2$.
\end{exa}Solution: The dominant term of $(x+2)^2x(1-x)^2$ is
$x^2\cdot x (-x)^2 = x^5$. Hence if $p(x) = (x+2)^2x(1-x)^2$ then
$p(-\infty) = (-\infty)^5 = -\infty$ and $p(+\infty) = (+\infty)^5 =
+\infty$, which means that for  large negative values of $x$ the
graph will be on the negative side of the $y$-axis and for large
positive  values of $x$ the graph will be on the positive side of
the $y$-axis. By Theorem \ref{thm:graph_splitting_polynomials}, the
graph crosses the $x$-axis changing convexity at $x=-2$, it is
tangent to the $x$-axis at $x=0$ and it crosses the $x$-axis at $x=
\frac{1}{2}$. The graph is shewn in figure \ref{y=(x+2)^2x(1-x)^2}.






\vspace{2cm}
\begin{figure}[h]
\begin{minipage}{4.5cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-5,-5)(5,5)
\psplot[linewidth=1.5pt, linecolor=red]{-2.5}{1.7}{(x+2)*x*(x-1)}
$$
\vspace{2cm}\tiny\hangcaption{$y = (x+2)x(x-1)$.}
\label{y=(x+2)x(x-1)}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-5,-5)(5,5)
\psplot[linewidth=1.5pt,
linecolor=red]{-2.5}{.75}{(x+2)^3*x^2*(1-2*x)}
$$
\vspace{2cm}\tiny\hangcaption{$y =(x+2)^3x^2(1-2x)$.}
\label{y=(x+2)^3x^2(1-2x)}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}
$$\psset{algebraic=true, unit=1pc} \psaxes[xyLabel={\tiny
\itshape}, labels=none]{->}(0,0)(-5,-5)(5,5)
\psplot[linewidth=1.5pt,
linecolor=red]{-2.45}{1.5}{(x+2)^2*x*(1-x)^2}
$$
\vspace{2cm}\tiny\hangcaption{$y = (x+2)^2x(1-x)^2$.}
\label{y=(x+2)^2x(1-x)^2}
\end{minipage}
\end{figure}

 \chapter{Rational
Functions and Algebraic Functions}\thispagestyle{empty}
\section{Inverse Power Functions}
We now proceed to investigate the behaviour of functions of the type
$x\mapsto \dfrac{1}{x^n}$, where $n>0$ is an integer.

\begin{thm}\label{thm:D(x^-1)=-x^-2}The strong derivative of the
reciprocal function $x\mapsto \dfrac{1}{x}$ is the function
$x\mapsto -\dfrac{1}{x^2}$.
\end{thm}\begin{pf}
Put $f(x) = \dfrac{1}{x}$ and $g(x) = x$. Observe that $g'(x) = 1$
and $f(x)g(x) =1$. Hence by the product rule
$$0 = \diff{1}{x} = f'(x)g(x) + f(x)g'(x) = xf'(x) +  \dfrac{1}{x},$$
and solving for $f'(x)$ we obtain $f'(x) = -\dfrac{1}{x^2}$.

\bigskip

An alternate proof from the definition proceeds as follows. Let
$f(x) = \dfrac{1}{x}$ and $x\neq 0$. First observe the algebraic
identity
$$ \dfrac{1}{1+t} = 1-t + \dfrac{t^2}{1+t}. $$ Hence, if $x\neq 0$
is fixed,
$$\dfrac{1}{x+\epsilon} = \dfrac{1}{x}\cdot\dfrac{1}{1 + \epsilon/x} = \dfrac{1}{x}\left(1- \dfrac{\epsilon}{x} +
\dfrac{\epsilon^2}{x^2}\cdot\dfrac{1}{(1+\epsilon/x)} \right). $$
Now, since  $\tends{\epsilon}{0}$ we will have, eventually,
$|\epsilon| < \dfrac{|x|}{2}$. Hence $\dfrac{2}{3}
<\dfrac{1}{(1+\epsilon/x)} < 2$. This means that
$$\dfrac{\epsilon^2}{x^2}\cdot\dfrac{1}{(1+\epsilon/x)} =
O(\epsilon^2),$$where the implied constant depends on (the fixed
value of) $x$, and so
$$ \dfrac{1}{x+\epsilon}= \dfrac{1}{x}\left(1- \dfrac{\epsilon}{x} + O(\epsilon^2)\right)
= \dfrac{1}{x}- \dfrac{\epsilon}{x^2} + O(\epsilon^2) ,$$from where
the assertion follows.
\end{pf}

\begin{thm}\label{thm:strong derivative _x^-n}
If $n>0$ is an integer and $x\neq 0$, $$
\left(\dfrac{1}{x^n}\right)' = \left(x^{-n}\right)' = -nx^{-n-1}. $$
\end{thm}
\begin{pf}
Let $f(x) = x^n$, $g(x) = \dfrac{1}{x}$, $h(x) = \dfrac{1}{x^n}$.
Then $h = f\circ g$. By the Chain Rule (Theorem
\ref{thm:chain_rule}) and Theorem  \ref{thm:D(x^-1)=-x^-2}, $$ h'(x)
= f'(g(x))g'(x) =
n\left(\dfrac{1}{x}\right)^{n-1}\left(-\dfrac{1}{x^2}\right) =
-\dfrac{n}{x^{n+1}} = -nx^{-n-1},
$$as it was to be demonstrated.
\end{pf}
\begin{rem}
Theorems \ref{thm:power_rule} and  \ref{thm:strong derivative _x^-n}
say that if $\alpha$ is an integer, then $(x^\alpha)' = \alpha
x^{\alpha -1}$.
\end{rem}
With the derivatives of reciprocal powers determined, we can now
address how to graph them.
\begin{thm}\label{thm:graph_inverse_powers}
Let $n>0$ be an integer. Then \begin{itemize}\item if $n$ is even,
$x\mapsto \dfrac{1}{x^n}$ is increasing for $x<0$, decreasing for
$x>0$ and convex for all $x\neq 0$.
\item if $n$ is odd,
$x\mapsto \dfrac{1}{x^n}$ is decreasing for all $x\neq 0$,  concave
for $x<0$, and convex for $x>0$.
\end{itemize}
Thus $x\mapsto \dfrac{1}{x^n}$ has a pole of order $n$ at $x = 0$
and a horizontal asymptote at $y=0$.
\end{thm}
\begin{pf}
Let $h(x) = \dfrac{1}{x^n}$. By Theorem \ref{thm:strong derivative
_x^-n}, $h'(x) = -\dfrac{n}{x^{n+1}}$ and $h''(x) =
\dfrac{n(n+1)}{x^{n+2}}$. If $n$ is odd, then $n+1$ is even and
$n+2$ is odd. Hence  $h'(x) > 0$ for $x\neq 0$, proving that $h$ is
increasing and $h''(x)$ has the same sign as $x$, proving that $h$
is concave for $x<0$ and convex for $x>0$. A similar argument is
used for when $n$ is even, completing the proof.
\end{pf}
\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=2pt,linecolor=red]{.166666667}{6}{1/x}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x}$}
\label{fig:reciprocal_function}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.4082482905}{1/x^2}
\psplot[linewidth=2pt,linecolor=red]{.4082482905}{6}{1/x^2}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x^2}$}
\label{fig:1/x^2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.5503212082}{1/x^3}
\psplot[linewidth=2pt,linecolor=red]{.5503212082}{6}{1/x^3}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x^3}$}
\label{fig:1/x^3}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.6389431042}{1/x^4}
\psplot[linewidth=2pt,linecolor=red]{.6389431042}{6}{1/x^4}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x^4}$}
\label{fig:1/x^4}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.6988271188}{1/x^5}
\psplot[linewidth=2pt,linecolor=red]{.6988271188}{6}{1/x^5}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x^5}$}
\label{fig:1/x^5}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-.7418363756}{1/x^6}
\psplot[linewidth=2pt,linecolor=red]{.7418363756}{6}{1/x^6}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x^6}$}
\label{fig:1/x^6}
\end{minipage}
\hfill
\end{figure}
\begin{exa}A few functions $x \mapsto \dfrac{1}{x^n}$ are shewn in figures
\ref{fig:reciprocal_function} through \ref{fig:1/x^6}. \bigskip
\end{exa}
\begin{figure}[h]
\begin{minipage}{3.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=1.4pt,linecolor=red]{-6}{-.166666667}{1/x}
\psplot[linewidth=1.4pt,linecolor=red]{.166666667}{6}{1/x}}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{x-1} -1$}
\label{fig:1/(x-1)-1}
\end{minipage}
\hfill
\begin{minipage}{3.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\rput(1,1){\psplot[linewidth=1.4pt,linecolor=red]{-6}{-.25}{1/abs(x)}}\rput(1,-1){
\psline[linestyle=dashed](0,1)(0,6)\psline[linestyle=dashed](-6,2)(6,2)
\psplot[linewidth=1.4pt,linecolor=red]{.166666667}{1}{1/x}}
\rput(1,1){\psplot[linewidth=1.4pt,linecolor=red]{1}{6}{-1/x}}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \left|\dfrac{1}{x-1} -1\right|$}
\label{fig:1/|x-1|-1}
\end{minipage}
\hfill
\begin{minipage}{3.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6) \rput(1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=1.4pt,linecolor=red]{-1}{-.166666667}{1/x}
\psplot[linewidth=1.4pt,linecolor=red]{.166666667}{6}{1/x}}
\rput(-1,-1){
\psline[linestyle=dashed](0,-6)(0,6)\psline[linestyle=dashed](-6,0)(6,0)
\psplot[linewidth=1.4pt,linecolor=red]{-6}{-.166666667}{-1/x}
\psplot[linewidth=1.4pt,linecolor=red]{.166666667}{1}{-1/x}}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{1}{|x|-1}-1$}
\label{fig:1/(|x|-1)-1}
\end{minipage}
\hfill
\end{figure}
\begin{exa} Figures \ref{fig:1/(x-1)-1} through
\ref{fig:1/(|x|-1)-1} shew a few transformations of $x \mapsto
\dfrac{1}{x}$.
\end{exa}


\section{The Quotient Rule}
\begin{thm}\label{thm:deriv_1/g}
If $g$ is strongly differentiable  at $x$ and $g(x) \neq 0$ then $$
\left(\dfrac{1}{g}\right)' (x) =  -\dfrac{g'(x)}{(g(x))^2}.
$$
\end{thm}
\begin{pf}
Let $a(x) = \dfrac{1}{x}$. Then $\dfrac{1}{g} = a\circ g$. By the
Chain Rule  (Theorem \ref{thm:chain_rule}) and Theorem
\ref{exa:D(x^-1)=-x^-2}, $$ \left(\dfrac{1}{g}\right)' (x) =
a'(g(x))g'(x) = -\dfrac{g'(x)}{(g(x))^2},
$$as we needed to shew.
\end{pf}
\begin{cor}[Quotient Rule]If $f, g$ are strongly differentiable  at $x$ and if $g(x) \neq 0$,
then
$$ \left(\dfrac{f}{g}\right)'(x) =  \dfrac{f'(x)g(x) -f(x)g'(x)}{(g(x))^2}. $$
\end{cor}
\begin{pf}Using the Product Rule (Theorem \ref{thm:product_rule}) and Theorem \ref{thm:deriv_1/g},
$$\begin{array}{lll}  \left(\dfrac{f}{g}\right)'(x) & = & \left(f\cdot
\dfrac{1}{g}\right)'(x) \\ & = & f'(x)\dfrac{1}{g(x)} +
f(x)\left(\dfrac{1}{g}\right)'(x)\\
& = &  f'(x)\dfrac{1}{g(x)} + f(x)\left(-\dfrac{g'(x)}{(g(x))^2}\right)\\
& = & \dfrac{f'(x)g(x) -f(x)g'(x)}{(g(x))^2}, \end{array}$$ as
desired.
\end{pf}
\begin{exa} Find $b'(x)$ if $b(x) =
\dfrac{1+x+x^2}{(x-x^2)^2}$\end{exa} Solution: Use the Quotient Rule
and the Chain Rule: $$
\begin{array}{lll}b'(x) &=& \dfrac{(1 + 2x)(x-x^2)^2 -
(1+x+x^2)(2(1-2x)(x-x^2))}{(x-x^2)^4}\\ & = & \dfrac{(1 + 2x)(x-x^2)
- (1+x+x^2)(2(1-2x))}{(x-x^2)^3}\\ & = &
-\dfrac{-2+3x+3x^2+2x^3}{(x-x^2)^3}. \end{array}
$$






\section{Rational Functions}

\begin{df}
By a {\em rational function} $x\mapsto r(x)$ we mean a function $r$
whose assignment rule is of the $r(x) = \dfrac{p(x)}{q(x)}$, where
$p(x)$ and $q(x) \neq 0$ are polynomials. \index{function!rational}
\end{df}
We now provide a few examples of graphing rational functions.
\begin{exa}Draw the curve
$x \mapsto \dfrac{x^2}{x^2 + 1}.$
\end{exa}Solution: Put $a(x) = \dfrac{x}{x^2 + 1}$. Observe that $a(-x) = -a(x)$, which means that $a$ is an odd function
and hence symmetric about the origin.  Also
$$a'(x) = \dfrac{(x^2+1) -x(2x)}{(x^2+1)^2} = \dfrac{1-x^2}{(x^2+1)^2} = \dfrac{(1-x)(1+x)}{(x^2+1)^2} .$$
Since $(x^2 + 1)^2$ is always positive, $a'$ changes sign when
$1-x^2 = (1-x)(1+x)$ changes sign. Hence $a'(x) \geq 0$ if $x\in
[-1;1]$ and $a'(x)< 0$ otherwise. This means that $a$ is increasing
for $x\in [-1;1]$ and decreasing otherwise. Moreover
$$a''(x) = \diff{\dfrac{1-x^2}{(x^2+1)^2}}{x} = \dfrac{-2x(x^2+1)^2 -2(2x)(1-x^2)(x^2+1)}{(x^2+1)^4} =
 \dfrac{2x(x^2-3)}{(x^2+1)^3} .$$Again $a''$ will change sign when
 $2x(x^2-3) = x(x-\sqrt{3})(x+\sqrt{3})$ changes sign. By means of a sign diagram
 we see that $a''(x) \geq 0$ for $x\in [-\sqrt{3};0] \cup
 [\sqrt{3};+\infty[$, and so $a$ is convex for $x\in [-\sqrt{3};0] \cup
 [\sqrt{3};+\infty[$ and concave otherwise. The graph is shewn in
 figure \ref{fig:x/(x^2+1)}.

\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{6}{x/(x^2+1)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{x}{x^2+1}$}
\label{fig:x/(x^2+1)}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{6}{x^2/(x^2+1)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto \dfrac{x^2}{x^2+1}$}
\label{fig:x^2/(x^2+1)}
\end{minipage}
\hfill
\begin{minipage}{4.5cm}$$\psset{unit=.7pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-2.414213562}{-.4142135624}{x^2+1/x^2}
\psplot[linewidth=2pt,linecolor=red]{.4142135624}{2.414213562}{x^2+1/x^2}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^2+\dfrac{1}{x^2}$}
\label{fig:x^2+1/x^2}
\end{minipage}
\end{figure}

\begin{exa}Draw the curve
$x \mapsto \dfrac{x^2}{x^2 + 1}.$
\end{exa}Solution: Put $b(x) = \dfrac{x^2}{x^2 + 1}$. Observe that $b(-x) = b(x)$, which means that $b$ is an even function
and hence symmetric about the $y$-axis.  Also
$$b'(x) = \dfrac{(2x)(x^2+1) -2x(x^2)}{(x^2+1)^2} = \dfrac{2x}{(x^2+1)^2}.$$
Since $(x^2 + 1)^2$ is always positive, $b'$ changes sign when $x$
changes sign. Hence $b'(x) \geq 0$ if $x\geq 0$ and $b'(x)< 0$
otherwise. This means that $b$ is increasing for $x\geq 0$ and
decreasing otherwise. Moreover
$$b''(x) = \diff{\dfrac{2x}{(x^2+1)^2}}{x} = \dfrac{2(x^2+1)^2 -2(2x)(2x)(x^2+1)}{(x^2+1)^4} =
 \dfrac{2-6x^2}{(x^2+1)^3} .$$Again $b''$ will change sign when
 $2-6x^2 = 2(1-\sqrt{3}x)(1+\sqrt{3}x)$ changes sign. By means of a sign diagram
 we see that $b''(x) \geq 0$ for $x\in \lcrc{-\frac{1}{\sqrt{3}}}{\frac{1}{\sqrt{3}}}$, and so $b$ is convex for
 $x\in \lcrc{-\frac{1}{\sqrt{3}}}{ \frac{1}{\sqrt{3}}}$ and concave otherwise. The graph is shewn in
 figure \ref{fig:x^2/(x^2+1)}.
\begin{exa}Draw the curve
$x \mapsto x^2+\dfrac{1}{x^2}.$
\end{exa}Solution: Put $c(x) = x^2+\dfrac{1}{x^2}$. Observe that $c(-x) = c(x)$, which means that $c$ is an even function
and hence symmetric about the $y$-axis.  Also
$$c'(x) = 2x -\dfrac{2}{x^3} = \dfrac{2(x^4-1)}{x^3} =
\dfrac{2(x-1)(x+1)(x^2+1)}{x^3}.$$We make a sign diagram
investigating the sign changes of  $c'$ near $x=-1$, $x=0$, and
$x=1$. From this we gather that $c$ is increasing for $x\in
[-1;0[\cup [1;+\infty[$. Moreover
$$c''(x) = \diff{\left(2x-\dfrac{2}{x^3}\right)}{x} = 2+\dfrac{6}{x^4}.$$We see that  $c''$ is always positive and hence it is always convex. The graph is shewn in
 figure \ref{fig:x^2+1/x^2}.

\bigskip

Analogous to theorem \ref{thm:graph_splitting_polynomials}, we now
consider rational functions $x\mapsto r(x) = \dfrac{p(x)}{q(x)}$
where $p$ and $q$ are polynomials with no factors in common and
splitting in $\BBR$.
\begin{thm}\label{thm:graph_splitting_rational_functions}
Let  $a\neq 0$ and the $r_i$ are real numbers and the $m_i$ be
positive integers. Then the rational function with assignment rule
 $$r(x) = K\dfrac{(x-a_1)^{m_1}(x-a_2)^{m_2} \cdots (x-a_k)^{m_k}}{(x-b_1)^{n_1}(x-b_2)^{n_2} \cdots (x-b_l)^{n_l}},
$$
\begin{itemize}
\item has zeroes at $x=a_i$ and poles at $x=b_j$.
\item crosses the $x$-axis at $x=a_i$ if $m_i$ is odd.
\item is tangent to the $x$-axis at $x=a_i$ if $m_i$
is even.
\item has a convexity change at $x=a_i$ if $m_i\geq 3$ and $m_i$ is odd.
\item both $r(b_j-)$ and $r(b_j+)$ blow to infinity.  If $n_i$ is even, then they have the same sign infinity:
 $r(b_i+) = r(b_i-) =
+\infty$ or $r(b_i+) = r(b_i-) = -\infty$. If $n_i$ is odd, then
they have different sign infinity:  $r(b_i+) = -r(b_i-) = +\infty$
or $r(b_i+) = -r(b_i-) = -\infty$.
\end{itemize}
\end{thm}
\begin{pf}
Since the local behaviour of $r(x)$ is that of $c(x-r_i)^{t_i}$
(where $c$ is a real number constant) near $r_i$, the theorem
follows at once from Theorem \ref{thm:power_functions} and
\ref{thm:graph_inverse_powers}.
\end{pf}
\begin{exa}\label{exa:(x-1)^2(x+2)/(x+1)(x-2)^2}
Draw a rough sketch of $x\mapsto
\dfrac{(x-1)^2(x+2)}{(x+1)(x-2)^2}$.
\end{exa}Solution: Put $r(x) = \dfrac{(x-1)^2(x+2)}{(x+1)(x-2)^2}$.  By Theorem
\ref{thm:graph_splitting_rational_functions}, $r$ has zeroes at
$x=1$, and $x=-2$, and poles at $x=-1$ and $x=2$. As $\tends{x}{1}$,
$r(x)\sim \dfrac{3}{2}(x-1)^2$, hence the graph of $r$ is tangent to
the axes, and positive, around $x=2$. As $\tends{x}{-2}$, $r(x)\sim
-\dfrac{9}{16}(x+2)$, hence the graph of $r$ crosses the $x$-axis at
$x=-2$, coming from positive $y$-values on the left of $x=-2$ and
going to negative $y$=values on the right of $x=-2$. As
$\tends{x}{-1}$, $r(x)\sim \dfrac{4}{9(x+1)}$, hence the graph of
$r$ blows to $-\infty$ to the left of $x=-1$ and to $+\infty$ to the
right of $x=-1$. As $\tends{x}{2}$, $r(x)\sim \dfrac{4}{3(x-2)^2}$,
hence the graph of $r$ blows to $+\infty$ both from the left and the
right  of $x=2$. Also we observe that
$$r(x) \sim \dfrac{(x)^2(x)}{(x)(x)^2} = \dfrac{x^3}{x^3} = 1,   $$
and hence $r$ has the horizontal asymptote $y=1$. The graph of $r$
can be found in figure \ref{fig:(x-1)^2(x+2)/(x+1)(x-2)^2}.

\begin{exa}\label{exa:(x-3/4)^2(x+3/4)^2)/(x+1)(x-1)}
Draw a rough sketch of $x\mapsto
\dfrac{(x-3/4)^2(x+3/4)^2}{(x+1)(x-1)}$.
\end{exa}Solution:  Put $r(x) = \dfrac{(x-3/4)^2(x+3/4)^2}{(x+1)(x-1)}$. First observe that
$r(x) = r(-x)$, and so $r$ is even. By Theorem
\ref{thm:graph_splitting_rational_functions}, $r$ has zeroes at
$x=\pm\dfrac{3}{4}$, and poles at $x=\pm 1$. As
$\tends{x}{\dfrac{3}{4}}$, $r(x)\sim -\dfrac{36}{7}(x-3/4)^2$, hence
the graph of $r$ is tangent to the axes, and negative, around
$x=3/4$, and similar behaviour occurs around $x=-\dfrac{3}{4}$.  As
$\tends{x}{1}$, $r(x)\sim \dfrac{49}{512(x-1)}$, hence the graph of
$r$ blows to $-\infty$ to the left of $x=1$ and to $+\infty$ to the
right of $x=1$.  As $\tends{x}{-1}$, $r(x)\sim
-\dfrac{49}{512(x-1)}$, hence the graph of $r$ blows to $+\infty$ to
the left of $x=-1$ and to $-\infty$ to the right of $x=-1$. Also, as
$\tends{x}{+\infty}$,
$$ r(x) \sim \dfrac{(x)^2(x)^2}{(x)(x)} = x^2,  $$so $r(+\infty) = +\infty$ and
$r(-\infty) = +\infty$. The graph of $r$ can be found in figure
\ref{fig:(x-3/4)^2(x+3/4)^2)/(x+1)(x-1)}.

\vspace{3cm}
\begin{figure}[h]
\centering
\begin{minipage}{7cm}$$\psset{unit=1pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{-6}{-1.083676189}{((x+2)*(x-1)^2)/((x+1)*(x-2)^2)}
\psplot[linewidth=2pt,linecolor=red]{-.9058688457}{1.655868846}{((x+2)*(x-1)^2)/((x+1)*(x-2)^2)}
\psplot[linewidth=2pt,linecolor=red]{3}{6}{((x+2)*(x-1)^2)/((x+1)*(x-2)^2)}
\psline[linestyle=dotted](-6,1)(6,1)
\psline[linestyle=dotted](-1,-6)(-1,6)
\psline[linestyle=dotted](2,-6)(2,6)
$$\vspace{2cm}\footnotesize\hangcaption{$x\mapsto \dfrac{(x-1)^2(x+2)}{(x+1)(x-2)^2}$}
\label{fig:(x-1)^2(x+2)/(x+1)(x-2)^2}
\end{minipage}
\hfill
\begin{minipage}{7cm}$$\psset{unit=2pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-3,-3)(3,3)
\psplot[linewidth=2pt,linecolor=red]{-1.740903741}{-1.046066042}{(((x-.75)^2)*((x+.75)^2))/((x+1)*(x-1))}
\psplot[linewidth=2pt,linecolor=red]{-.9746582010}{.9746582010}{(((x-.75)^2)*((x+.75)^2))/((x+1)*(x-1))}
\psplot[linewidth=2pt,linecolor=red]{1.046066042}{1.740903741}{(((x-.75)^2)*((x+.75)^2))/((x+1)*(x-1))}
\psline[linestyle=dotted](-3,1)(3,1)
\psline[linestyle=dotted](-1,-3)(-1,3)
\psline[linestyle=dotted](1,-3)(1,3)
$$\vspace{2cm}\footnotesize\hangcaption{$x\mapsto \dfrac{(x-3/4)^2(x+3/4)^2}{(x+1)(x-1)}$}
\label{fig:(x-3/4)^2(x+3/4)^2)/(x+1)(x-1)}
\end{minipage}

\end{figure}
\section{Algebraic Functions}
\begin{df}
We will call  {\em algebraic function} a function whose assignment
rule  can be obtained from a rational function by a finite
combination of additions, subtractions, multiplications, divisions,
exponentiations to a rational power. \index{function!algebraic}
\end{df}
\begin{thm}\label{thm:D(x^1/q)=x^(1/q-1)/q} Let $ q\neq 0$ be  an integer. The strong derivative of the
 function $x\mapsto x^{1/q}$ is the function $x\mapsto
\dfrac{1}{q}\cdot x^{1/q-1}$, whenever this last makes sense.
\end{thm}\begin{pf}
Put $f(x) = x^{1/q}$, assuming this quantity is real. Then $(f(x))^q
= x$. Differentiating both sides using the Chain Rule we have
$$q(f(x))^{q-1}f'(x) = \implies qx^{(q-1)/q}f'(x) = 1.
$$ Solving for $f'$ gives $$f'(x) = \dfrac{1}{q}\cdot x^{1/q-1},$$if this quantity is a real number, proving the result.
\end{pf}

\begin{rem}
Theorems \ref{thm:power_rule},  \ref{thm:strong derivative _x^-n},
and  \ref{thm:D(x^1/q)=x^(1/q-1)/q}, when combined with the Chain
Rule, say that if $\alpha$ is a rational number, then $(x^\alpha)' =
\alpha x^{\alpha -1}$.
\end{rem}
With the derivatives of rational powers determined, we can now
address how to graph them.
\begin{thm}\label{thm:graph_rational_powers}
Let $|q|\geq 2$ be an   integer.  If
\begin{itemize}\item if $q$ is even then $x\mapsto x^{1/q}$ is increasing and concave for $q \geq 2$ and
decreasing and convex for $q \leq -2$ for all $x>0$ and it is
undefined for $x<0$.
\item if $q$ is odd then $x\mapsto x^{1/q}$ is  everywhere increasing and convex
for $x<0$ but concave for $x>0$ if $q\geq 3$. If $q\leq -3$ then
$x\mapsto x^{1/q}$ is  decreasing and concave for $x<0$ and
increasing and convex for $x>0$.

\end{itemize} \end{thm}
\begin{pf}
Let $h(x) = x^{1/q}$. By Theorem \ref{thm:D(x^1/q)=x^(1/q-1)/q},
$h'(x) = \dfrac{x^{(1-q)/q}}{q}$ and $h''(x) =
\dfrac{(1-q)x^{(2q-1)/q}}{q^2}$.

\bigskip
Assume first that $q$ is even. Then $x^{1/q}$ is not real for $x<0$
so we assume that $x>0$. The quantity $h'(x) =
\dfrac{x^{(1-q)/q}}{q}$ is $>0$ for $q\geq 2$ and negative for
$q\leq -2$. If $q\geq 2$ then $h''(x) =
\dfrac{(1-q)x^{(2q-1)/q}}{q^2} <0$ and if $q\leq -2$ then $h''(x)
>0$. Hence $h$ is increasing and concave for $q \geq 2$ and
decreasing and convex for $q \leq -2$

\bigskip

Assume now that $q$ is odd. Then $1-q$ is even and the sign of the
quantity $h'(x) = \dfrac{1}{q}\cdot \left(x^{1/q}\right)^{1-q}$ is
depends on the sign of $\dfrac{1}{q}$. Since $2q-1$ is odd, the sign
of $h''(x) = \dfrac{(1-q)x^{(2q-1)/q}}{q^2}$ is $\sgn{(1-q)(x)}$. We
have: if $q \geq 3$, $h'(x) > 0$, $h''(x)<0$ for $x>0$ and $h''(x)
>0$ for $x<0$. Hence for $q \geq 3$, $h$ is increasing and it is convex
for $x<0$ but concave for $x>0$. If $q\leq -3$ then $h$ is
decreasing and it is concave for $x<0$ and decreasing convex for
$x>0$.
\end{pf}
A few of the functions  $x\mapsto x^{1/q}$ are shewn in figures
\ref{fig:x^1/2} through \ref{fig:x^-1/7}. \vspace{1cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{sqrt(x)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/2}$}
\label{fig:x^1/2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.02777777778}{6}{x^(-1/2)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/2}$}
\label{fig:x^-1/2}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{x^(1/4)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/4}$}
\label{fig:x^1/4}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.0007716049383}{6}{x^(-1/4)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/4}$}
\label{fig:x^-1/4}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{x^(1/6)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/6}$}
\label{fig:x^1/6}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.00002143347051}{6}{x^(-1/6)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/6}$}
\label{fig:x^-1/6}
\end{minipage}
\hfill
\end{figure}
\vspace{1cm}
\begin{figure}[h]
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{x^(1/3)}
\psplot[linewidth=2pt,linecolor=red]{-6}{0}{-1*abs(x)^(1/3)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/3}$}
\label{fig:x^1/3}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.004629629630}{6}{x^(-1/3)}
\psplot[linewidth=2pt,linecolor=red]{-.004629629630}{-6}{-1*abs(x)^(-1/3)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/3}$}
\label{fig:x^-1/3}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{x^(1/5)}
\psplot[linewidth=2pt,linecolor=red]{0}{-6}{-1*abs(x)^(1/5)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/5}$}
\label{fig:x^1/5}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.0001286008230}{6}{x^(-1/5)}
\psplot[linewidth=2pt,linecolor=red]{-.0001286008230}{-6}{-1*abs(x)^(-1/5)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/5}$}
\label{fig:x^-1/5}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{0}{6}{x^(1/7)}
\psplot[linewidth=2pt,linecolor=red]{0}{-6}{-1*abs(x)^(1/7)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{1/7}$}
\label{fig:x^1/7}
\end{minipage}
\hfill
\begin{minipage}{2cm}$$\psset{unit=.5pc,algebraic=true} \psaxes[linewidth=1pt,
labels=none, ticks=none]{->}(0,0)(-6,-6)(6,6)
\psplot[linewidth=2pt,linecolor=red]{.000003572245085}{6}{x^(-1/7)}
\psplot[linewidth=2pt,linecolor=red]{-.000003572245085}{-6}{-1*abs(x)^(-1/7)}
$$\vspace{1cm}\footnotesize\hangcaption{$x\mapsto x^{-1/7}$}
\label{fig:x^-1/7}
\end{minipage}
\hfill
\end{figure}


\bigskip

We finish this section with an example.

\begin{exa}

Consider the function $y = f(x) = \sqrt{x-1}+\sqrt{2-x}$.
\begin{enumerate}
\item For which $x$ will the output of $f$ be a real number?

\item Find  $f'(x)$.\item  By examining $f'$, prove that  $f$ increases for $x< \dfrac{3}{2}$ and decreasing for $x>\dfrac{3}{2}$.

\item  Prove that for all $x$ in the domain of $f$ one has $f(x) \leq
\sqrt{2}$. \item Find $f''(x)$.
\item Determine in which intervals $f$ is convex or concave.

\item Graph $f$.\end{enumerate}
\end{exa}
Solution: \\
\begin{enumerate}\item  We need, simultaneously, $x\geq 1$ and $2 \geq x$. This
means that $x\in [1;2]$.
\item Via the Chain Rule: $$\diff{(x-1)^{1/2}+(2-x)^{1/2}}{x} =
\dfrac{1}{2}(x-1)^{-1/2}-\dfrac{1}{2}(2-x)^{-1/2} =
\dfrac{1}{2(x-1)^{1/2}}-\dfrac{1}{2(2-x)^{1/2}}$$
\item  $f$ has a stationary point when $f'(x) = 0$, that is, if
$$  \dfrac{1}{2(x-1)^{1/2}}=\dfrac{1}{2(2-x)^{1/2}} \implies x-1 = 2-x \implies
x=\dfrac{3}{2},
$$so $f'$ has only one zero in $[1;2]$. Since $f'$ is continuous in $]1;2[$ and has only one zero there, it must be negative in
a portion of the interval and positive in the other. Examining
values in $]1;\frac{3}{2}[$ we see that $f'$ is positive for there
and negative in $]\frac{3}{2}; 2[$.
\item  By the above, $x=\dfrac{3}{2}$ is a global
maximum in $[1;2]$, and hence
$$f(x) \leq f\left(\dfrac{3}{2}\right) = \sqrt{\dfrac{3}{2}-1} \sqrt{2-\dfrac{3}{2}} =  2\sqrt{\dfrac{1}{2}} = \sqrt{2}.   $$
\item  Via the Chain Rule: $$ f''(x) =
\diff{\dfrac{1}{2}(x-1)^{-1/2}-\dfrac{1}{2}(2-x)^{-1/2}}{x} =
-\dfrac{1}{4}(x-1)^{-3/2}-\dfrac{1}{4}(2-x)^{-3/2} =
-\dfrac{1}{4(x-1)^{3/2}}-\dfrac{1}{4(2-x)^{3/2}}. $$

\item  Observe that
$$f''(x) = -\dfrac{1}{4(x-1)^{3/2}}-\dfrac{1}{4(2-x)^{3/2}} = -\dfrac{1}{4}\left(\dfrac{1}{(x-1)^{3/2}}+\dfrac{1}{(2-x)^{3/2}}\right).  $$
Since the quantity in parenthesis is always positive, $f''$ is
always negative, and hence it is everywhere concave.

\item The graph appears in figure \ref{fig:sqrt{x-1}+sqrt{2-x}}.
\end{enumerate}
 \vspace{5cm}
\begin{figure}[h]
$$\psset{algebraic=true,unit=4pc}
\psgrid[subgriddiv=4,linewidth=1pt, gridlabels=0](0,0)(0,0)(3,3)
\psaxes[xyLabel=\tiny](0,0)(0,0)(3,3)
\psplot[linecolor=red,linewidth=2pt]{1}{2}{sqrt(x-1)+sqrt(2-x)}
$$\vspace{1cm}\footnotesize\hangcaption{$y =\sqrt{x-1}+\sqrt{2-x}$}\label{fig:sqrt{x-1}+sqrt{2-x}}
\end{figure}



\clearpage
%\Closesolutionfile{jose}
\appendix
\renewcommand{\chaptername}{Appendix}
\chapter{Big $O$ Notation}\thispagestyle{empty} We will now study
the order of magnitude of functions, in other words, how big
functions are in a neighbourhood of a point.

\begin{df}
Let $f, g$ be two functions. We write $$f(x) = O(g(x))\qquad
\mathrm{as}\qquad \tends{x}{a},$$ read ``$f(x)$ is big oh of $g(x)$
as $x$ tends to $a$'' if there is a positive constant $C$ such that
for all $x$ sufficiently close to $a$ we have $|f(x)|\leq C|g(x)|$.
An equation of the type $f(x) = h(x)+ O(g(x))$  means that
$f(x)-h(x) = O(g(x))$. Here $h(x)$ is called the {\em principal
term} and $O(g(x))$ is called the {\em error term}. \index{O
notation}\index{big oh notation}
\end{df}
We are mainly interested in the above definition when $a=0$ or
$a=+\infty$.
\begin{exa}
As $\tends{x}{+\infty}$, we have $x+x^2 = O(x^2)$. In fact,  if
$1<x$ then $x<x^2$ which means that  $$x+x^2 < x^2+x^2 = 2x^2.$$
Thus for any $x$ larger than $1$, $x+x^2$ is bounded by a constant
times $x^2$.
\end{exa}
\begin{exa}
As $\tends{x}{0}$, we have $x+x^2 = O(x)$. In fact, if $|x|<1$, then
$x^2<|x|<1$, and hence $$|x+x^2| < |x|+|x^2| < |x|+|x| = 2|x|$$ when
$|x|< 1$. \end{exa}
\begin{rem}
The equality $f(x) = O(g(x))$ is not symmetric. For example, as
$\tends{x}{+\infty}$ we have $x=O(x^2)$ but $x^2\neq O(x)$.
\end{rem}
We have the following theorem.
\begin{thm} Let $r, s$ be real numbers with $r<s$. If $\tends{x}{+\infty}$
then $x^r = O(x^s)$.  If $\tends{x}{0}$ then $x^s = O(x^r)$.
\end{thm}
\begin{pf}
First observe that $s-r > 0$. Now, if $|x|>1$, then $|x|^{s-r}>1$
since we are raising a number larger than $1$ to a positive power.
Thus $$|x|>1\implies |x|^{s-r}>1 \implies |x|^s > |x|^r \implies x^r
= O(x^s),
$$for $|x|>1$ and certainly as $\tends{x}{+\infty}$.

\bigskip

Also,  if $|x|<1$, then $|x|^{s-r}<1$ since we are raising a number
smaller than $1$ to a positive power. Thus $$|x|<1\implies
 |x|^{s-r}<1 \implies |x|^s < |x|^r \implies x^s = O(x^r).$$
\end{pf}
The following properties of the $O$ symbol are easy to prove and
will be left as an exercise.
\begin{thm} The $O$ symbol has the following properties.
\begin{eqnarray}
f(x) & = & O(f(x))   \label{eq:f=Of}\\
kO(f(x)) & = & O(f(x)) \label{eq:kOf=Of}\\
O(f(x))+O(f(x)) &=& O(f(x)) \label{eq:Of+Of=Of} \\
O(O(f(x))) & = & O(f(x))\label{eq:OOf=Of}\\
O(f(x))O(g(x)) & = & O(f(x)g(x))\label{eq:OfOg=Ofg}\\
O(f(x)g(x)) & = & f(x)O(g(x))\label{eq:Ofg=fOg}\\
\end{eqnarray}
\end{thm}
\begin{exa}
As $\tends{x}{+\infty}$ we have $O(x^3)+O(x^4) = O(x^4)$, since the
$x^4$ term dominates over the $x^3$ for large $x$.
\end{exa}
\begin{exa}
As $\tends{x}{0}$ we have $O(x^3)+O(x^4) = O(x^3)$, since the $x^3$
term dominates over the $x^4$ for  small $x$.
\end{exa}

\begin{exa}
$x + 2x^2 + 3x^3 = O(x^3)$ as $\tends{x}{+\infty}$. This means that
for $x$ sufficiently large, $x+2x^2+3x^3$ is dominated by $x^3$.
\end{exa}
\begin{exa}
$x + 2x^2 + 3x^3 = O(x)$ as $\tends{x}{0}$. This means that for $x$
sufficiently small, $x+2x^2+3x^3$ is dominated by $x$.
\end{exa}

\begin{exa}
We have, as $\tends{x}{+\infty}$, $$\begin{array}{lll} (2x^3 +
O(x))(-3x^2 + O(x)) & = & -6x^5
+ O(-3x^3) + O(2x^4) + O(x^2) \\
& = & -6x^5 + O(x^3)+O(x^4) + O(x^2)\\
& = & -6x^5 +O(x^4).
\end{array}
$$
\end{exa}
Sometimes it is more important to know which term in a given sum
dominates when the variable tends to a determinate quantity. In the
next definition we will concentrate in the cases when the variable
tends to $0$ or $+\infty$.
\begin{df}
If $$0 \leq n_1 < n_2 < \cdots < n_q$$ is a sequence of integers
then the polynomial $$a_{n_1}x^{n_1} + a_{n_2}x^{n_2} + \cdots +
a_{n_q }x^{n_q}   $$has dominant term $a_{n_1}x^{n_1}$ as
$\tends{x}{0}$ and we write
$$a_{n_1}x^{n_1} +
a_{n_2}x^{n_2} + \cdots + a_{n_q }x^{n_q}  \sim  a_{n_1}x^{n_1}, \ \
\tends{x}{0},
$$read ``$a_{n_1}x^{n_1} +
a_{n_2}x^{n_2} + \cdots + a_{n_q }x^{n_q}$ {\em is asymptotic to}
$a_{n_1}x^{n_1}$ as $\tends{x}{0}$.''

\bigskip

Similarly, if $\tends{x}{\pm\infty}$ then the polynomial
$$a_{n_1}x^{n_1} + a_{n_2}x^{n_2} + \cdots + a_{n_q }x^{n_q}   $$has
dominant term $a_{n_q}x^{n_q}$ as $\tends{x}{\pm\infty}$ and we
write
$$a_{n_1}x^{n_1} +
a_{n_2}x^{n_2} + \cdots + a_{n_q }x^{n_q}  \sim  a_{n_q}x^{n_q}, \ \
\tends{x}{\pm\infty},
$$read ``$a_{n_1}x^{n_1} +
a_{n_2}x^{n_2} + \cdots + a_{n_q }x^{n_q}$ {\em is asymptotic to}
$a_{n_q}x^{n_q}$ as $\tends{x}{\pm\infty}$.''
\end{df}
\begin{exa}
We have $$ 4x + 3x^2 + 2x^3 + x^4 \sim 4x, \ \ \ \tends{x}{0},$$
$$1+ 4x + 3x^2 + 2x^3 + x^4 \sim 1, \ \ \ \tends{x}{0},$$
 $$ 4x + 3x^2 + 2x^3 + x^4 \sim x^4, \ \ \
\tends{x}{\pm \infty},$$etc.
\end{exa}

\chapter{Complex Numbers}
\section{Arithmetic of Complex Numbers}
We use the symbol $i$
to denote the {\em imaginary unit} $i = \sqrt{-1}$. Then $i^2 = -1.$
\begin{exa}
Find $\sqrt{-25}$.
\end{exa}
Solution: $\sqrt{-25} = 5i.$


\bigskip

Since $i^0 = 1, i^1 = i, i^2 = -1, i^3 = -i, i^4 = 1, i^5 = i,$
etc., the powers of $i$ repeat themselves cyclically in a cycle of
period $4$.


\begin{df}If $a, b$ are real numbers then the object $a + bi$ is called a
{\em complex number}.\end{df}

We use the symbol $\BBC$ to denote the set of all complex numbers.
If $a, b, c, d \in {\BBR}$, then the sum of the complex numbers $a +
bi$ and $c + di$ is naturally defined as
\begin{equation} (a + bi) + (c + di) = (a + c) + (b + d)i \end{equation}
The product of $a + bi$ and $c + di$ is obtained by multiplying the
binomials:
\begin{equation}
(a + bi)(c + di) = ac + adi + bci + bdi^2 = (ac - bd) + (ad + bc)i
\end{equation}
\begin{exa}
Find the sum $(4 + 3i) + (5 - 2i)$ and the product $(4 + 3i)(5 -
2i)$.
\end{exa}
Solution: One has $$(4 + 3i) + (5 - 2i) = 9 + i$$and
$$(4 + 3i)(5 - 2i) = 20 - 8i + 15i - 6i^2 = 20 + 7i + 6 = 26 + 7i.$$
\begin{df}
Let $z\in\BBC, (a, b) \in \BBR^2$ with $z = a + bi$. The {\em
conjugate} $\overline{z}$ of $z$ is  defined by
\begin{equation}
\overline{z} = \overline{a + bi} = a - bi
\end{equation}
\end{df}
\begin{exa}
The conjugate of $5 + 3i$ is $\overline{5 + 3i} = 5 - 3i$. The
conjugate of $2 - 4i$ is $\overline{2 - 4i} = 2 + 4i.$
\end{exa}
\begin{rem}
The conjugate of a real number is itself, that is, if $a\in \BBR$,
then $\overline{a} = a$. Also, the conjugate of the conjugate of a
number is the number, that is, $\overline{\overline{z}} = z.$
\end{rem}
\begin{thm}\label{thm:multiplicative_conjugation}
The function $z: {\BBC} \rightarrow {\BBC}, \ z \mapsto
\overline{z}$ is multiplicative, that is, if $z_1, z_2$ are complex
numbers, then
\begin{equation}
\overline{z_1z_2} = \overline{z_1} \cdot \overline{z_2}
\end{equation}
\end{thm}
\begin{pf} Let $z_1 = a + bi, z_2 = c + di$ where $a, b, c, d$ are real
numbers. Then
$$
\begin{array}{lll}
\overline{z_1z_2} & = & \overline{(a + bi)(c + di)}\\
& = & \overline{(ac - bd) + (ad + bc)i} \\
& = & (ac - bd) - (ad + bc)i\\
\end{array}$$
Also,
$$
\begin{array}{lll}
\overline{z_1}\cdot\overline{z_2} & = & (\overline{a + bi})(\overline{c + di}) \\
& = & (a - bi)(c - di) \\
& = & ac - adi - bci + bdi^2 \\
& = & (ac - bd) - (ad + bc)i,
\end{array}
$$which establishes the equality between the two
quantities. \end{pf}
\begin{exa}
Express the quotient $\dis{\frac{2 + 3i}{3 - 5i}}$ in the form $a +
bi$.
\end{exa}
Solution: One has
$$
\frac{2 + 3i}{3 - 5i} = \frac{2 + 3i}{3 - 5i}\cdot \frac{3 + 5i}{3 +
5i} = \frac{-9 + 19i}{34} = \frac{-9}{34} + \frac{19i}{34}$$



\begin{df}
The {\em modulus} $|a + bi|$ of $a + bi$ is defined by
\begin{equation}
|a + bi| = \sqrt{(a + bi)(\overline{a + bi})} = \sqrt{a^2 + b^2}
\end{equation}
\end{df}
Observe that $z \mapsto |z|$ is a function mapping  ${\BBC}$ to
${\BBR}_+$.
\begin{exa}
Find $|7 + 3i|$.
\end{exa}
Solution: $|7 + 3i| = \sqrt{(7 + 3i)(7 - 3i)} = \sqrt{7^2 + 3^2} =
\sqrt{58}$.
\begin{exa}
Find $|\sqrt{7} + 3i|$.
\end{exa}
Solution: $|\sqrt{7} + 3i| = \sqrt{(\sqrt{7} + 3i)(\sqrt{7} - 3i)} =
\sqrt{7 + 3^2} = 4$.


\begin{thm}
The function $z \mapsto |z|,\ {\BBC} \rightarrow {\BBR}_+$ is
multiplicative. That is, if $z_1, z_2$ are complex numbers then
\begin{equation} |z_1z_2| = |z_1||z_2|\end{equation}
\end{thm}
\begin{pf} By Theorem \ref{thm:multiplicative_conjugation}, conjugation is multiplicative, hence
$$
\begin{array}{lll}
|z_1z_2| & = & \sqrt{z_1z_2\overline{z_1z_2}}\\
& = & \sqrt{z_1z_2\overline{z_1}\cdot\overline{z_2}} \\
& = & \sqrt{z_1\overline{z_1}z_2\overline{z_2}} \\
& = & \sqrt{z_1\overline{z_1}}\sqrt{z_2\overline{z_2}} \\
& = & |z_1||z_2|
\end{array}$$whence the assertion follows. \end{pf}


\begin{exa}
Write $(2^2 + 3^2)(5^2 + 7^2)$ as the sum of two squares.
\end{exa}
Solution: The idea is to write $2^2 + 3^2 = |2 + 3i|^2,\  5^2 + 7^2
= |5 + 7i|^2$ and use the multiplicativity of the modulus.
Now \\
\begin{center}
\begin{tabular}{lll}
$(2^2 + 3^2)(5^2 + 7^2)$ &  $=$ &  $|2 + 3i|^2|5 + 7i|^2$ \\
&  $=$ & $|(2 + 3i)(5 + 7i)|^2$ \\
&  $=$ & $|-11 + 29i|^2$ \\
& $=$ & $11^2 + 29^2$
\end{tabular}
\end{center}

\section{Equations involving Complex Numbers} Recall that if $ux^2
+ vx + w = 0$ with $u \neq 0$, then the roots of this equation are
given by the {\em Quadratic Formula}
\begin{equation}
x = -\frac{v}{2u} \pm \frac{\sqrt{v^2 - 4uw}}{2u}
\end{equation}

The quantity $v^2 - 4uw$ under the square root is called the {\em
discriminant} of the quadratic equation $ux^2 + vx + w = 0$. If $u,
v, w$ are real numbers and this discriminant is negative, one
obtains complex roots.


\bigskip

Complex numbers thus occur naturally in the solution of quadratic
equations. Since $i^2 = -1$, one sees that $x = i$ is a root of the
equation $x^2 + 1 = 0$. Similary, $x = -i$ is also a root of $x^2 +
1.$
\begin{exa} Solve $2x^2 + 6x + 5 = 0$ \end{exa}
Solution: Using the quadratic formula
$$ x = -\frac{6}{4} \pm \frac{\sqrt{-4}}{4}   = -\frac{3}{{2}} \pm i\frac{1}{{2}}$$


\bigskip

In solving the problems that follow, the student might profit from
the following identities.

\begin{equation}
s^2 - t^2 = (s - t)(s + t)
\end{equation}
\begin{equation}
s^{2k} - t^{2k} = (s^k - t^k)(s^k + t^k), \ k\in\BBN
\end{equation}
\begin{equation}
s^3 - t^3 = (s - t)(s^2 + st + t^2)
\end{equation}
\begin{equation}
s^3 + t^3 = (s + t)(s^2 - st + t^2)
\end{equation}






\begin{exa}
Solve the equation $x^4 - 16 = 0$.
\end{exa}
Solution: One has $x^4 - 16 = (x^2 - 4)(x^2 + 4) = (x - 2)(x +
2)(x^2 + 4)$. Thus either $x = -2, x = 2$ or $x^2 + 4 = 0.$ This
last equation has roots $\pm 2i$. The four roots of $x^4 - 16 = 0$
are thus $x = -2, x = 2, x = -2i, x = 2i.$

\begin{exa}
Find the roots of $x^3 - 1 = 0$.

\end{exa}
Solution: $x^3 - 1 = (x - 1)(x^2 + x + 1)$. If $x \neq 1$, the two
solutions to $x^2 + x + 1 = 0$ can be obtained using the quadratic
formula, getting $\dis{x = -\frac{1}{2} \pm i\frac{\sqrt{3}}{2}}$.

\begin{exa}
Find the roots of $x^3 + 8 = 0$.
\end{exa}
Solution: $x^3 + 8 = (x + 2)(x^2 - 2x + 4)$. Thus either $x = -2$ or
$x^2 - 2x + 4 = 0$. Using the quadratic formula, one sees that the
solutions of this last equation are $\dis{x = 1 \pm i\sqrt{3}}$.
\begin{exa}
Solve the equation $x^4 + 9x^2 + 20 = 0$.
\end{exa}
Solution: One sees that
$$x^4 + 9x^2 + 20 = (x^2 + 4)(x^2 + 5) = 0$$Thus either $x^2 + 4 = 0$, in which case
$x = \pm 2i$ or $x^2 + 5 = 0$ in which case $x = \pm i\sqrt{5}$. The
four roots are $x = \pm 2i, \pm i\sqrt{5}$




%   \Readsolutionfile{jose}


\clearpage













\printindex\end{document}
