\section{Equations}
\definition{An \textbf{equation} is two mathematical \textbf{expressions} joined with an equal sign.}
\begin{example}
\[x^3+2x=1+x+\cos x\]
\end{example}
When an equation involves a variable (like $x$) equality will usually hold for only certain values of the variable.
These particular values are called the \textbf{solutions} or \textbf{roots}\footnote{Some reserve the term \emph{root} for solutions to an equation of the form $f(x)=0$ where $f$ is a function of $x$.  All equations can be rearranged into this form. The roots, in this situation, are also called the \emph{zeros} of the function $f(x)$ meaning they are the values of $x$ which make the function equal zero.} of the equation.
\textbf{Solving} an equation is the act of finding the solutions of it.

The above equation is difficult to solve.  The following equation is easy:
\[5x+2=0~.\]
 Just isolate the variable by doing the necessary inverse operations to both sides:
\begin{eqnarray*}
5x+2 & = & 0 \\
5x & = & -2 \ \ \ \mbox{subtracted 2 from both sides}\\
x & = & -\frac{2}{5}\ \ \ \mbox{divided both sides by 5}
\end{eqnarray*}
The above equation is an example of a \textbf{linear equation} $\boxed{ax+b=0}$ because it contains only powers of the variable (i.e. $x^n$) with the highest power being one ($x^1=x$, $x^0=1$).  Here $a$ and $b$ are \textbf{constants} -- the symbols represent numbers that just have not been specified.  In the above example they would be $a=5$ and $b=2$. The solution to the general linear equation in one variable would be $\boxed{x=-\frac{b}{a}}$.

A \textbf{quadratic equation}  involves a highest power of the variable of two, for example:
\[x^2=5x-6\]
The latter we rearrange by appropriate subtraction to be in the standard form $\boxed{ax^2+bx+c=0}$ to be:
\[x^2-5x+6=0\]
So $a=1$, $b=-5$, and $c=6$.
A \textbf{product} is made up of two or more \textbf{factors} multiplied together. One method of solving for $x$ involves \textbf{factoring} the left hand side.
\[(x-3)(x-2)=0\]
(Check by multiplication of the factors that the left hand side is the same as before!)
This simplifies the problem since the only way a product can equal zero is if one of the factors is zero:
\[\boxed{(A)(B)(C)\cdots=0 \iff A=0\ \mbox{or}\ B=0\ \mbox{or}\ C=0\ \mbox{or}\ \ldots}\]
Factoring thus reduces the above problem to solving two simpler linear equations:
\[x-3=0\ \mbox{or}\ x-2=0\]
\[x=3\ \mbox{or}\ x=2\]
So the solutions of the original quadratic equation are 2 and 3. Factoring can help solve complicated equations, just make sure you rearrange things so that zero is on one side of your equation first!

A second method to solve the quadratic equation for $x$ involves the technique called \emph{completing the square}. It can be done once and for all in terms of the constants $a$, $b$, $c$ to get the \textbf{quadratic formula}:
\[ax^2+bx+c=0 \Rightarrow \boxed{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}}\ \ \mbox{Memorize me!}\]
Here, in general, using the $+$ will give one solution and the $-$ will give the other.
\begin{example}
Solve the following equations:
\begin{enumerate}
\item $\displaystyle x^2-5x+6=0$ (Here use the quadratic formula.)
\item $\displaystyle x^2-4x+4=0$ (A quadratic with leading coefficient of $a=1$)
\item $\displaystyle 2x^2-4x+5=0$ (A quadratic with leading coefficient $a\neq1$)
\item $\displaystyle x^3-3x^2-4x=0$ (A \textbf{cubic equation})
\item $\displaystyle x^3-2x^2-3x+6=0$ (Factor by grouping.)
\item $\displaystyle 6x^2-13x-5=0$
\item $\displaystyle x^5-4x^3=0$ (A \textbf{quintic equation})
\item $\displaystyle x^4+2x^3-x-2=0$ (A \textbf{quartic equation})
\item $\displaystyle x^3+2x^2-1=0$
\item $\displaystyle x^3+27=0$
\end{enumerate}
\end{example}
The previous problems made use of some of the following factor \textbf{identities}:
\begin{method}
\vspace{-1em}
$\displaystyle (Ax+Ay+\ldots)=A(x+y+\ldots)\ \ \ \mbox{Pulling out a common factor of $A$}$

$\displaystyle x^2+(A+B)x+AB=(x+A)(x+B)\ \ \ \mbox{Factoring a quadratic with leading coefficient of 1}$

$\displaystyle ACx^2+(AD+BC)x+BD=(Ax+B)(Cx+D)\ \ \ \mbox{Factoring a general quadratic}$

$\displaystyle x^2-y^2=(x+y)(x-y)\ \ \ \mbox{Difference of Squares}$

$\displaystyle x^2+2xy+y^2=(x+y)^2$

$\displaystyle x^2-2xy+y^2=(x-y)^2$

$\displaystyle x^3+y^3=(x+y)(x^2-xy+y^2)\ \ \ \mbox{Sum of Cubes}$

$\displaystyle x^3-y^3=(x-y)(x^2+xy+y^2)\ \ \ \mbox{Difference of Cubes}$
\end{method}
\vspace{-.5em}
Here $x$, $y$, $A$, and $B$ could represent variables or constants or
even a combination. $A$ could be the factor $(x-2)$ or $y$ could be
the number $2$ or $x$ could be $2z$ so that $x^2=(2z)^2=4z^2$. Thus
these factor identities have more application than at first glance.

You can verify the identities by multiplying the right side of each
one out to get the left. Try it!  Note that $(x+y)^2$ just means
$(x+y)(x+y)$, etc.

%Note that the latter four factor identities can be written compactly as:
%\[x^3\pm y^3=(x\pm y)(x^2\mp xy+y^2)\]
%\[x^2\pm2xy+y^2=(x\pm y)^2\]

We call these factor equations \textbf{identities} rather than just
equations because they are true for not just a particular value of the
variables but for all values of them.
Identities can be used to manipulate expressions found in equations
like we did above since they replace one expression with another which
is completely equivalent.

\begin{exercise}
\input{EQUATIONS_AND_FUNCTIONS/solving-equations}%                           
\end{exercise}

Additional techniques beyond identities that are useful for finding solutions to polynomial equations are the \textbf{rational roots test} coupled with \textbf{polynomial division} to reduce the order of the polynomial.  The latter division, which involves only linear factors, can be done efficiently through a process called \textbf{synthetic division}.

While we have focussed on factoring to find solutions, it is sometimes useful to reverse this process and use solutions to equations to factor expressions.   As an example, to factor the quadratic expression $ax^2+bx+c$, one can use the quadratic formula to find the two solutions $x_+$ and $x_-$ to the quadratic equation $ax^2+bx+c=0$.  The original quadratic polynomial then factors as
\[ax^2+bx+c=a(x-x_+)(x-x_-)\]
where the coefficient $a$ on the right hand side is required to make the $x^2$ terms equal.  As a specific example, the polynomial $6x^2-13x-5$ when equated to zero has solutions $x_+=5/2$ and $x_-=-1/3$ by the quadratic formula.  It follows that $6x^2-13x-5=6(x-5/2)[x-(-1/3)]$ which simplifies to $(2x-5)(3x+1)$\,.\footnote{This factoring procedure is particularly useful if the roots generated by the quadratic equation are irrational.}  

\section{Functions}

\subsection{Sets}

To define a function we first define the notion of a \textbf{set}.\footnote{This naive definition of a set as a collection results in logical inconsistencies that need to be resolved using a more rigorous axiomatic approach.  However, for the sets encountered in this text, both of finite and infinite size, the given definition will be sufficient.}

\definition{A \textbf{set} $S$ is a collection of distinct objects called \textbf{elements}.}

In mathematics sets will often contain numbers and a finite set can be represented by listing its elements between braces, $\{$~and~$\}$.  For example, the set $S=\{2,3,7\}$ is the set containing the three integers 2, 3, and 7.  Order does not matter in a set, so $\{2,3,7\}=\{3,2,7\}$.  In an infinite set we cannot list all the elements so other notation is required.  For the set $S$ of all real numbers between two values, say $-2$ and $5$ (but not including the endpoints $-2$ and $5$), one can use \textbf{interval notation} and write $S=(-2,5)$\,.  If we wish to include one or both endpoints we use square brackets $[$~and~$]$ rather than parentheses.  So $S=(-2,5\,]$ includes all the numbers strictly between $-2$ and $5$ as well as $5$ itself.  If we wish to indicate all the numbers that are greater than a number (say 3) we can use the infinity symbol~$\infty$ and write the interval as $(3,\infty)$.  An interval containing both endpoints, like $[-1,1]$, is called \textbf{closed}. An interval containing neither endpoint, like $(2,3)$ or $(-\infty,2)$, is called \textbf{open}. For the set of all real numbers one uses the special symbol~$\mathset{R}$.  Clearly $\mathset{R}=(-\infty,\infty)$\,. A set containing no elements, $S=\left\{\,\right\}$, is called the \textbf{empty set} and is denoted $\varnothing$\,. 

Given two sets $S$ and $T$ we can combine the elements from both sets to create a new set called the \textbf{union} of the sets, $\bm{S\cup T}$, which is the set of all the elements in $S$ \textbf{or} $T$ (including the elements in both).  So $(1,3)\cup(2,6)=(1,6)$\,.  The \textbf{intersection} of the sets, $\bm{S\cap T}$, is the smaller set of elements that are found in both $S$ \textbf{and} $T$. So $(1,3)\cap(2,6)=(2,3)$\,.  The \textbf{difference} of two sets, $\bm{S-T}$, is a new set that contains all elements in $S$ except for those also found in $T$.  So, for example, to describe the set of all real numbers except for the number $-2$ one could write either $(-\infty,-2)\cup(-2,\infty)$ or, more simply,~$\mathset{R}-\{-2\}$\,.  Finally one can also use set notation with braces to represent infinite sets.  The set $\{x\in\mathset{R}\,|\,3<x\le 5\}$ can be read, ``The set of all $x$ in ($\in$) the real numbers such that (\,$|$\,) $x$ is between $3$ and $5$, including $5$.  In interval notation this is just the set $(3,5\,]$.  As a further example, the intersection of two sets could be written $S\cap T=\{x\,|\,x\in S\ \mbox{and}\ x\in T\}$\,.

\subsection[Definition]{Definition of a Function}

\definition{A \textbf{function} $f$ is a rule (correspondence) that assigns to each element $x$ in a set $D$ \textbf{exactly one} element $y=f(x)$ in a set $R$\,.}

Think of a function as a machine that takes an input value $x$ and turns it into an output value $y$ or $f(x)$.

\begin{example}
Let $f(x)=2x^2-3x+5$.  Find $f(3)$ and $f(-2)$.
\end{example}

\begin{itemize}
\item The variable $x$ is called the \textbf{independent variable}.
\item The variable $y$ is called the \textbf{dependent variable}.
\item The set $D$ is called the \textbf{domain} of the function.
\item The set $R$ of all assumed $y$-values is called the \textbf{range} of the function.
\end{itemize}

\subsection{Representing Functions}
There are different ways to represent a function:
\begin{description}
\item[Formulaic:] The output values are given by explicit formula:
\[y=x^3+2x+3\hspace{2cm} f(z)=z^3-5z-10\]
\item[Graphical (Visual):] The function value for $x$ is found by looking at the $y$-value of the point $(x,y)$ on a line in the \textbf{Cartesian plane}:
\begin{center}
\begin{asy}
import graph;
size(150,0);
real f(real x) {return x^2;}
pair F(real x) {return (x,f(x));}
//xaxis("$x$",Arrow(HookHead,size=4));
// Use Step= to set tick steps.
// OmitFormat removes label, OmitTick removes tick and label.
// endlabel=false removes the last label.
// n=1 removes small ticks.
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0,2)));
//yaxis("$y$",Arrow(HookHead,size=4));
yaxis(shift(-8,-7)*Label("$y$",align=N),Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Label(fontsize(10)),OmitFormat(0,1,3),OmitTick(0,5)));
draw(graph(f,-2.2,2.2,operator ..),red+2);
xequals(-2,ymin=0,ymax=f(-2),dashed);
yequals(f(-2),xmin=-2,xmax=-.5,dashed);
//labely(1,E);
//label("$y=x^2$",F(2.1),NW);
dot((-2,4),L=Label("$(-2,4)$",align=W),6+black);
//label("$(-2,4)$",F(-2),W);
//label(Label("$f(-2)$",fontsize(10)),(0,4),E);
\end{asy}
\end{center}

Here $f(-2)=4$\,.

\item[Tabular (Numerical):] The $y$-values are listed for each $x$-value.
For example define a function by:
\begin{center}
\begin{tabular}{c|c}
$x$ & $y$ \\ \hline
-1 & 2 \\
2 & 0 \\
3 & 5
\end{tabular}
\end{center}
Note for a function like $y=x^2$ it is impossible to tabulate all the
possible values of $y$ if $x$ is allowed to be any real number.
However it is often convenient to tabulate some values for graphing
purposes, etc.  For a function defined over only a finite domain (as
in our example $D=\{-1,2,3\}$) a table is perfectly fine, however.
\item[Symbolic:] The function is referred to by a symbol.
\[y=f(x) \ \ \ \ z=H(\alpha)\]
Note here that we are using functional notation. When we write $f(x)$ we do not mean multiplication; rather $f(x)$ represents the value $y$ the function $f$ assigns to a particular value of~$x$\,.\footnote{Also note the use of the Greek letter alpha ($\alpha$) for the variable in the second example.  A few useful Greek letters worth knowing are the first five of its alphabet, namely alpha: $\alpha$, beta: $\beta$, gamma: $\gamma$, delta: $\delta$, and epsilon: $\epsilon$\,. Also theta: $\theta$, phi: $\phi$, and rho: $\rho$ are also commonly used.}
\end{description}

\textbook{\clearpage}
\subsection{Vertical Line Test}
\begin{description}
\item[Vertical line test:] A curve lying in the $x$-$y$ coordinate plane is the graph of a function if and only if every vertical line intersects the curve at no more than one point.
\end{description}
\hfill
\begin{asy}
import graph;
size(150,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+2);
xequals(.5,ymin=-2,ymax=3.5,dashed);
dot(F(.5),6+black);
label("A function",(-3.7,2.5),E);
\end{asy}
\hfill
\begin{asy}
import graph;
size(150,0);
real f(real x) {return sqrt(x-1)+1;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -sqrt(x-1)+1;}
pair G(real x) {return (x,g(x));}
xaxis("$x$",xmin=-.5, Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,1,4,operator ..),red+2);
draw(graph(g,1,4,operator ..),red+2);
xequals(1.5,ymin=-1,ymax=+3,dashed);
dot(F(1.5),6+black);
dot(G(1.5),6+black);
label("Not a function",(2,1),E);
\end{asy}
\hfill

The curve at right represents the \textbf{relation} $(y-1)^2=x-1$.  Unlike functions, relations do not require a single $y$-value for each $x$-value.

\subsection[Determining the Domain]{Determining the Domain of a Function}
When a function is given as a formula with no domain specified the domain $D$ is the set of all real numbers for which the formula makes sense and defines a real number. The impossibility of dividing by zero or taking an even root of a negative number will, for example, restrict the domain of certain functions. Deciding when an expression involving a variable is negative ($<0$) or not involves working with inequalities.  This is reviewed in Appendix~\ref{ap:inequalities}\,.
\begin{example}
Find the domain of each of the following functions:
\begin{multicols}{2}
\begin{enumerate}
\item $\displaystyle f(x)=x^4+x$
\item $\displaystyle f(x)=\frac{2}{x^2-9}$
\item $\displaystyle f(x)=\sqrt{x-2}$
\item $\displaystyle h(t)=\sqrt[3]{t+4}$
\item $\displaystyle f(x)=\sqrt{x^2-3x}$
\item $\displaystyle g(t)=\sqrt{\frac{t+5}{t-2}}$
\end{enumerate}
\end{multicols}
\end{example}

\textbook{\clearpage}
\subsection{Intercepts}

\definition{A $y$-value at which a graph touches the $y$-axis is called a
  $\bm{y}$\textbf{-intercept}. An $x$-value at which a graph touches the
  $x$-axis is called an $\bm{x}$\textbf{-intercept}.}

Note that the graph does not necessarily cross the axis at an intercept (though it typically will).  The following graph has $x$-intercepts of $x=1$ and $x=3$ and a $y$-intercept of $y=2$\,.
\begin{center}
\resizebox{4.0cm}{!}{\asycode{%
import graph;
size(150,150);
real f(real x) {return -2/3*(x-1)^2*(x-3);}
pair F(real x) {return (x,f(x));}
draw(graph(f,-0.2,3.5,operator ..),red+2);
xaxis("$x$",Arrow(HookHead,size=4),above=true);
yaxis("$y$",ymax=4,Arrow(HookHead,size=4),above=true);
xtick("$3$",3);
xtick("$1$",1);
ytick("$2$",2);
}} 
\end{center}

The function $f$ itself can be used to find where its graph intersects
an axis. A $y$-intercept for the graph of function $y=f(x)$ is found by
evaluating $f(0)$, while $x$-intercepts are found by solving $f(x)=0$
for~$x$.  For a relation one sets $x=0$ and solves for $y$ to find any
$y$-intercepts and sets $y=0$ and solves for $x$ to find any
$x$-intercepts.

Conversely, one can solve the equation $f(x)=0$ approximately by graphing the function $y=f(x)$ by plotting points and then observing the approximate $x$-intercepts.  These are the solutions to $f(x)=0$ since at the $x$-intercepts one has $y=0$.  Such approximate solutions can then be further refined using numerical techniques, such as \textbf{Newton's method}, that require an initial guess for a solution as a starting point to the algorithm. 

\subsection{Symmetry of Functions}
\definition{A function $f(x)$ is said to be
\begin{description}
\item[even] if $f(-x)=f(x)$, and
\item[odd] if $f(-x)=-f(x)$~.
\end{description}}
\begin{example}
Find the intercepts of the following functions and determine if the functions are even or odd.
\begin{enumerate}
\item $\displaystyle f(x)=x^4-5x^2$
\item $\displaystyle f(x)=x^3-3x^2+4$
\item $\displaystyle f(x)=\frac{x^2+5}{x^3+x}$
\end{enumerate}
\end{example}

\textbook{\clearpage}
Note:
\begin{itemize}
\item An even function is symmetric with respect to the $y$-axis. (Every point $(x,y)$ on the graph has a corresponding point $(-x,y)$ that also sits on the graph.)
\item An odd function is symmetric with respect to the origin. (Every point $(x,y)$ on the graph has a corresponding point $(-x,-y)$ that also sits on the graph.)
\end{itemize}
The graphs of the even and odd functions from the last example illustrate these symmetries.
 
\hfill
\resizebox{.28\textwidth}{!}{%
\asycode{%
import graph;
size(150,0);
real f(real x) {return x^4-5x^2;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",-3,3,Arrow(HookHead,size=4));
yaxis("$y$",ymax=f(2.4),Arrow(HookHead,size=4));
draw(graph(f,-2.35,2.35,operator ..),red+2);
dot(F(2.3),L=Label("$(x,y)$",align=NW),6+black);
dot(F(-2.3),L=Label("$(-x,y)$",align=NE),6+black);
draw(F(-2.3)--F(2.3),blue+1+dashed,Arrows(size=8));
label("$f(x)=x^4-5x^2$",F(2.35),N);
}
}
\hfill
\resizebox{.28\textwidth}{!}{%
\asycode{%
import graph;
size(150,0);
real f(real x) {return (x^2+5)/(x^3+x);}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,-.6,operator ..),red+2);
draw(graph(f,.6,4,operator ..),red+2);
dot(F(1.5),L=Label("$(x,y)$",align=NE),6+black);
dot(F(-1.5),L=Label("$(-x,-y)$",align=SW),6+black);
draw(F(-1.5)--F(1.5),blue+1+dashed,Arrows(size=8));
label("$f(x)=\frac{x^2+5}{x^3+x}$",F(1),NE);
}
}
\hfill~

Recognizing the symmetry of a function is therefore useful when graphing, since the graph of a symmetric function to the left of the origin ($x<0$) is completely determined by the graph to the right of it ($x>0$).  As such one only needs to calculate points on half the domain when graphing symmetric functions.

Symmetry is also helpful in solving equations.  If one desires solutions to $f(x)=0$ and one observes that $f(x)$ is symmetric (either even or odd), then if $x_0$ is a solution to the equation then $-x_0$ must also be a solution.  This follows since, for a symmetric function $f(-x_0)=\pm f(x_0)=\pm 0=0$.  Graphically this can be seen for the function $f(x)=x^4-5x^2$ above, where the function crosses the $x$-axis at $\sqrt{5}$ and $-\sqrt{5}$.  These are both solutions to $x^4-5x^2=0$ since the graph $y=f(x)$ crosses the $x$-axis ($y=0$) at those values. 

\textbook{\clearpage}
\subsection{Reflection and Translation}
It is possible to construct new functions from an original function
$f(x)$ whose graphs are reflections about the $y$-axis or $x$-axis or
horizontal or vertical translations of the original graph.  Consider
the function $f(x)$ defined by the following graph:
\begin{center}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+2);
label("$y=f(x)$",F(-3.7),NE);
\end{asy}
\end{center}
Evaluating the following transformations $g(x)$ of $f(x)$ at a few
points $x$ confirms the following results.  (Alternatively pick an actual
function, work out the transformation and plot the result.)

\begin{multicols}{2}
\subsubsection*{$y=g(x)=f(-x)$:}
\begin{center}
\resizebox{.40\textwidth}{!}{%
\asycode{%
import graph;
size(213,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
real g(real x) {return 1-1/2*x^2-1/27*x^3+1/21*x^4;}
pair G(real x) {return (x,g(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+dashed);
draw(graph(g,-3.5,4,operator ..),blue+2);
draw((-1.2,1.5)--(1.2,1.5),black+2,Arrows(size=8));
label("$y=f(-x)$",G(-3.3),NE);
}
}

Reflection about the $y$-axis.
\end{center}

\subsubsection*{$y=g(x)=f(x-a)$:}
\begin{center}
\resizebox{.40\textwidth}{!}{%
\asycode{%
import graph;
size(253,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
real g(real x) {return 1-1/2*(x-2)^2+1/27*(x-2)^3+1/21*(x-2)^4;}
pair G(real x) {return (x,g(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+dashed);
draw(graph(g,-2,5.5,operator ..),blue+2);
draw(F(-3.7)--G(-1.7),black+2,Arrow(size=8));
label(scale(1.8)*"$a$",(-2.7,1),S);
label("$y=f(x-a)$",G(.3),SE);
}
}

For $a>0$ translation is to the right, while $a<0$ results in translation to the left.
\end{center}

\subsubsection*{$y=g(x)=-f(x)$:}
\begin{center}
\resizebox{.40\textwidth}{!}{%
\asycode{%
import graph;
size(200,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -(1-1/2*x^2+1/27*x^3+1/21*x^4);}
pair G(real x) {return (x,g(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+dashed);
draw(graph(g,-4,3.5,operator ..),blue+2);
draw((.6,.6)--(.6,-.6),black+2,Arrows(size=8));
label("$y=-f(x)$",G(-3.7),SE);
}
}

\item Reflection about the $x$-axis.
\end{center}

\subsubsection*{$y=g(x)=f(x)+a$:}
\begin{center}
\resizebox{.40\textwidth}{!}{%
\asycode{%
import graph;
size(200,0);
real f(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4;}
pair F(real x) {return (x,f(x));}
real g(real x) {return 1-1/2*x^2+1/27*x^3+1/21*x^4+2;}
pair G(real x) {return (x,g(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-4,3.5,operator ..),red+dashed);
draw(graph(g,-4,3.5,operator ..),blue+2);
draw(F(2)--G(2),black+2,Arrow(size=8));
label(scale(1.8)*"$a$",(2,1),E);
label("$y=f(x)+a$",G(-3.7),NE);
}
}

For $a>0$ translation is upward, while $a<0$ results in translation downward.
\end{center}

\end{multicols}

\begin{exercise}
\input{EQUATIONS_AND_FUNCTIONS/properties-of-functions}
\end{exercise}

\subsection{Types of Functions}
\label{subsec:functiontypes}
\begin{description}
\item[Polynomials:] $\displaystyle\boxed{f(x)=a_0+a_1x+a_2x^2+a_3x^3+\ldots+a_nx^n}$ where $n$ is a positive integer.  The $a_i$ are constants called the \textbf{coefficients} of the polynomial while $n$ is its \textbf{degree} (assuming $a_n\neq0$).
\begin{example}
The following are polynomials:
\[y=2x+9\ \ \ \mbox{(A straight line})~\,\]
\[f(x)=x^{4}-5x^2\ \ \ \mbox{(See our previous plot.)}\]
\[f(x)=x^{10}+5x^7+3x^4+10~~~~~~~~~~~\]
\end{example}
Note $D=\mathset{R}$ for a polynomial.
\item[Rational Functions:] $\displaystyle\boxed{f(x)=\frac{P(x)}{Q(x)}}$ where $P(x)$ and $Q(x)$ are polynomials.
\begin{example} The following are rational functions.
\[f(x)=\frac{x^2+5}{x^3+x}\ \ \ \mbox{(See our previous plot.)}\]
\[g(x)=\frac{x+2}{x^2-1}~~~~~~~~~~~~~~~~~~~~~~~~~~~~\]
\end{example}
The domain for a rational function is all the real numbers except for those where the denominator vanishes.  In set notation symbols $D=\{x\in\mathset{R}~|~Q(x)\neq0\}$. (Read $\in$ as ``in'' and the vertical bar (~$|$~) as ``such that''.)
\begin{example}Factoring the denominator polynomials we see the domains of our rational functions are:
\[\mbox{Domain for}~f(x): x^3+x=x(x^2+1)\ \Rightarrow\ D=\mathset{R}-\{0\}~~~~~~~~~~\]
\[\mbox{Domain for}~g(x): x^2-1=(x+1)(x-1)\ \Rightarrow\ D=\mathset{R}-\{-1,1\}\]
\end{example}

\item[Power Functions:] $\displaystyle\boxed{f(x)=x^r}$ where $r$ is any real number.
\begin{example}
The following are power functions.

~~~~~~~~~~~$\displaystyle f(x)=x^4$\hfill$\displaystyle g(x)=x^{\frac{1}{2}}=\sqrt{x}$\hfill$\displaystyle h(x)=x^{-1}=\frac{1}{x}$~~~~~~~~~~

\begin{asy}
import graph;
size(125,0);
real f(real x) {return x^4;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-1.2,1.2,operator ..),red+2);
label("$f(x)=x^4$",F(1.1),NW);
\end{asy}
\hfill
\begin{asy}
import graph;
size(125,0);
real f(real x) {return sqrt(x);}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,0,2,operator ..),red+2);
label("$g(x)=x^{\frac{1}{2}}$",F(1),SE);
\end{asy}
\hfill
\begin{asy}
import graph;
size(125,0);
real f(real x) {return 1/x;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",-2.2,Arrow(HookHead,size=4));
yaxis("$y$",-2,2,Arrow(HookHead,size=4));
draw(graph(f,-2,-.5,operator ..),red+2);
draw(graph(f,.5,2,operator ..),red+2);
label("$h(x)=x^{-1}$",(.5,-.5),SE);
\end{asy}
\end{example}

\item[Absolute Value Function:] $\displaystyle\boxed{f(x)=|x|=
\left\{\begin{array}{rl}
x & \mbox{if}\ x\ge 0\\
-x & \mbox{if}\ x< 0
\end{array}
\right.}$\ \ (A \textbf{piecewise-defined} function.)
\begin{center}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return abs(x);}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,-2,2,operator ..),red+2);
label("$f(x)=|x|$",F(1),SE);
\end{asy}
\end{center}

Note that $\sqrt{x^2}\neq x$! To see this, notice that for $x=-2$ we have $\sqrt{(-2)^2}=\sqrt{4}=2$, since square root returns a single value (as required for a function) defined to be the positive square root.  So here $\sqrt{(-2)^2}=2=-(-2)$ and, in general, for $x<0$ one has $\sqrt{x^2}=-x$.  For $x\ge0$ on has $\sqrt{x^2}=x$.  The two possibilities can be conveniently combined using the absolute value function to get the correct result for all real values of $x$, namely $\boxed{\sqrt{x^2}=|x|}$.  Thus the equation $x^2=4$ is in fact equivalent to $|x|=\sqrt{4}=2$ which, in turn is equivalent to $x=2$ or $-x=2$ (so $x=-2$).\footnote{The underlying problem here is that the function $f(x)=x^2$ is not \emph{invertible}. The square root function is only the inverse of $f(x)=x^2$ restricted to the domain $[0,\infty)$ (which is invertible).  One cannot, therefore, take the square root of $x^2$ when solving an equation and get $x$ without typically missing a solution.  A related problem occurs when one squares both sides of an equation to remove a radical.  In this case the new equation may have solutions that are not solutions to the original equation, so-called \emph{extraneous roots}, and one must check all solutions to the new equation back in the original equation to avoid them.  As an example, the equation $\sqrt{2x+3}=x$, upon squaring both sides gives the equation $2x+3=x^2$ which has solutions $x=-1$ or $x=3$.  Only $x=3$ is a solution to the original equation; $x=-1$ is extraneous. In general, care must be taken when taking even roots and powers.  However, odd root and power functions (which are invertible on their natural domains) behave as expected, $\sqrt[n]{x^n}=x$ and $(\sqrt[n]{x})^n=x$ for $n$ odd.}

\item[Exponential Functions:] $\displaystyle\boxed{f(x)=b^x}$ where $b$ is a positive real number (the \textbf{base}).
\begin{example}
The following are exponential functions.
\[f(x)=2^x\hspace{3.4cm}\]\[g(x)=e^x\ \mbox{where}\ e=2.71828\ldots\]
\begin{center}
\begin{asy}
import graph;
size(150,0);
real f(real x) {return 2^x;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",0,Arrow(HookHead,size=4));
draw(graph(f,-4,3,operator ..),red+2);
label("$f(x)=2^x$",F(1.1),SE);
labely(1,L=Label("$1$",fontsize(10)),E);
\end{asy}
\end{center}
\end{example}

\item[Logarithmic Functions:] $\displaystyle\boxed{f(x)=\log_b x}$ where $b$ is a positive real number.
\begin{example}
The following are logarithmic functions.
\[f(x)=\log_2 x\hspace{1.1cm}\]\[g(x)=\log_e x=\ln\,x\]
\begin{center}
\begin{asy}
import graph;
size(150,0);
real f(real x) {return log(x);}
pair F(real x) {return (x,f(x));}
xaxis("$x$",Arrow(HookHead,size=4));
yaxis("$y$",Arrow(HookHead,size=4));
draw(graph(f,0.1,4,operator ..),red+2);
label("$g(x)=\ln\,x$",F(2),SE);
labelx(1,L=Label("$1$",fontsize(10)),S);
\end{asy}
\end{center}
\end{example}

\textbook{\clearpage}
\item[Trigonometric Functions:]~

\begin{example}
The following are trigonometric functions.

\hfil $\displaystyle f(x)=\sin x$\hfil$\displaystyle y=\csc x$ \hfil
\end{example}

Trigonometric functions of angles that are less than $90^\circ$ (acute angles) are defined to be functions of \textbf{similar} right triangles.  Two geometrical figures are similar if they have the same shape, but potentially different sizes:
\begin{center}
\parbox[t]{3in}{\vspace{0em}{\resizebox{2.7in}{!}{\input{similar_triangles.pspdftex}}}}
\end{center}
Similarity of regular polygons means that the corresponding angles in the figures are equal.  The lengths of corresponding sides, however, must only form a proportion.  For the similar triangles above one has
\[\frac{a}{A}=\frac{b}{B}=\frac{c}{C}\,.\]
The first equality implies
\[\frac{a}{b}=\frac{A}{B}\,,\]
and, in general, the ratio of the lengths of two sides in a figure will be the same for the corresponding sides of all similar figures. 

The basic trigonometric functions are defined as ratios of the sides of a right triangle for a given angle~$x$.  Since these ratios are the same for two similar triangles these functions are well defined. 

\begin{method}
\includegraphics[width=5.3cm]{trigtriangle}
\raisebox{4em}{
$\begin{array}{ll}
\displaystyle\sin x =\frac{opp}{hyp} & \displaystyle \csc x=\frac{1}{\sin x}=\frac{hyp}{opp} \\[2em]
\displaystyle\cos x =\frac{adj}{hyp} & \displaystyle \sec x=\frac{1}{\cos x}=\frac{hyp}{adj} \\[2em]
\displaystyle\tan x =\frac{opp}{adj}=\frac{\sin x}{\cos x}~~~~ & \displaystyle \cot x=\frac{1}{\tan x}=\frac{adj}{opp}=\frac{\cos x}{\sin x}
\end{array}$}
\end{method}

For angles larger than $90^\circ$ the trigonometric functions are
defined by considering Cartesian Coordinates and choosing a point
$(x,y)$ on the terminal ray of the angle and defining the functions
identically as in the acute case with the replacements
$adjacent\rightarrow x$, $opposite\rightarrow y$, and
$hypotenuse\rightarrow r$ where $r=\sqrt{x^2+y^2}$.  So for instance,
now using $\theta$ (pronounced theta) for the angle,
$\tan\theta=\frac{y}{x}$, etc.  Since $x$, and $y$ can be negative the
trigonometric functions themselves can also now be negative.  The
situation is summarized in the next diagram.
\begin{center}
\parbox[t]{2.7in}{\vspace{0em}{\resizebox{2.7in}{!}{\input{trigsigns.pspdftex}}}}
\end{center}
The sign of the reciprocal trigonometric functions (cosecant, secant, and cotangent) follow the same behaviour as sine, cosine, and tangent respectively.

\subsection*{Radian Measure}
We can measure angles either in degrees (1 circle=$360^\circ$) or in terms of the length of arc on a circle that an angle subtends.  To do the latter the angle, in radians, is just the ratio of the length of the arc $s$ over the radius $r$, so $\displaystyle\theta=\frac{s}{r}$.
\begin{center}
\parbox[t]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{radians.pspdftex}}}}
\end{center}
By taking the ratio of $s$ over $r$ we are guaranteed that our angle
calculation will be independent of the choice of the size of the
circle we use since two different circles will generate two
\textbf{sectors} of a circle (i.e. pieces of pie) that are similar
figures.

If we draw the angle in a \textbf{unit circle} so $r=1$ then the angle is exactly the arc length measured.  Since for a unit circle the circumference is $2\pi r=2\pi(1)=2\pi$ the angle of an entire circle is 1 circle=$2\pi$ radians.  It therefore follows that
\[\pi\ \mbox{rad}=180^\circ\]

Unlike degrees, radians are a fake unit and we don't need to write
it. (Both $s$ and $r$ have the same length units so their ratio is
dimensionless.)  An angle reported with no units is assumed to be in
radians.  When we later work with angles the formulae we derive will
assume angles are given in radians.\footnote{Remember when doing any trigonometric evaluation formulae in calculus usually require
angles to be in radians not degrees.  Most calculators have a setting
to put the calculator in ``radian mode'' so that all angles arguments
(and angles returned from inverse trig functions like $\arcsin(x)$~) are
assumed to be in radians.}

Using the previous relation some basic angle measurements in radians are:

\hfil$\displaystyle30^\circ=\frac{\pi}{6}$\hfil$\displaystyle45^\circ=\frac{\pi}{4}$\hfil$\displaystyle60^\circ=\frac{\pi}{3}$\hfil$\displaystyle90^\circ=\frac{\pi}{2}$\hfil$\displaystyle180^\circ=\pi$\hfil$\displaystyle360^\circ=2\pi$\hfil


Evaluating trigonometric functions of some of the common angles can be done using the $30^\circ-60^\circ-90^\circ$ and $45^\circ-45^\circ-90^\circ$ triangles:\footnote{Note that the side lengths of the $30^\circ-60^\circ-90^\circ$ triangle arise from bisecting one $60^\circ$ angle of an equilateral triangle of side length 2.  For the $45^\circ-45^\circ-90^\circ$ triangle the legs of the isosceles triangle are chosen to be length 1. The remaining sides in both cases, of length $\sqrt{3}$ and $\sqrt{2}$ respectively, can then be determined by the Pythagorean Theorem.}
\begin{center}
\resizebox{6.2cm}{!}{\input{basic_triangles.pspdftex}}
\end{center}
So, for instance,
$\sin60^\circ=\frac{opp}{hyp}=\frac{\sqrt{3}}{2}$.
Or, in radians,
$\sin\frac{\pi}{3}=\frac{\sqrt{3}}{2}$.
For angles of $0$ or
$90^\circ=\frac{\pi}{2}$ one should know $\cos(0)=1$, $\sin 0=0$,
$\cos\frac{\pi}{2}=0$, and $\sin{\frac{\pi}{2}}=1$.  These results may
be found by considering the unit circle points $(x,y)=(1,0)$ and $(x,y)=(0,1)$ on the terminal ray of angles $0$ and $\pi/2$ respectively on the previous quadrant diagram (so $r=1$, $\cos\theta=x$, $\sin\theta=y$).

Trigonometric functions evaluated in quadrants other than the first may be found by evaluating the trigonometric function of the \textbf{reference angle} (the positive acute angle made between the terminal ray of the angle in question and the $x$-axis) multiplied by the appropriate sign of the trigonometric function for the given quadrant.  So, for instance, to evaluate $\cos(5\pi/6)$ we note the angle $\theta=5\pi/6=150^\circ$ is in the second quadrant and has reference angle\[\theta'=\pi-5\pi/6=\pi/6=30^\circ\,,\]
as shown on the next diagram.
\begin{center}
\parbox[t]{2.7in}{\vspace{0em}{\resizebox{2.7in}{!}{\input{obtusetrigevaluation.pspdftex}}}}
\end{center}
Since cosine is negative in the second quadrant we have
\[\cos(5\pi/6)=-\cos(\pi/6)=-\frac{\sqrt{3}}{2}\,.\]

\textbook{\clearpage}

\begin{exercise}
\input{EQUATIONS_AND_FUNCTIONS/evaluating-trigonometric-functions}
\end{exercise}

Graphs of the basic trig functions with $x$ in radians are as follows:
\begin{center}
\begin{asy}
import graph;
size(300,0);
real f(real x) {return sin(x);}
pair F(real x) {return (x,f(x));}
// We trick asymptote by using the minor ticks so no labels are created.
xaxis("$x$",Ticks(Label(fontsize(10)),new real[]{},ticks=new real[]{-6.28,-4.71,-3.14,-1.57,1.57,3.14,4.71,6.28},size=3),Arrow(HookHead,size=4));
yaxis(shift(-8,-7)*Label("$y$",align=N),-2,2,Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Step=1,Label(fontsize(10)),OmitFormat(0),OmitTick(-2,2)));
draw(graph(f,-7,7,operator ..),red+2);
label("$f(x)=\sin\,x$",(7,1),NW);
labelx(1.57,L=Label("$\frac{\pi}{2}$",fontsize(10)),S);
labelx(3.14,L=Label("$\pi$",fontsize(10)),S);
labelx(4.71,L=Label("$\frac{3\pi}{2}$",fontsize(10)),S);
labelx(6.28,L=Label("$2\pi$",fontsize(10)),S);
labelx(-1.57,L=Label("$-\frac{\pi}{2}$",fontsize(10)),S);
labelx(-3.14,L=Label("$-\pi$",fontsize(10)),S);
labelx(-4.71,L=Label("$-\frac{3\pi}{2}$",fontsize(10)),S);
labelx(-6.28,L=Label("$-2\pi$",fontsize(10)),S);
\end{asy}

\begin{asy}
import graph;
size(300,0);
real f(real x) {return cos(x);}
pair F(real x) {return (x,f(x));}
// We trick asymptote by using the minor ticks so no labels are created.
xaxis("$x$",Ticks(Label(fontsize(10)),new real[]{},ticks=new real[]{-6.28,-4.71,-3.14,-1.57,1.57,3.14,4.71,6.28},size=3),Arrow(HookHead,size=4));
yaxis(shift(-8,-7)*Label("$y$",align=N),-2,2,Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Step=1,Label(fontsize(10)),OmitFormat(0),OmitTick(-2,2)));
draw(graph(f,-7,7,operator ..),red+2);
label("$f(x)=\cos\,x$",(7,1),NW);
labelx(1.57,L=Label("$\frac{\pi}{2}$",fontsize(10)),S);
labelx(3.14,L=Label("$\pi$",fontsize(10)),S);
labelx(4.71,L=Label("$\frac{3\pi}{2}$",fontsize(10)),S);
labelx(6.28,L=Label("$2\pi$",fontsize(10)),S);
labelx(-1.57,L=Label("$-\frac{\pi}{2}$",fontsize(10)),S);
labelx(-3.14,L=Label("$-\pi$",fontsize(10)),S);
labelx(-4.71,L=Label("$-\frac{3\pi}{2}$",fontsize(10)),S);
labelx(-6.28,L=Label("$-2\pi$",fontsize(10)),S);
\end{asy}

\begin{asy}
import graph;
size(300,0);
real f(real x) {return tan(x);}
pair F(real x) {return (x,f(x));}
// We trick asymptote by using the minor ticks so no labels are created.
xaxis("$x$",-7,7,Ticks(Label(fontsize(10)),new real[]{},ticks=new real[]{-6.28,-4.71,-3.14,-1.57,1.57,3.14,4.71,6.28},size=3),Arrow(HookHead,size=4));
yaxis(shift(-8,-7)*Label("$y$",align=N),-3,3,Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Step=1,Label(fontsize(10)),OmitFormat(0),OmitTick(-3,3)));
draw(graph(f,-1.2,1.2,operator ..),red+2);
draw(graph(f,1.94,4.34,operator ..),red+2);
draw(graph(f,5.08,7,operator ..),red+2);
draw(graph(f,-1.2,1.2,operator ..),red+2);
draw(graph(f,-4.34,-1.94,operator ..),red+2);
draw(graph(f,-7,-5.08,operator ..),red+2);
label("$f(x)=\tan\,x$",(4.7,1.5),E);
xequals(1.57,ymin=0,ymax=2.5,dashed);
xequals(4.71,ymin=0,ymax=2.5,dashed);
xequals(-1.57,ymin=0,ymax=2.5,dashed);
xequals(-4.71,ymin=0,ymax=2.5,dashed);
xequals(1.57,ymin=-2.5,ymax=-.85,dashed);
xequals(4.71,ymin=-2.5,ymax=-.85,dashed);
xequals(-1.57,ymin=-2.5,ymax=-.85,dashed);
xequals(-4.71,ymin=-2.5,ymax=-.85,dashed);
labelx(1.57,L=Label("$\frac{\pi}{2}$",fontsize(10)),S);
labelx(3.14,L=Label("$\pi$",fontsize(10)),S);
labelx(4.71,L=Label("$\frac{3\pi}{2}$",fontsize(10)),S);
labelx(6.28,L=Label("$2\pi$",fontsize(10)),S);
labelx(-1.57,L=Label("$-\frac{\pi}{2}$",fontsize(10)),S);
labelx(-3.14,L=Label("$-\pi$",fontsize(10)),S);
labelx(-4.71,L=Label("$-\frac{3\pi}{2}$",fontsize(10)),S);
labelx(-6.28,L=Label("$-2\pi$",fontsize(10)),S);
\end{asy}
\end{center}
The graphs of the reciprocal trig functions ($\csc$, $\sec$, $\cot$) will \emph{blow up} at any value where the corresponding trig function ($\sin$, $\cos$, $\tan$) is zero.
\end{description}

\textbook{\clearpage}
\subsection*{Trigonometric Identities}
Just like we saw algebraic identities, there are basic trigonometric identities which are true for all angles:\footnote{Note that the various trigonometric identities on this page follow readily from the three basic identities which should be memorized:
\begin{enumerate}
\item\label{itm:pyth} $\sin^2\!x+\cos^2\!x=1$
\item\label{itm:sadd} $\sin(x\pm y)=\sin x\cos y\pm\cos x\sin y$
\item\label{itm:cadd} $\cos(x\pm y)=\cos x\cos y\mp\sin x\sin y$
\end{enumerate}
Dividing \ref*{itm:pyth}. by $\cos^2\!x$ gives the Pythagorean identity involving tangent and secant, while dividing \ref*{itm:pyth}. by $\sin^2\!x$ gives the identity involving cotangent and cosecant.  The Symmetry Relations can be obtained by setting $x=0$ in the subtraction versions of \ref*{itm:sadd}. and \ref*{itm:cadd}.  The Periodicity results follow from setting $y=2\pi$ in \ref*{itm:sadd}. and \ref*{itm:cadd}. and evaluating the trigonometric functions at $2\pi$.  The Double Angle Formulae follow by setting $y=x$ in the addition versions of \ref*{itm:sadd}. and \ref*{itm:cadd}.  The final identities then follow from the Double Angle Formulae as mentioned above.}

\begin{method}
Pythagorean Relations:

\hfil$\displaystyle\sin^2\!\theta+\cos^2\!\theta=1$\hfil
$\displaystyle\tan^2\!\theta+1=\sec^2\!\theta$\hfil
$\displaystyle1+\cot^2\!\theta=\csc^2\!\theta$\hfil

Symmetry Relations:

\hfil$\displaystyle\sin(-\theta)=-\sin(\theta)$\hfil$\displaystyle\cos(-\theta)=\cos(\theta)$\hfil 

Periodicity:

\hfil$\displaystyle\sin(\theta+2\pi)=\sin \theta$\hfil$\displaystyle\cos(\theta+2\pi)=\cos \theta$\hfil

Addition and Subtraction Formulae:

$\displaystyle\sin(x+y)=\sin x\cos y+\cos x\sin y$

$\displaystyle\sin(x-y)=\sin x\cos y-\cos x\sin y$

$\displaystyle\cos(x+y)=\cos x\cos y-\sin x\sin y$

$\displaystyle\cos(x-y)=\cos x\cos y+\sin x\sin y$

Double Angle Formulae:

$\displaystyle \sin2x=2\sin x\cos x$

$\displaystyle \cos2x=\cos^2\!x-\sin^2\!x=2\cos^2\!x-1=1-2\sin^2\!x$


From the last it follows that:

\hfil$\displaystyle\cos^2\!x=\frac{1+\cos 2x}{2}$\hfil$\displaystyle\sin^2\!x=\frac{1-\cos2x}{2}$\hfil
\end{method}

Note in the above identities that the notation $\sin^2\!x$ means $(\sin x)^2$, etc.  That is we take the sine of $x$ first and then square that result.

From these identities other identities can be proven.

\begin{example}
Prove the following identities:
\begin{enumerate}
\textbook{\begin{multicols}{3}}
\item $\displaystyle 1+\sin 2\theta=(\sin \theta+\cos \theta)^2$
\item $\displaystyle \frac{\sin x}{\cot x}=\sec x-\cos x$
\item $\displaystyle \tan^2\theta\sin^2\theta=\tan^2\theta-\sin^2\theta$
\textbook{\end{multicols}}
\end{enumerate}
\end{example}

Ultimately the usefulness of trigonometric identities, as with the factoring identities, is to simplify expressions, often to aid in the solution of trigonometric equations.  See the review in Appendix~\ref{ap:solvingtrigequations} on solving trigonometric equations.

\subsection[Function Composition]{Composition of Functions}
\label{subsec:functioncomposition}
Given two functions $f$ and $g$ the \textbf{composite function}, denoted $f\circ g$, is defined by:
\[f\circ g(x)=f(g(x))\]
i.e. We replace the $x$ in $f(x)$ by $g(x)$.

The new function $f\circ g$ is defined wherever both $g(x)$ and $f(g(x))$ are defined.

\begin{example}
Let $f(x)=x^2+x-5$, $g(x)=2x+1$\ .  Find the composite functions $f\circ g$ and $g\circ f$ and their domains.
\end{example}

\begin{example}
Let $\displaystyle h(z)=\frac{z^2-2z}{z^3+8}$, $g(z)=z+1$\ .  Find $h\circ g$ and its domain.
\end{example}

Recognizing function composition can help solve equations.  For instance, to solve
\[y^{10}+y^5-6=0\]
we notice that the expression on the left hand side is a function composition as we can rewrite the equation
\[(y^{5})^2+(y^5)-6=0\,.\]
If we let $x=y^5$ we can first solve $x^2+x-6=0$ to get $x=-3$ or $x=2$ and then next solve $y^5=-3$ or $y^5=2$ to get the final solutions $y=\sqrt[5]{-3}=-\sqrt[5]{3}$ or $y=\sqrt[5]{2}$\,.  In general, solving an equation where the expression involving the variables is a composition of two functions requires solving the equation involving the outer function first followed by solving the inner function equalling those solutions found.\footnote{This procedure further generalizes when one has a composition of more than two functions, like $f(g(h(z)))=0$\,.  Simply solve $f(x)=0$ to get solutions $x_i$.  Next solve $g(y)=x_i$ to get solutions $y_i$.  Then solve $h(z)=y_i$ to get solutions $z_i$.  These are the solutions to the original equation.}

\textbook{\clearpage}
\textbook{\addtoanswerkey{\clearpage}}
\begin{exercise}
\input{EQUATIONS_AND_FUNCTIONS/function-algebra}
\end{exercise}

\begin{reviewexercise}
\input{EQUATIONS_AND_FUNCTIONS/equations-and-functions-review}
\end{reviewexercise}
%
% TODO:
%
% Add more discussion on literal constants and how they allow manipulation
% to solve a problem once and for all.  Also basic rule is "Don't Panic".
% Just imagine what you would do with a number.
%
% Add diagrams showing intervals on number lines.  Closed circles show
% endpoint included, open otherwise.
%
% Add more on piecewise-defined functions
%
% Add comment with history blurb on cubic and quartic solutions existing.
%
