\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.

Other factoring problems may be solved by using 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.

Additional techniques beyond identities that are useful for finding solutions to polynomial equations are the \textbf{Rational Roots Test} coupled with \textbf{polynomial long 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}.

\begin{example}
  Solve the following equations:
  \begin{enumerate}
  \item $\displaystyle x^2 + 5x - 14 = 0$ ~~\text{(A \textbf{quadratic equation} with leading coefficient of $a=1$)}
  \item $\displaystyle 6x^2 + 13x + 5 = 0$ ~~\text{(A quadratic equation with leading coefficient of $a\neq 1$)}
  \item $\displaystyle 3x^2 + 2x = 2$
  \item $\displaystyle x^3 + 2x^2 - 8x = 0$ ~~\text{(A \textbf{cubic equation})}
  \item $\displaystyle x^3 - 8 = 0$
  \item $\displaystyle x^4 - 2x^3 + x^2 - 4 = 0$ ~~\text{(A \textbf{quartic equation})}
  \item $\displaystyle x^5 - 4x^3 + x^2 - 4 = 0$  ~~\text{(A \textbf{quintic equation})}
  \end{enumerate}
  \begin{solution*}
    \begin{enumerate}
    \item Two numbers that multiply to get $-14$ and add to get $5$ are $7$ and $-2$ so\\
      $\displaystyle x^2 + 5x -14 = 0 \implies (x+7)(x-2)=0 \implies (x+7)=0\ \text{or}\ (x-2)=0 \implies \begin{cases}x&=-7 \\ x&=~~2\end{cases}$
    \item Two numbers that multiply to get $(6)(5)=30$ and add to get $13$ are $3$, $10$. Then break the $13x=3x+10x$ and factor by grouping the first and last two terms:\\
      $\displaystyle 6x^2 + 13x + 5 = 0 \implies 6x^2+\underline{3x+10x}+5=0\implies \underline{6x^2+3x}+\underline{10x+5}=0\\[.5em] \implies 3x(2x+1)+5(2x+1)=0 \implies(3x+5)(2x+1)=0 \implies \begin{cases}x&=-\frac{5}{3} \\ x&=-\frac{1}{2}\end{cases}$
    \item First write equation with zero on one side ($3x^2+2x=2 \implies 3x^2+2x-2=0)$. Grouping as in last example will not work. Use the quadratic formula with $a=3$, $b=2$, $c=-2$~:\\[.5em]
      $\displaystyle 3x^2 + 2x - 2 = 0 \implies x=\frac{-2\pm\sqrt{4+24}}{6}=\frac{-2\pm\sqrt{(4)(7)}}{6} = \frac{-2\pm2\sqrt{7}}{6} = \frac{-1\pm\sqrt{7}}{3}$
    \item $\displaystyle x^3 + 2x^2 - 8x = 0 \implies x(x^2+2x-8) = 0 \implies x(x+4)(x-2)=0 \implies \begin{cases}x&=~~0\\x&=-4\\x&=~~2\end{cases}$
    \item Use cube minus cube formula: $\displaystyle x^3 - 8 = 0 \implies (x-2)(x^2+2x+4)=0 \\\implies \begin{cases}x&=2 \\ x^2+2x+4&=0 \implies x=\frac{-2\pm\sqrt{4-16}}{2} = \frac{-2\pm\sqrt{-12}}{2}\implies \text{No real roots}\end{cases}$\\[.5em]
      Thus $x=2$ is the only real solution.
    \item Try factoring quartic by grouping terms:
      $\displaystyle \underline{x^4 - 2x^3} + \underline{x^2 - 4} = 0 \implies x^3(x-2) + (x+2)(x-2)=0$ \\[.5em]
      A common factor of $(x-2)$ is found which we now pull out to get
      $(x-2)(x^3+x+2) = 0$\\
      Using observation or the \textbf{Rational Roots Test} shows $x=-1$
      makes the cubic zero so \mbox{$(x-(-1))=(x+1)$} is a factor of
      it.  Its remaining quadratic factor can be found by inspection
      by starting at the coefficient of the highest power ($x^2$) and
      working downward or by using \textbf{polynomial long division} to
      get $(x^3+x+2)=(x+1)(x^2-x+2)$ and hence the quartic resolves to
      $(x-2)(x+1)(x^2-x+2)=0 \\\implies \begin{cases}x&=~~2\\x&=-1\\x^2-x+2&=~~0 \implies x=\frac{1\pm\sqrt{1-8}}{2} = \frac{1\pm\sqrt{-7}}{2} \implies \text{No real roots}\end{cases}\implies\begin{cases}x&=~~2\\x&=-1\end{cases}$
    \item Use grouping $\displaystyle \underline{x^5 - 4x^3} + \underline{x^2 - 4} = 0 \implies x^3(x^2-4) + (x^2-4) = 0 \\[.5em] \implies (x^2-4)(x^3+1) = 0 \implies (x+2)(x-2)(x+1)(x^2-x+1)=0 \\ \implies \begin{cases}x&=-2\\x&=~~2\\x&=-1\\x^2-x+1&=0 \implies x=\frac{1\pm\sqrt{1-4}}{2} = \frac{1\pm\sqrt{-3}}{2}\implies \text{No real roots}\end{cases}\implies \begin{cases}x&=-2\\x&=~~2\\x&=-1\end{cases}$
\end{enumerate}
\end{solution*}

\begin{furtherquestions}
Solve the following equations:
\begin{enumerate}
  \begin{multicols}{2}
\item $\displaystyle x^2-5x+6=0$
\item $\displaystyle x^2-4x+4=0$
\item $\displaystyle 2x^2-4x+5=0$
\item $\displaystyle x^3-3x^2-4x=0$
\item $\displaystyle x^3-2x^2-3x+6=0$
\item $\displaystyle 6x^2-13x-5=0$
\item $\displaystyle x^5-4x^3=0$
\item $\displaystyle x^4+2x^3-x-2=0$
\item $\displaystyle x^3+2x^2-1=0$
\item $\displaystyle x^3+27=0$
  \end{multicols}
\end{enumerate}
\end{furtherquestions}
\end{example}

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

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 $\displaystyle f(x) = \frac{x^2+3}{x+5}$. Find $f(-1)$ and $f(2)$.
  
\begin{solution}
$\displaystyle f(-1) = \frac{(-1)^2 + 3}{(-1)+5} = \frac{1+3}{-1+5} = \frac{4}{4} = 1$~~~~~~~~~
$\displaystyle f(2) = \frac{2^2 + 3}{2+5} = \frac{4+3}{7} = \frac{7}{7} = 1$
\end{solution}

\begin{furtherquestion}
Let $f(x)=2x^2-3x+5$.  Find $f(3)$ and $f(-2)$.
\end{furtherquestion}
\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}
\includegraphics{graphics/equations_and_functions1}%
\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}

\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
\includegraphics{graphics/equations_and_functions2}%
\hfill
\includegraphics{graphics/equations_and_functions3}%
\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{enumerate}
    \item $\displaystyle f(x) = x^3 + 3x^2 + 5$
    \item $\displaystyle f(x) = \frac{x^2-3}{x^2+5x+6}$
    \item $\displaystyle g(t) = \sqrt{t+5}$
    \item $\displaystyle f(u) = \sqrt{u^2-4}$
    \item $\displaystyle g(t) = \sqrt{\frac{2t-3}{t+4}}$
    \end{enumerate}

\textbook{\clearpage}
\begin{solution*}
\begin{enumerate}
    \item Since $\displaystyle f(x) = x^3 + 3x^2 + 5$ is a sum of positive coefficients times positive integer powers of $x$ (i.e. a polynomial) it is defined for all values of $x$ $\implies D= \{x\in \mathset{R}\, | -\infty < x < \infty \}=(-\infty,\infty)$
    
    \item The function $\displaystyle f(x) = \frac{x^2-3}{x^2+5x+6}$ will not be defined if we divide by zero\\ $\implies x^2+5x+6=0\implies (x+3)(x+2)=0 \implies\begin{cases}x&=-3\\x&=-2\end{cases}$\\  The domain  is therefore $D=\{x\in \mathset{R} \, | x\neq-3~\text{and}~x\neq -2\} = (-\infty,-3)\cup(-3,-2)\cup(-2,\infty)$
    
    \item The even root in $\displaystyle g(t) = \sqrt{t+5}$ is defined if the argument is zero or positive (``non-negative'').\\ $t+5 \geq 0 \implies t \geq -5 \implies D=\{t\in \mathset{R}\, | t\geq -5\} = [-5,\infty)$
    
    \item $\displaystyle f(u) = \sqrt{u^2-4} \implies u^2-4 \geq 0 \implies
      (u+2)(u-2)\geq 0$\,.  The left hand side is zero if $u=-2$ or $u=2$.  It is positive if both factors are negative:\\
      $\implies u+2<0\ \text{and}\ u-2<0\implies u<-2\ \text{and}\ u<2\implies u<-2$\\
      or they are both positive:\\
      $\implies u+2>0\ \text{and}\ u-2>0\implies u>-2\ \text{and}\ u>2\implies u>2$\\
      Domain is therefore $D=\{ u\in \mathset{R} | u\leq -2 \, \text{or} \,
      u\geq 2\} = (-\infty,-2]\cup[2,\infty)$

    \item The denominator $t+4\neq0$ in $g(t) = \sqrt{\frac{2t-3}{t+4}}$ implies $t\neq-4$.\\[.5em]  And the argument of the square root must be non-negative, $\frac{2t-3}{t+4}\geq 0$\,.\\[.5em]  The fraction vanishes if the numerator is zero ($\implies 2t-3=0\implies t=3/2$).\\  To be positive its numerator and denominator must both be negative or both be positive:\\
      $\implies\begin{cases} 2t-3<0\ \text{and}\ t+4<0 \implies t<\frac{3}{2}\ \text{and}\ t<-4\implies t<-4 \\
        ~~~~\text{or}\\
        2t-3>0\ \text{and}\ t+4>0 \implies t>\frac{3}{2}\ \text{and}\ t>-4\implies t>\frac{3}{2} \end{cases}$\\[.5em]
      Domain is therefore $D=\left\{t\in \mathset{R} | t < -4\ \text{or}\ t \geq \frac{3}{2}\right\} = (-\infty,-4)\cup \left[\frac{3}{2}, \infty\right)$\,.
\end{enumerate}
\end{solution*}

\begin{furtherquestions}
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{furtherquestions}
\end{example}

\textbook{\clearpage}
\definition{Two functions $f$ and $g$ are \textbf{equal} if the have the same domain $D$ and $f(x)=g(x)$ for all $x$ in $D$\,.}

\begin{example}
  \begin{enumerate}
  \item $f(x)=\frac{1}{2}\sin 2x$ and $g(x)=\sin x\cos x$ are equal functions because they both have domain $D=\mathset{R}$ and $\sin 2x=2\sin x\cos x$ is a trigonometric identity so $f(x)=g(x)$ for all $x$\,.
  \item $f(x)=2x+2$ and $g(t)=2(t+1)$ are equal functions because they have the same domain ($\mathset{R}$) and $2(t+1)=2t+2$ is an algebraic identity.  Note that the choice of variable name used in the definition of the function ($x$ or $t$) is not relevant.
  \item $f(x)=\left(\sqrt{x}\right)^2$ and $g(x)=x$ are not equal since the domain of $f(x)$ is $[0,\infty)$ while that of $g(x)$ is $\mathset{R}$\,.
  \item $f(x)=1$ and $g(x)=\frac{x}{x}$ are not equal since the domain of $f(x)$ is $\mathset{R}$ and that of $g(x)$ is $\mathset{R}-\left\{0\right\}$\,.
  \end{enumerate}
\end{example}

\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}{!}{%
\includegraphics{graphics/equations_and_functions4}%
} 
\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 + 3x^2$
 \item $\displaystyle f(x) = x^3-2x^2+3$
 \item $\displaystyle f(x) = \frac{2x^2+3}{x^3-2x}$
 \end{enumerate}

 \begin{solution*}
   \begin{enumerate}
   \item $\displaystyle f(x) = x^4 + 3x^2 \implies f(0) = 0 \implies
     y\text{--intercept: } y=0 \\ f(x) = 0 \implies x^2(x^2+3)=0 \implies x=0\ \text{or}\ x^2=-3\ (\text{no solution})\implies x=0\\
     \implies x\text{--intercept: } x=0 \\ f(-x) = (-x)^4 + 3(-x)^2 = (-1)^4x^4+3(-1)^2x^2=x^4 + 3x^2=f(x)
     \implies f\ \text{is even}$
   \item $\displaystyle f(x) = x^3-2x^2+3 \implies f(0) = 3 \implies
     y\text{--intercept: } y=0$
     \begin{align*}
       f(x)=0 &\implies x^3-2x^2+3 = 0 \\
              &\implies x^3+x^2-3x^2+3=0 \\
              &\implies x^2(x+1)-3(x^2-1)=0 \\
              &\implies x^2(x+1) - 3(x+1)(x-1)=0\\
              &\implies (x+1)(x^2-3x+3)=0 \\
             &\implies \begin{cases}x=-1\\x^2-3x+3=0\implies
               x=\frac{3\pm\sqrt{9-12}}{2} = \frac{3\pm\sqrt{-3}}{2} \implies \text{No real roots}\end{cases}      
     \end{align*}\hfill*
     Therefore $x$--intercept: $x=-1$ \\[.5em]
     $f(-x)= (-x)^3 - 2(-x)^2+3 = (-1)^3x^3-2(-1)^2x^2+3=-x^3-2x^2+3 = -(x^3+2x^2-3)$\\
     So $f$ is neither even nor odd.
   \item $\displaystyle f(x) = \frac{2x^2+3}{x^3-2x} \implies f(0) = \frac{3}{0}
     \implies f \text{ is undefined at } 0 \implies \text{No }y\text{--intercept} \\ f(x)
     = 0 \implies 2x^2+3 = 0 \implies x^2=-3/2 \implies \text{No solution}\implies \text{No } x\text{--intercepts}\\ f(-x) = \frac{2(-x)^2+3}{(-x)^3-2(-x)} =
     \frac{2x^2+3}{-x^3+2x} =  \frac{2x^2+3}{(-1)(x^3-2x)} = -\frac{2x^2+3}{x^3-2x} = -f(x) \implies f\text{ is odd}$
   \end{enumerate}
 \end{solution*}

\begin{furtherquestions}
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{furtherquestions}
\end{example}

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}{!}{%
\includegraphics{graphics/equations_and_functions5}%
}
\hfill
\resizebox{.28\textwidth}{!}{%
\includegraphics{graphics/equations_and_functions6}%
}
\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. 

\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}
\includegraphics{graphics/equations_and_functions7}%
\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}{!}{%
\includegraphics{graphics/equations_and_functions8}%
}

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

\subsubsection*{$y=g(x)=f(x-a)$:}
\begin{center}
\resizebox{.40\textwidth}{!}{%
\includegraphics{graphics/equations_and_functions9}%
}

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{.35\textwidth}{!}{%
\includegraphics{graphics/equations_and_functions10}%
}

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

\subsubsection*{$y=g(x)=f(x)+a$:}
\begin{center}
\resizebox{.30\textwidth}{!}{%
\includegraphics{graphics/equations_and_functions11}%
}

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

\end{multicols}

\textbook{\clearpage}
\begin{example}
  Graphs of the parabola $y=x^2-2x$ and functions related to it by
  reflection and translation are shown below.
\begin{center}
  \textbf{Original Function}\\[1em]
  \resizebox{.35\textwidth}{!}{%
    \includegraphics{graphics/equations_and_functions21}%
  }\\[1em]
  \textbf{Reflections about the $\bm{x}$-axis and $\bm{y}$-axis}\\[1em]
  \hfil\resizebox{.35\textwidth}{!}{%
    \includegraphics{graphics/equations_and_functions22}%
  }\hfil
  \resizebox{.35\textwidth}{!}{%
    \includegraphics{graphics/equations_and_functions23}%
  }\hfil\\[1em]
  \textbf{Translations horizontally and vertically by 1}\\[1em]
  \hfil\resizebox{.35\textwidth}{!}{%
    \includegraphics{graphics/equations_and_functions24}%
  }\hfil
  \resizebox{.35\textwidth}{!}{%
    \includegraphics{graphics/equations_and_functions25}%
  }\hfil
\end{center}
\end{example}

\textbook{\clearpage}%Needed to have correct label position
\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}$~~~~~~~~~~

\includegraphics{graphics/equations_and_functions12}%
\hfill
\includegraphics{graphics/equations_and_functions13}%
\hfill
\includegraphics{graphics/equations_and_functions14}%
\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}
\includegraphics{graphics/equations_and_functions15}%
\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 \textbook{(over$\Rightarrow$)} 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}
\includegraphics{graphics/equations_and_functions16}%
\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}
\includegraphics{graphics/equations_and_functions17}%
\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}{!}{\includegraphics{graphics/similar_triangles}}}}
\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]{graphics/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}{!}{\includegraphics{graphics/trigsigns}}}}
\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}{!}{\includegraphics{graphics/radians}}}}
\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}{!}{\includegraphics{graphics/basic_triangles}}
\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}{!}{\includegraphics{graphics/obtusetrigevaluation}}}}
\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}% Required for correct page reference.
\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}
\includegraphics{graphics/equations_and_functions18}%

\includegraphics{graphics/equations_and_functions19}%

\includegraphics{graphics/equations_and_functions20}%
\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.

\textbook{\clearpage}
\begin{example}
  Prove the identity.\\[.5em]
  $\displaystyle -\sin x=\frac{\cos x}{\tan x}-\csc x$
  
  \begin{solution}
    Start by working on the more complicated side and apply identities to try to arrive at the simpler side.
    
    $\displaystyle\frac{\cos x}{\tan x}-\csc x=\frac{\cos x}{\frac{\sin x}{\cos x}}-\frac{1}{\sin x}=\cos x\cdot\frac{\cos x}{\sin x}-\frac{1}{\sin x}=\frac{\cos^2x-1}{\sin x}=\frac{-\sin^2\!x}{\sin x}=-\sin x$

    Note that this identity is technically only true where both sides of it are actually defined since $-\sin x$ is defined for all $x$ while the right hand side will be undefined wherever $\tan x$ is zero or $\tan x$ or $\csc x$ are undefined.
  \end{solution}


\begin{furtherquestions}
Prove the following identities:
\begin{enumerate}
\textbook{\begin{multicols}{3}}
\item $\textbook{\rule{0em}{1.3em}}\displaystyle 1+\sin 2\theta=(\sin \theta+\cos \theta)^2$
\item $\displaystyle\frac{\sin x}{\cot x}=\sec x-\cos x$
\item $\textbook{\rule{0em}{1.3em}}\displaystyle \tan^2\theta\sin^2\theta=\tan^2\theta-\sin^2\theta$
\textbook{\end{multicols}}
\end{enumerate}
\end{furtherquestions}
\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}
   For the following pairs of functions find $f\circ g$ and $g\circ f$ and the domains of the function compositions.
   \begin{enumerate}
  \item $f(x) = x^2+3x \, , \, g(x) = \sqrt{x+2}$ 
    
    \begin{solution}
      $f\circ g(x) = f(g(x)) = f\left(\sqrt{x+2}\right)=\left(\sqrt{x+2}\right)^2+3(\sqrt{x+2})=x+2+3\sqrt{x+2}$\\[.5em]
    Domain $f\circ g$: $x+2\ge 0\implies x\ge -2\implies D=[-2,\infty)$\\[1em]
    $g\circ f(x)=g(f(x)) = g\left(x^2+3x\right)=\sqrt{(x^2+3x)+2}=\sqrt{x^2+3x+2}$\\[.5em]
    Domain $g\circ f$: $x^2+3x+2\geq 0 \implies (x+1)(x+2)\geq 0\\[.5em]
    \implies\begin{cases}x\le-1\ &\text{and}\ x\le{-2} \\ &~\text{or} \\ x\ge-1\ &\text{and}\ x\ge-2\end{cases}
     \implies\begin{cases} x&\le-2\\ &\text{or} \\ x&\ge-1 \end{cases}
     \implies D=(-\infty,-2]\cup[-1,\infty)$
  \end{solution}

\item $\displaystyle f(x) = \frac{x+3}{x-1} \, , \, g(x)=\frac{1}{x}$
  
  \begin{solution}
    $\displaystyle f\circ g(x) = f(g(x)) = f\left(\frac{1}{x}\right)=\frac{\left(\frac{1}{x}\right)+3}{\left(\frac{1}{x}\right)-1}=\frac{\frac{1}{x}+3}{\frac{1}{x}-1}\cdot\frac{x}{x}
    =\frac{1+3x}{1-x}\ \ (\text{if }x\neq 0)$\\[.5em]
    Domain $f\circ g$: $x\neq0$ and $1-x\neq0$ $\implies$ $x\neq0$ and $x\neq1$ $\implies D=\mathset{R} - \{0,1\}$ \\[1em]
    $\displaystyle g\circ f(x) = g(f(x)) = g\left(\frac{x+3}{x-1}\right)=\frac{1}{\left(\frac{x+3}{x-1}\right)} = \frac{x-1}{x+3}\ \ (\text{if }x\neq 1)$\\[.5em]
    Domain: $g\circ f$: $x\neq 1$ and $x+3\neq 0$ $\implies$ $x\neq 1$ and $x\neq-3$ $\implies D=\mathset{R}- \{-3,1\}$ 
  \end{solution}
  \end{enumerate}

  \begin{furtherquestions}
    For the following pairs of functions find $f\circ g$ and $g\circ f$ and the domains of the function compositions.
    \begin{enumerate}
    \item $f(x)=x^2+x-5$\,,\, $g(x)=2x+1$
    \item $\displaystyle f(x)=\frac{x^2-2x}{x^3+8}$\,,\, $g(x)=x+1$
    \end{enumerate}
  \end{furtherquestions}
\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 an appendix about Cartesian Coordinates.  Talk about plotting points.  Also
% could talk about more interesting topic of plotting relations which
% requires solving equations.  Can talk about using plotting to solve
% equations approximately.  Perhaps mention plotting special functions
% like a line or parabola.
%
% Add a further example to reflection/translation example.
%
% For odd and even functions add functions involving trig functions
% and also t^{3}{2} somewhere.  (We have t^{2}{3} in review).
% 
% 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.
%
% Symmetry of functions could add periodic f(x+p)=f(x) discussion.
% Though is it really considered a symmetry?   It is mentioned in curve
% sketching.
%
% The text example for intercepts and symmetry don't align with the
% assignment.
%
% Add a domain example like 1/\sqrt{x^2+6x+10}=1/\sqrt{(x+3)^2+1}
% requiring completing the square or finding of imaginary roots with
% quadratic formula.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:
