\documentclass[12pt]{article}

\usepackage[margin=1in]{}
\usepackage{amsmath,amsthm,amssymb,graphicx,geometry,mathtools,tikz,hyperref,outlines,sectsty}

\sectionfont{\fontsize{15}{18}\selectfont}
\subsectionfont{\fontsize{12}{15}\selectfont}

\usetikzlibrary{positioning}

\renewcommand{\d}[1]{\ensuremath{\operatorname{d}\!{#1}}}
\newcommand{\n}{\mathbb{N}}
\newcommand{\z}{\mathbb{Z}}
\newcommand{\q}{\mathbb{Q}}
\newcommand{\cx}{\mathbb{C}}
\newcommand{\real}{\mathbb{R}}
\newcommand{\field}{\mathbb{F}}
\newcommand{\ita}[1]{\textit{#1}}
\newcommand{\com}[2]{#1\backslash#2}
\newcommand{\oneton}{\{1,2,3,...,n\}}
\newcommand\idea[1]{\begin{gather*}#1\end{gather*}}
\newcommand\ef{\ita{f} }
\newcommand\eff{\ita{f}}
\newcommand\proofs[1]{\begin{proof}#1\end{proof}}
\newcommand\inv[1]{#1^{-1}}
\newcommand\setb[1]{\{#1\}}
\newcommand\en{\ita{n }}
\newcommand{\vbrack}[1]{\langle #1\rangle}
\newcommand\Inn{\mathrel{\ooalign{$\subset$\cr\hfil\scalebox{0.8}[1]{$=$}\hfil\cr}}}

\def\Plus{\texttt{+}}
\def\Minus{\texttt{-}}

\hypersetup{
    urlcolor=blue,
}

\newenvironment{theorem}[2][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{lemma}[2][Lemma]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{exercise}[2][Exercise]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{reflection}[2][Reflection]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{proposition}[2][Proposition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{corollary}[2][Corollary]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
 \hypersetup{
 colorlinks,
 linkcolor=blue
 }
\begin{document}

\title{Calculus 1-2 Notes}
\author{VOGEL, Max}
\date{UW-Madison Summer 2020, MATC Fall 2020}

% https://tex.stackexchange.com/questions/186981/is-there-a-subsection-command
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}

\maketitle
\tableofcontents
\newpage

\section{Factoring:}
$$(a+b)(a^2-ab+b^2)=a^3+b^3 $$
$$(a-b)(a^2+ab+b^2)=a^3-b^3 $$

\section{Rules:}
\begin{minipage}{0.45\textwidth}
$$ a < b \rightarrow{} -a > -b $$
$$ -ax < b \rightarrow{} x > -\frac{b}{a} $$
$$ |x| = b \rightarrow{} x = b \vee x = -b $$
$$ |x| < b \rightarrow{} -b < x < b $$
$$ |x| = b \rightarrow{} x > b \vee x < -b $$
$$ a^m a^n = a^{m+n} $$
$$ \frac{a^m}{a^n} = a^{m-n}$$
$$ (ab)^m=a^m b^m$$
\hfill
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}
$$ \left(\frac{a}{b}\right)^n = \frac{a^n}{b^n}$$
$$ (a^m)^n = a^{mn}$$
$$ \sqrt{a} = a^{\frac{1}{2}}$$
$$ \sqrt[n]{a} = a^{\frac{1}{n}}$$
$$ \left(\sqrt[n]{a}\right)^m = \sqrt[n]{a^m} = a^{\frac{m}{n}}$$
$$ \sqrt{a}\sqrt{b} = \sqrt{ab}$$
$$ \sqrt[n]{a} \sqrt[n]{b} = \sqrt[n]{ab}$$\\
\end{tabular}
\end{minipage}

\section{Functions:}

\textbf{Definition: }
Assigns each element $x$ in a set $D$ exactly one element, called $f(x)$, in set $E$.\\
In terms of a graph, a curve can only be a function if no vertical lines intersect the curve more than once (vertical line test).
\begin{itemize}
    \item The set $D$ is called the domain -- possible $x$ values.
    \item The set $E$ is called the range -- possible $y$ values.
    \item If $f$ is a function with domain $D$, then it graph is the set of ordered pairs\\
    $ \{(x, f(x) | x) \text{ is a element of, } \in{}, D\}$
\end{itemize}
\subsection{Finding domain:}
\begin{enumerate}
    \item $f(x) = \sqrt{x+2}$
    $\rightarrow{} x + 2 \geq{} 0$
    $\rightarrow{} x \geq{} -2 $
    $\rightarrow{} [-2, +\infty)$

    \item $f(x) = \frac{1}{x^2-x} $
    $\rightarrow{} x^2-x \neq{} 0 $
    $\rightarrow{} x(x-1) \neq{} 0 $
    $\rightarrow{} x \neq{} 0 \wedge x \neq 1 $
    $\rightarrow{} (-\infty, 0) \cup (0, 1) \cup (1, +\infty)$
\end{enumerate}

\subsection{Picewise:}
\begin{itemize}
    \item Open circles, $\circ$, and circle brackets, ( ), are non-inclusive.
    \item Closed circles, $\bullet$, and square brackets, [ ], are inclusive.
    \item Formatted as:
    \item[] $f(x)=\begin{cases}
              y=5   : x < 0 \\
              y=x^2 : x\geq 0
            \end{cases}$
\end{itemize}

\subsection{Types}
\begin{itemize}
    \item[] \textbf{Even: }
    \item A function is even if $f(x) = f(-x)$
    \item The graph is symmetric with respect to the y-axis.
    \item Examples: $x^4 - 2, x^{20}+x^6, \cos(x), |x|$

\end{itemize}

\begin{itemize}
    \item[] \textbf{Odd: }
    \item A function is even if $f(x) = -f(x)$
    \item The graph has rotational symmetry about origin.
    \item Examples: $x^3, x^{7}+x, \sin(x), |x|x$
\end{itemize}

\noindent\hrulefill

\begin{itemize}
    \item[-] Even times odd function is always odd.
    \item[-] Even times even is always even.
    \item[-] Odd times odd is always even.
\end{itemize}

\subsection{Increasing \& Decreasing:}
\begin{itemize}
\item \textbf{Increasing :} A  function $f$ is called increasing on an interval if $f(x_1) < f(x_2)$ whenever $x_1 < x_2$. In other words, the slope must always be positive.
\item \textbf{Decreasing :} A  function $f$ is called increasing on an interval if $f(x_1) > f(x_2)$ whenever $x_1 < x_2$. In other words, the slope must always be negative.
\end{itemize}

\section{Limits}

\textbf{Definition: } Supposing $f(x)$ is defined when $x$ is near the number $a$, we write $\lim_{x\to a} f(x) = L$ and say ``the limit of $f(x)$, as $x$ approaches $a$, equals $L$''.

\begin{itemize}
    \item $\lim_{x\to a} f(x) = L$ if and only if (iff, $\iff$) $\lim_{x\to a^-} f(x) = L \wedge \lim_{x\to a^+} f(x) = L$
    \item That is, the limit does not exist, $\nexists$, if $x$ approaches different values when from the left and right sides
    \item Approaching from left (from $-\infty \to \infty$) is notated as $x \to a^-$
    \item Approaching from right (from $\infty \to -\infty$)) is notated as $x \to a^+$
    \item iff, $\iff$:
        $$A \iff B \rightarrow{}$$
        $$A \text{ is necessary and sufficient for B }\rightarrow{}$$
        $$B \text{ is necessary and sufficient for A } \rightarrow{}$$
        $$A \text{ is equivalent to } B$$
    \item A vertical asymptote exists if the limit from left side is $+\infty$ or $-\infty$, and the limit from the right side is the opposite.
\end{itemize}

\subsection{Infinite Limits}
\begin{itemize}
    \item If function limit is $\pm \infty$ (if the denominator is 0 at $f(a)$), you can find whether its $\Plus{}$ or $\Minus{}$ by solving the limit for each term. If the term is positive, then it's $+ \infty$, and vice-versa, e.g.

    $$\lim_{x \to -2^+} \frac{x-1}{x^2(x+2)}$$
    $$\frac{\lim_{x \to -2^+} [x-1]}{ (\lim_{x \to -2^+} [x])^2 \cdot \lim_{x \to -2^+} [(x+2)]}$$
    $$\frac{\ominus}{\oplus \cdot \oplus}$$
    $$\ominus \rightarrow{} -\infty$$

\end{itemize}

\section{Lines}
\begin{itemize}
    \item Slope-Point form: $y-b = m(x+a)$ -- $(a,b)$ will be a point of the equation.
    \item Slope-Intercept form: $y = mx + b$ -- $(0,b)$ will be the $y$-intercept.
    \item Vertex form: $y = a(x-h)+k$ -- $(h,k)$ will be the vertex.
    \item Point-Point form: $y-y_1=\frac{y_2-y_1}{x_2-x_1}(x-x_1)$ -- $(x_1,y_1)$ and $(x_2,y_2)$ will be points of the equation.
    \item Intercept form:  $\frac{x}{a} + \frac{y}{b} = 1$  -- $(a, b)$ will be a point of the equation.

\end{itemize}

\section{Limit Laws:}
Supposing $c$ is a constant and $\lim_{x \to a}f(x)$ and $\lim_{x \to a}g(x)$ exists, then\\
\begin{minipage}{0.5\textwidth}
    $$\lim_{x \to a} [f(x) \pm g(x)] = \lim_{x \to a} f(x) \pm \lim_{x \to a} g(x)$$
    $$\lim_{x \to a} [cf(x)] = c \cdot \lim_{x \to a} f(x)$$
    $$\lim_{x \to a} [f(x)g(x)] = \lim_{x \to a} f(x) \lim_{x \to a} g(x)$$
    $$\lim_{x \to a} \left [ \frac{f(x)}{g(x)} \right ] = \frac{\lim f(x)}{\lim g(x)} \text{ if } \lim_{x \to a} g(x) \neq{} 0$$
    $$\lim_{x \to a} [f(x)]^n = [\lim_{x \to a} f(x)]^n$$

\hfill
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}
$$\lim_{x \to a} c = c$$
$$\lim_{x \to a} x = a$$
$$\lim_{x \to a} x^n = a^n \text{ where } n = \mathbb{Z}^+$$
$$\lim_{x \to a} \sqrt[n]{x} = \sqrt[n]{a} \text{ where } n = \mathbb{Z}^+$$
$$\lim_{x \to a} \sqrt[n]{f(x)} = \sqrt[n]{f(a)} \text{ if } f(a) \geq 0 \text{ and } n_{even}$$
\end{tabular}
\end{minipage}

\noindent\textbf{Direct Substitution Property:} If $f$ is a polynomial or rational function, and $a$ is in the domain of $f$, then $\lim_{x \to a} f(x) = f(a)$\\
\textbf{Theorem 1.6.1:} If $f(x) = g(x)$ when $x \neq a$, then $\lim_{x\to a} f(x) = \lim_{x\to a} g(x)$ \\
\textbf{Theorem 1.5.1:} If $f(x) = L \iff \lim_{x\to a^-} f(x) = L = \lim_{x\to a^+} f(x)$\\
\textbf{Theorem 1.6.2:} If $f(x) \leq g(x)$ when $x$ is near $a$ and the limits of $f$ and $g$ both exist as $x$ approaches $a$, then $\lim_{x\to a} f(x) \leq \lim_{x\to a} g(x)$\\
\textbf{Squeeze Theorem:} If $f(x) \leq g(x) \leq h(x)$ when $x$ is near $a$ and
 $\lim_{x\to a} f(x) =  \lim_{x\to a} h(x) = L$, then $\lim_{x\to a} g(x) = L$

\section{Piecewise / $(\epsilon, \delta)$ definition  of limit}
If for every small number $\epsilon >  0$ there is a number $\delta > 0$ such that if $0 < |x-c| < \delta$ then $|f(x) - L| < \epsilon$.

$$\includegraphics[width=0.5\textwidth]{media/limit01.png}$$

\noindent Solving for $\delta$, rewrite the term defining $\epsilon$ to be equal to the term defining $\delta$. E.g., solving for $\delta$ if $|x-2|<\delta$, then $|4x-8|<\epsilon$, where $\epsilon = 0.1$:

$$|4x-8|=4|x-2|<0.1$$
$$|x-2| < \frac{0.1}{4}\text{, therefore } \delta=\frac{0.1}{4}$$

\noindent For non-linear equations, find the lesser and greater $\delta$, and choose the one that results in the smaller $\epsilon$.

\section{Continuous Function:}
\textbf{Definition:} A function $f$ is continuous at  a number if $\lim_{x\to a} f(x) = f(a)$. Graphically, a function is continuous if you can draw it without having your pen leave paper. More formally, $f(x)$ is continuous at $x=a \iff:$

\begin{enumerate}
    \item $f(a)$ is defined ($a \in{} D: $ $a$ is in the domain of $f$).
    \item $\lim_{x\to a} f(x)$ exists, and equals $f(x) = f(a)$.
\end{enumerate}

If one of the aforementioned statements is incorrect, then $f(x)$ is discontinuous at $x=a$

\textbf{Theorem 1:} A function is continuous on an interval if it's continuous at every number in the interval. That is, if $f$ and $g$ are continuous at $x=a$, then the following are also continuous at $a$:\\
$$f+g, f-g, cf, fg, \frac{f}{g} \text{ for } g(a) \neq{} 0$$

\textbf{Theorem 2:} The following types of functions are continuous at every number in there domain: Polynomials, Rational functions, Root functions, \& Trig functions.\\

\textbf{Theorem 3: Intermediate Value Theorem (IVM):} Suppose that $f$ is continuous on the close interval $[a,b]$ and let $N$ be any number between $f(a)$ and $f(b)$, where $f(a) \neq{} f(b)$. Then there exists at least on number $c$ in $(a,b)$ such that $f(c)=N$.

$$\includegraphics[width=0.5\textwidth]{media/ivm.png}$$

\section{Lines:}
\subsection{Secant Line:} A line that locally intersects two points on a curve.

$$\frac{\text{Rise}}{\text{Run}} = \frac{\Delta y}{\Delta x} = \frac{y_1 - y_0}{x_1 - x_0} =  \frac{f(a+h)-f(a)}{(a+h)-a}=\frac{f(a+h)-f(a)}{h}$$

$$\includegraphics[width=0.65\textwidth]{media/secanteq.jpg}$$

\subsection{Tangent Line:} The line through a pair of infinitely close points on the curve so that the line is ``just touching''. Slope equation (also known as ``Difference Quotient''):

$$\lim_{h \to 0} \left [ \frac{f(a+h)-f(a)}{h} \right ]$$

\section{Derivatives:} The derivative of a function $f$ at a number $a$, denoted by $f'(a)$, is

$$f'(a) = \lim_{h \to 0} \left [ \frac{f(a+h)-f(a)}{h} \right ]$$
and the equation of the tangent line to the curve $y=f(x)$ at the point $(a,f(a))$ can be written in point-slope form as

$$y-f(a)=f'(a)(x-a)$$

\section{Derivatives (cont.):}
\begin{itemize}
    \item Other notation is $\frac{d y}{d x} |_{x=a}$ (Leibniz Notation),  $\frac{d f}{d x}$, $\frac{d}{d x}$ $f(x)$, $f(x)$, $D f(x)$, \& $D_{x} f(x)$
    \item Function $f(x)$ is differentiable at $x=a$ if $f'(a)$ exists (same as Theorem 1.5.1).
    \item Therefore, Not Continuous $\implies$ Not Differentiable.
    \item If $f'(a)$ exists, then $\lim_{x \to a} f(x) = f(a)$
    \item The derivative is a function, not a constant.
    \item Because $f'$ is also a function, $f'$ may have a derivative of its own, denoted by $(f')' = f''$ and called the \textbf{second derivative} of $f$. This can also be written as $\frac{d}{d x} \left ( \frac{d y}{d x} \right ) = \frac{d^2 y}{dx^2}$
\end{itemize}

\section{Derivatives Rules:}

\begin{minipage}{0.5\textwidth}

\begin{itemize}
    \item Constant: $\frac{d}{d x}(c) = 0$
    \item Linear: $\frac{d}{d x}(x) = 1$
\end{itemize}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}
\begin{itemize}
    \item Linear + Constant: $\frac{d}{d x}(ax) = a$
    \item Power Rule: $\frac{d}{d x}(x^n) = n x^{n-1}$
\end{itemize}
\end{tabular}
\end{minipage}

\begin{itemize}
    \item Constant Multiple: $\frac{d}{d x}[c \cdot f(x)] = c \cdot \frac{d}{d x}(f(x))$
    \item Sum/Difference: $\frac{d}{d x}[f(x) \pm g(x)] = f'\pm g'$
    \item Product Rule: $\frac{d}{d x}[f(x)\cdot g(x)] = f'\cdot g + f \cdot g'$
    \item Quotient Rule: $\frac{d}{d x}\left[ \frac{f(x)}{g(x)} \right] = \frac{g\cdot f'- f\cdot g'}{g^2} = \frac{\text{lo} \cdot \text{d hi - hi} \cdot \text{d lo}}{\text{lo}\cdot\text{lo}}$
\end{itemize}

\section{Lines:}
\textbf{Theorem:} If the graph of $y=m_1x+b_1$ is perpendicular to the graph of $y=m_2x+b_2$, then $m_1m_2 = -1$.
\\
\textbf{Normal Line:} The normal line to a curve at point $M$ is the line through $M$ that is perpendicular to the tangent line at $M$.

$$\includegraphics[width=0.5\textwidth]{media/normal-tangent.png}$$

\section{Trig Review:}
$$\csc = \frac{1}{\sin}, ~\sec = \frac{1}{\cos}, ~\cot = \frac{1}{\tan} = \frac{\cos}{\sin}$$
\section{Trig Identities:}
$$\sin^2 + \cos^2 = 1$$
$$\text{Dividing by }\sin^2: 1 + \frac{\cos^2}{\sin^2} = \frac{1}{\sin^2} \rightarrow{} 1 + \cot^2 = \csc^2$$
$$\text{Dividing by }\cos^2: \frac{\sin^2}{\cos^2} + 1 = \frac{1}{\cos^2} \rightarrow{} \tan^2 + 1 = \sec^2$$
\section{Derivative of Trig Functions:}
\begin{minipage}{0.5\textwidth}

    $$(\sin)' = \cos$$
    $$(\cos)' = -\sin$$
    $$(\tan)' = \sec^2 $$
\hfil
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

    $$(\csc)' = -\cot \cdot \csc$$
    $$(\sec)' = \sec \cdot \tan$$
    $$(\cot)' = -\csc^2 $$

\end{tabular}
\end{minipage}

\section{Limit of Trig Functions:}

$$\lim_{\theta \to 0}{\frac{\sin \theta}{\theta}} = 1$$

\section{Composite Function: } A new function can be  composed to two old functions, such as $f \circ g$. Formally, given two functions $f$ and $g$, the composite function $f \circ g$ and $g \circ f$ (also called the composition of $f$ and $g$) is defined by $(f \circ g)(x)  = f(g(x))$ and $(g \circ f)(x)  = g(f(x))$

\section{Decomposite Function: } Many functions can be decomposed into small functions, $h(x) = f(g(x))$

\section{Chain Rule} If the composite function $F(x) = f \cdot g$ is defined by $F(x) = f(g(x))$ is differentiable at $x$ and $F'$ is given by the product

$$F'(x) = f'(g(x)) \cdot g'(x) \text{ or } OUT'(in) \cdot IN'$$

\noindent\text{The power rule can be combined with the chain rule as}

$$\frac{d}{dx}[g(x)]^n = n[g(x)]^{n-1} \cdot g'(x)$$

\section{Explicit and Implicit:}
\textbf{Explicit: } A function given in terms of the independent variable, e.g. $y=\sqrt{x^3+1}$.\\
\textbf{Implicit: } A function given in terms of both dependent and independent variables, e.g. $x^3-y^2+1=0,~y \geq 0$.\\
\textbf{Implicit Differentiation: } If the function is stuck in implicit form, then differentiate both sides of the equation with respect to $x$ and solve the resulting equation for $y'$.\\
\textbf{Note: }
$$\frac{d}{dx}(y^n) \neq{} ny^{n-1}  ~~~~~~\frac{d}{dx}(y^n) = ny^{n-1} \cdot y'$$

\section{Related Rates:}
A related rates problem is to compute the rate of change (derivative) of one quantity in terms of the rate of change of another quantity, which is more easily measured.
\\\\
\noindent How to approach a related rates problem:
\begin{enumerate}
    \item Read the problem, and draw a diagram if possible.
    \item Assign symbols to all variables that are a function of time.
    \item Find an equation that relates the two variables.
    \item Using the Chain Rule to differentiate both sides with respect to time.
    \item Substitute the given information into resulting equation and solve for the unknown
    rate.
\end{enumerate}

\section{Maximum and Minimum Values:}
\textbf{Absolute or Global [Max/Min]: } The [max/min] $y$-value in the domain. \\
\textbf{Relative or Local [Max/Min]: } The [max/min] $y$-value in a given range around a $x$-value. Can only occur when the graph goes from [increasing to decreasing / vice-versa]\\
\textbf{Note: } The endpoint of a graph can never be a relative [max/min] because one side of the point is always undefined.

\section{Increasing/Decreasing Functions:}
$$\includegraphics[scale=.7]{media/increasing-decreasing-functions.png}$$

\section{Concavity:}
$$\includegraphics[scale=.75]{media/concavity.png}$$

\section{Extreme Value Theorem:} Suppose that $f(x)$ is continuous on the interval $[a,b]$ then there are two numbers, $a \leq c, d \leq d$ so that $f(c)$ is an absolute maximum for the function and $f(d)$ is an absolute minimum for the function.

\section{Fermat's Theorem:} If $f$ has a local max or min at $a$, and $f'(a)$ exists, then $f'(a) = 0$.

\section{Critical Number: } A critical number of a function $f$ is a number $c$ in the domain of $f$ such that either $f'(c) = 0$ or $f'(c) = $ DNE

\section{Absolute Extreme: } To find the absolute max and min values of a continuous function $f$ on a closed interval $[a,b]$:

\begin{enumerate}
    \item Find the critical numbers of the function on $(a,b)$
    \item Find the values of $f$ at the critical numbers of $f$ in $(a,b)$
    \item Find the values of $f$ at the end points of the interval, in other words, find $f(a)$ and $f(b)$.
    \item The largest of the values from steps 2 and 3 is the absolute max, the smallest is the absolute min.

\end{enumerate}

\section{Rolle's Theorem} Let $f$ be a function that satisfies the following three hypotheses:
\begin{enumerate}
    \item $f$ is continuous on the closed interval $[a,b]$
    \item $f$ is differentiable on the open interval $(a,b)$
    \item $f(a) = f(b)$
\end{enumerate}
Then there is at least one number $c$ in $(a,b)$ such that $f'(c) = 0$

$$\includegraphics[width=0.7\textwidth]{media/rolles.png}$$

\subsection{Proof}
\begin{itemize}
    \item Case 1: $f(x) = k, $ a constant. Then, $f'(x) = 0$ so the number $c$ can be taken to be any number in $(a,b)$.
    \item Case 2: $f(x) > f(a), $ concave down, for some $x$ in $(a,b)$. By the extreme value theorem, $f$ has a max value in $[a,b]$. Since $f(a)=f(b)$, it must attain it's max value at $c$; $c \in (a,b)$. Then, $f$ has a local max at $c$, $f$ is differentiable at $c$, therefore $f'(c)$ = 0 by Fermat's theorem.
    \item Case 3: $f(x) < f(a), $ concave up, for some $x$ in $(a,b)$. By the extreme value theorem, $f$ has a min value in $[a,b]$. Since $f(a)=f(b)$, it must attain it's min value at $c$; $c \in (a,b)$. Then, $f$ has a local min at $c$, $f$ is differentiable at $c$, therefore $f'(c)$ = 0 by Fermat's theorem.
\end{itemize}

\section{Mean Value Theorem} Let $f$ be a function that satisfies the following hypotheses:

\begin{itemize}
    \item $f$ is continuous on the closed interval $[a,b]$
    \item $f$ is differentiable on the open interval $(a,b)$
\end{itemize}

Then there is at least one number $c$ in $(a,b)$ such that $$f'(c)=\frac{f(b)-f(a)}{b-a}$$
$$\text{Slope of tangent line at } c = \text{Slope of Secant Line} $$
$$f(b) - f(a) = f'(c)(b-a)$$

$$\includegraphics[width=0.7\textwidth]{media/mvt.png}$$

\section{Determining Increasing/Decreasing: }
\begin{enumerate}
    \item Find the critical numbers
    \item Mark the critical numbers on a real line
    \item Pick a test number, $c$, in each interval:
    \item[$\cdot$] If $f'(c) > 0$, $f$ is increasing at that interval
    \item[$\cdot$] If $f'(c) < 0$, $f$ is decreasing at that interval
\end{enumerate}

\section{Local max and min: }
\begin{enumerate}
    \item Find the critical numbers
    \item Mark the critical numbers on a real line

    \item Pick a test number, $c$, in each interval:
    \item[$\cdot$] If $f'$ changes from $\oplus$ to $\ominus$, then $f$ has a local max at $f(c)$
    \item[$\cdot$] If $f'$ changes from $\ominus$ to $\oplus$, then $f$ has a local min at $f(c)$
    \item[$\cdot$] If $f'$ doesn't change sign, then $f$ has no local min or min at $f(c)$
\end{enumerate}

\section{Second Derivative Test} Suppose $f''$ is continuous near $c$.
\begin{enumerate}
    \item If $f'(c) = 0$ and $f''(c) < 0$, then $f$ has a local max at $c$.
    \item If $f'(c) = 0$ and $f''(c) > 0$, then $f$ has a local min at $c$.
    \item If $f'(c) = 0$ and $f''(c) = 0$, then the second derivative test says nothing about the point $c$, a possible inflection point
\end{enumerate}
\section{Finding Concavity}
\begin{enumerate}
    \item $f(x)$ increasing implies $f'(x)>0$
    \item $f'(x)$ increasing implies $f''(x)>0$
    \item $f''(x)>0$ for all $x$ in $I$, then the graph of $f$ is concave upwards on $I$
    \item $f''(x)<0$ for all $x$ in $I$, then the graph of $f$ is concave downwards on $I$
\end{enumerate}

\subsection{Inflection Point:} A point $p$ on a curve $f(x)$ is called an inflection point if $f$ is continuous there and the curve changes at $p$ from concave up to concave down or vice versa.

\subsection{Theorem:} At a point of inflection, $(c, f(c))$, either $f''(c)=0$ or $f''(c)$ DNE.

\section{Limit at $\infty{}$} Let $f$ be a function defined on some interval $(a, +\infty{})$. Then $\lim_{x \to \infty{}} f(x) = L$ means that the value of $f(x)$ can be made arbitrarily close to $L$ by making $x$ sufficiently large. In other words, for every $\epsilon > 0$, there is a number $N$ such that if $x<N$ then $|f(x)-L| < \epsilon$. "$N$": Large negative number.

\section{Horizontal Asymptote} The line $y=L$ is called a  horizontal asymptote of the curve $y=f(x)$ if either $\lim_{x \to +\infty{}} f(x) = L$ or $\lim_{x \to -\infty{}} f(x) = L$

\subsection{Theorem} If $r>0$ is a rational number, then $\lim_{x \to \infty{}} \frac{1}{x^r} = 0$\\
If $r>0$ is a rational number such that $x^r$ is defined for all $x$, then $\lim_{x \to -\infty{}} \frac{1}{x^r} = 0$

\section{Optimization}
\begin{enumerate}
    \item Understand the problem. What is the unknown? What are the given quantities? What are the given conditions?
    \item Draw a diagram.  Show variables.
    \item Introduce notation. Assign $Q$ to the quantity that is to be maximized or minimized.
    \item Express $Q$ in terms of other variables.
    \item If $Q$ is expressed with more than one variable, use the given info to find a relationship among these variables.
    \item Find the absolute max or min value of the $Q$ (the function).
\end{enumerate}

\section{Area Under Curve: } The area $A$ of the region $S$ that lies under the graph of the continuous function $f$ is the limit of the sum of the areas of approximating rectangles:

$$A=\lim_{n\to \infty} R_n = \lim_{n\to \infty} (f(x_1)\Delta x) + f(x_2)\Delta x) + ... + f(x_n)\Delta x) = \lim_{n\to \infty} \sum_{i=1}^{n} f(x_i)\Delta x$$
$$A=\lim_{n\to \infty} r_n = \lim_{n\to \infty} (f(x_0)\Delta x) + f(x_1)\Delta x) + ... + f(x_{n-1})\Delta x)= \lim_{n\to \infty} \sum_{i=1}^{n} f(x_{i-1})\Delta x$$

\section{Absolute Extreme Values} Suppose that $c$ is a critical number of a continuous function $f$ defined on an interval.
\begin{itemize}
    \item If $f'(x)>0$ for all $x<c$, and $f'(x)<0$ for all $x>c$, then $f(c)$ is the absolute max for values of $f$.
    \item If $f'(x)<0$ for all $x<c$, and $f'(x)>0$ for all $x>c$, then $f(c)$ is the absolute min for values of $f$.
\end{itemize}

\section{Anti-derivative}
A function $F$ is called an antiderivative of $f$ on an interval $I$ if $F'(x) = f(x)$ for all $x$ in $I$.

\noindent For example, $F(x)=x^3$ and $f(x) = 3x^2$:
\begin{itemize}
    \item $f(x)$ is derivative of function $F(x)$
    \item $F(x)$ is antiderivative of function $f(x)$
\end{itemize}

\subsection{Theorem} If $F$ is an antiderivative of $f$ on an interval $I$, then the most general antiderivative of $f$ on $I$ is $F(x)+C$ where $C$ is an arbitrary constant.

\subsection{Initial Condition Steps}
\begin{enumerate}
    \item Find the anti-derivative of $f(x)$
    \item Plug in the initial  condition to evaluate constant $C$
    \item Find the solution
\end{enumerate}

\section{Differential Equations} An equation that involves the derivatives of a function is called a differential equation.\\
The solution of a differential equation is a function that satisfies the equation.

\section{Definite Integral}

If $f$ is continuous on $[a,b]$, or if $f$ has only a finite number of jump discontinuities, then $f$ is integrable on $[a,b]$; that is, the definite integral exists.
$$\int_a^b f(x) dx=\lim_{n\to \infty} \sum_{i=1}^{n} f(x_i^*)\Delta x$$

\subsection{Properties}

$$\int_a^a f(x) dx = 0$$
$$\int_a^b f(x) dx = -\int_b^a f(x) dx$$
$$\int_a^b c \cdot dx = c(b-a)$$
$$\int_a^b \left[f(x) \pm g(x)\right] dx = \int_a^b f(x) dx \pm \int_a^b g(x) dx$$
$$\int_a^c f(x) dx = \int_a^b f(x) dx + \int_b^c f(x) dx \text{ where } a < b < c$$

\subsection{Comparison Properties}

$$f(x)>0 \text{ for } a < x < b, \text{ then } \int_a^b f(x)dx > 0$$
$$f(x)>g(x) \text{ for } a < x < b, \text{ then } \int_a^b f(x)dx > \int_a^b g(x)dx$$
$$m<f(x)<M \text{ for } a < x < b, \text{ then } m(b-a) < \int_a^b f(x)dx < M(b-a)$$

\section{Fundamental Theorem of Calculus (1)}
If $f(x)$ is continuous on $[a,b]$, then the function $g$ defined by  $g(x) = \int_a^x f(t) dt$ for $a \leq x \leq b$, is continuous on $[a,b]$ and differentiable on $(a,b)$, and $g'(x)$=$f(x)$. In other words,
$$\frac{d}{dx} \left[\int_a^x f(t)dt \right] = f(x)$$

\section{Fundamental Theorem of Calculus (2)}
If $f(x)$ is continuous on $[a,b]$, then $\int_a^b f(x)dx = F(b)-F(a)$. where   $F(x)$ is any antiderivative of $f$, that is, a function such that $F'=f$.

\subsection{Notation:}
$$F(b)-F(a) = F(x)\big|_a^b = F(x)\big]_a^b$$

\section{Properties of Definite Integral}
$$\int_{-a}^a f(x)dx = 0\text{ if } f(x) \text{ is odd}$$
$$\int_{-a}^a f(x)dx = 2\cdot\int_{0}^a f(x)dx \text{ if } f(x) \text{ is even}$$

\section{Indefinite Integral} If $F(x)$ is any anti-derivative of $f(x)$, then the most general anti-derivative of $f(x)$ is called an indefinite integral and denoted as

$$\int f(x)dx = F(x) + C$$

\subsection{Indefinite vs Definite Integrals} Definite is a number, where as indefinite is a family of functions

\section{Integral Rules}
$$\includegraphics[width=0.85\textwidth]{media/indef-integrals.JPG}$$

\section{Net Change Theorem} The integral of a rate of change is the net change, $\int_a^b F'(x)dx = F(b)-F(a)$

\section{Integration by Substitution}  A function $F$ is called an anti-derivative of $f$ on an interval $I$ if $F’(x)=f(x)$ for all $x$ in $I$.

\begin{enumerate}
    \item Let $u=g(x)$, where $g(x)$ is part of the integrand.
    \item Calculate $\frac{du}{dx}$ (or $g'(x)$)
    \item Use the substitution $u=g(x)$ and $du=g'(x)dx$ to convert the entire integral into one involving only $u$
    \item If indefinite, evaluate the resulting integral and plug in $u$ by $g(x)$.
    \item If definite, plug in the lower limit of the integral and the upper limit of the integral into the expression $u=g(x)$ and get the new lower and upper limits. Then, evaluate the new definite integral (involving only $u$) by finding the anti-derivative of $f$ and use the Fundamental Theorem.
\end{enumerate}

\section{Substitution Rule for Definite Integral}
If $g'$ is continuous on $[a,b]$ and $f$ is continuous on the range of $u=g(x)$, then

$$\int_a^b f(g(x)) \cdot g'(x) dx = \int_{g(a)}^{g(b)} f(u) du$$

\section{One-to-One Function} A function $f$ that never takes one a same value twice; that is $f(x_1)\neq f(x_2)$ whenever $x_1\neq x_2$.

$$\includegraphics[width=0.65\textwidth]{media/onetoone.JPG}$$

\subsection{Horizontal Line Test} If you draw a horizontal line through the graph, it should only intersect once if it's a 1-to-1 function.

\subsection{Remark} All strictly increasing/decreasing functions are 1-to-1
\begin{itemize}
    \item $f'(a) > 0$ means strictly increasing
    \item $f'(a) < 0$ means strictly decreasing
\end{itemize}

\section{Inverse Function} Let function $f$ be a 1-to-1 function with domain $A$ and range $B$. Then its inverse function $f^{-1}$ has domain $B$ and range $A$ and is defined by $f^{-1}(y)=x \iff f(x)=y$ for any $y$ in $B$.

\subsection{Remark}
\begin{itemize}
    \item The domain of $f^{-1}$ is range of $f$
    \item The range of $f^{-1}$ is the domain of $f$
    \item $f^{-1}(f(x)) = x$
    \item $f(f^{-1}(x)) = x$
\end{itemize}

\subsection{Steps to find inverse}
\begin{enumerate}
    \item Write $y=f(x)$
    \item Solve this equation for $x$ in terms of $y$
    \item To express $f^{-1}$ as a function of $x$, interchange $x$ and $y$.
\end{enumerate}

\section{Derivative of Inverse Function}\label{Derivative of Inverse Function}
If $f$ is a 1-to-1 differentiable function with inverse function $f^{-1}$, then the inverse function is differentiable and the following is true:

$$(f^{-1})'(x) = \frac{1}{f'(f^{-1}(x))}$$

\section{Exponential Functions}
A function $f$ is  exponential if it is in the form $f(x)=a^x, a>0, a\neq 1$.
\begin{itemize}
    \item If $a>1$, the range is $(0, \infty)$ and greater the $a$, greater the slope
    \item If $1>a>0$, the range is $(\infty, 0)$ and lower the $a$, greater the slope
\end{itemize}

\subsection{Derivative of Exponential Function}
$$a^x \cdot \lim_{h\to0} \frac{a^h-1}{h} = a^x \cdot f'(0)$$

\section{$e$}
The function $f(x)=e^x$ is called the natural exponential function because the derivative is itself.

\section{Log Functions:} Exponential functions are 1-to-1, hence it has an inverse function $f^{-1}$:

$$f^{-1} (x) = log_a x, x>0$$
$$y=log_a x \iff a^y = x$$

\noindent Therefore, if $a>1$ the function $f(x)=log_a x$ is a 1-to-1, continuous, increasing function with the domain $(0, \infty)$ and range $(-\infty, \infty)$. If $x$, $y>0$ and $r$ is any real number, then:

$$log_a(xy)=log_a x + log_a y$$
$$log_a(x/y)=log_a x - log_a y$$
$$log_a(x^r)=r\cdot log_a x$$

$$lim_{x\to \infty} [log_a x] = \infty$$
$$lim_{x\to 0^+} [log_a x] = -\infty, a > 1$$

\section{Inverse Function Rules:}

$$(f \circ f^{-1})(x) = a^{log_a x} = x, x>0$$
$$(f^{-1} \circ f)(x) = log_a (a^x) = x$$

\section{Theorem} If $f$ is a 1-to-1 differentiable function with the inverse function $f^{-1}$, then the inverse function is differentiable and we can use \ref{Derivative of Inverse Function}:

$$(f^{-1})'(x) = \frac{1}{f'(f^{-1}(x))}$$

$$\frac{d}{dx} \left( \sin^{-1} x \right) = \frac{1}{\sqrt{1-x^2}}, (-1 < x < 1) \text{ between } -\frac{\pi}{2} \leq y \leq \frac{\pi}{2}$$
$$\frac{d}{dx} \left( \cos^{-1} x \right) = -\frac{1}{\sqrt{1-x^2}}, (-1 < x < 1)  \text{ between } 0 \leq y \leq \pi$$
$$\frac{d}{dx} \left( \tan^{-1} x \right) = \frac{1}{1+x^2}, x \in {\mathbb{} R}\text{ between } -\frac{\pi}{2} \leq y \leq \frac{\pi}{2}$$

\section{Indeterminate Forms:}

\begin{minipage}{0.45\textwidth}

$$ \frac{0}{0}$$
$$ \frac{\infty}{\infty}$$
$$ 0^0$$\hfill
\end{minipage}
\begin{minipage}{0.45\textwidth}

\begin{tabular}{|p{\textwidth}}

$$0 \cdot \infty (\neq{} 0)$$
$$\infty - \infty (\neq{} 0)$$
$$\infty^0$$

\end{tabular}
\end{minipage}

\section{L'Hospital's Rule:} Suppose $f$ and $g$ are differentiable and $g'(x) \neq{} 0$ on an open interval $I$ that contains $a$ (except possibly at $a$). Suppose that

$$\lim_{x\to a} f(x)  = 0  \text{ and  } \lim_{x \to a} g(x) = 0$$
$$\text{or that } \lim_{x\to a} f(x)  = \pm \infty  \text{ and  } \lim_{x \to a} g(x) = \infty$$

\noindent (In other words, we have an indeterminate form of type $\frac{0}{0}$ or $\frac{\infty}{\infty}$.) Then

$$\lim_{x\to a} \frac{f(x)}{g(x)} = \lim_{x\to a} \frac{f'(x)}{g'(x)}$$

\noindent if the limit on the right side exists (or is $\infty$ or $-\infty$)

\section{Area Between Lines} The area $A$ of the region bounded by the curves $y=f(x),~y = g(x),$ and the lines $x=a, x=b$, where $f$ and $g$ are continuous and $f(x)>g(x)$ for  all $x$ in $[a,b]$ is
$$A = \int_a^b \left[ f(x) - g(x) \right] dx$$

\noindent Or, if we just want to find the area inclsed we can use
$$A = \int_a^b \left| f(x) - g(x) \right| dx$$

\section{Average value of $f$}
We define the average value of $f$ on the interval $[a,b]$ as
$$f_{avg}= \frac{1}{b-a} \cdot \int_a^b f(x) dx$$

\section{Mean Value Theorem for Integrals} If $f$ is continuous on $[a,b]$, then there exists a number $c$ in $[a,b]$ such that

$$f(x) = f_{avg} = f(c) \cdot (b-a)$$

\section{Area of Shape} Let $S$ be a solid that lies between $x=a$ and $x=b$. If the cross-sectional area of $S$ in the plane $P_x$, through $x$ and perpendicular to the $x$-axis, is $A(x)$, where $A$ is a continuous function, then the volume of $S$ is

$$V=\lim_{n \to \infty} \sum_{i=1}^{n} A(x_i^*) \Delta x = \int_a^b A(x) dx$$

\subsection{Volume}

$$V=\int_a^b A(x) dx$$

\subsection{Disk}

$$A(x) = \pi \cdot r^2 \text{ if rotating about $x$-axis}$$

\subsection{Cross-Section (washer)}

$$A(x) = \pi \cdot (R^2 - r^2)  \text{ if rotating about $x$-axis}$$

\subsection{Cylinder}

$$A(x) = 2\pi x \cdot f(x) \cdot dx \text{ if rotating about $y$-axis}$$

\section{Integration by Parts}
$$\int f \cdot g'~dx = f \cdot g - \int g \cdot f'~dx$$
$$\int f~dg = f \cdot g - \int g~df$$

\begin{itemize}
    \item  Make $f$ something that results in the most simple equation when derived.
    \item \href{https://youtu.be/2I-_SV8cwsw}{DI Method is very quick and easy}

\end{itemize}

\section{Partial Fraction Decomposition (PFD)}
$$\includegraphics[scale=.4]{media/pfd-table.jpg}$$

\section{Trig Sub}

$$\includegraphics[scale=.6]{media/trigsub.JPG}$$

\section{Improper Integrals}

$$\int_a^\infty f(x)~dx = \lim_{B\to\infty} \int_a^B f(x) ~dx$$

\begin{itemize}
    \item If the limit exists, it converges
    \item If the limit doesn't exist, it diverges
\end{itemize}

\noindent e.g. $$\int \frac{1}{x^P} ~dx$$ \noindent if $P \leq 1$, the integral diverges

\section{Separable Differential Equations}

\begin{enumerate}
    \item Put all $y$'s on one side and all $x$'s on the other.
    \item Integrate both sides (don't forget $+c$!)
    \item If possible, solve for $y$.
    \item Apply initial conditions (if given.)
    \item Verify the solution.
\end{enumerate}

\textbf{Note:} Make sure $dy$ and $dx$ are in numerators!

\section{First-Order Linear Differential Equations}

$$\frac{dy}{dx} + P(x) \cdot y = Q(x)$$

\begin{enumerate}
    \item Find the integrating factor:
    $$e^{\int P(x)~dx}$$
    \item Multiply both sides by the integrating factor
    \item Recognize LHS as product rule
    \item Integrate both sides
    \item Solve for $y$
    \item Verify Solution

\end{enumerate}

\section{Taylor Series}
$$\frac{1}{1-x} = \sum_{n=0}^\infty x^n = 1+x+x^2+x^3+ ...$$

$$\frac{1}{1+x} = \sum_{n=0}^\infty (-1)^n x^n = 1-x+x^2-x^3+ ...$$

$$e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac{x^2}{2}+ \frac{x^3}{6}+ ...$$

$$\ln(1+x) =  \sum_{n=1}^\infty (-1)^{n+1} \frac{x^n}{n} = x-\frac{1}{2}x^2 + \frac{1}{3}x^3-\frac{1}{4}x^4+...$$

$$\sin(x) = \sum_{n=0}^\infty (-1)^n \cdot \frac{x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + ...$$

$$\cos(x) = \sum_{n=0}^\infty (-1)^n \cdot \frac{x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + ...$$

$$\tan^{-1}(x) = \sum_{n=0}^\infty (-1)^n \cdot \frac{x^{2n+1}}{2n+1} = x - \frac{x^3}{3}+ \frac{x^5}{5}- \frac{x^7}{7}+ ...$$

\subsection{Maclaurin  Series}
Where $a$ is the given center, by default 0

$$f(x) = \frac{f(a) (x-a)^0}{0!} +\frac{f^1(a) (x-a)^1}{1!} +\frac{f^2(a) (x-a)^2}{2!} +\frac{f^3(a) (x-a)^3}{3!} + ... $$

\subsection{Linear Approximation}

$$P_1 (x) = f(a) + f^1(a) (x-a)$$

\subsection{Quadratic Approximation:}

$$P_2 (x) = f(a) + f^1(a) (x-a) + f^2(a) \cdot \frac{1}{2} (x-a)^2$$

\section{Integrating using Series}
\begin{enumerate}
    \item Find series
    \item Take integral
    \item Evaluate at limits
    \item Find the first term less than the error magnitude. Stop at one term before
\end{enumerate}

\section{Error}

\subsection{Alternating}
For a Taylor polynomial of order $n$ that alternates, the error will always be smaller than the first unused term. This error is given by the first unused term;

$$R_n(x) = P_{n+1}(x)$$

\subsection{Converges}

For a Taylor polynomial of order $n$ that converges, the worst-case scenario is given by the following where $c \in (a,x)$

$$R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!} (x-a)^{n+1}$$

\section{Sequences \& Series}

\begin{itemize}
    \item $a_n$ represents the $n$th term of a \textbf{sequence}; $a_1, a_2, a_3, ...\ a_n$
    \item The \textbf{series} is a the summation of a sequence; $a_1 + a_2 + a_3 + ...\ + a_n$
    \item If the $\lim_{n\to\infty}$ of a sequence is $\infty$, the sequence diverges.
    \item If the $\lim_{n\to\infty}$ of a sequence is a constant, the sequence converges.
\end{itemize}

\section{Monotonic Sequence Theorem}
If a sequence $\{a_n\}$ is both  bounded and monotonic (meaning it's either nonincreasing or nondecreasing), then the sequence converges.

$$\lim_{r\to\infty} r^n = 0 \text{ if } |r| < 1$$

\section{Geometric Series}
A geometric series is a series that has the first term of $a$ and a common ration of $r$ written as

$$\sum_{n=0}^\infty a \cdot r^n$$

\begin{itemize}
    \item If $|r| < 1$ it converges to the sum of $\frac{a}{1-r}$
    \item If $|r| \geq 1$  it diverges
\end{itemize}

\noindent The $n$th partial sum for $\sum_{n=1}^\infty ar^{n-1} $ is

$$a \cdot \frac{1-r^n}{1-r}$$

\noindent and the interval of convergence is about $a$ and

$$-1 < r < 1 \text{ solve for x}$$

\noindent When the endpoints are plugged in to the series equation and it diverges, then it isn't included using parenthesis. If it converges, it is included using square brackets. If it equals $0$, the interval is $(-\infty,\infty)$. If it equals $\infty$, the interval is a single point.

\subsection{Starting at $n \neq 0$}
$$\sum_{n=b}^\infty a \cdot r^n = \sum_{n=0}^\infty (a\cdot r^b) \cdot r^n$$

\section{$p$-Series}
$$ \sum_{n=1}^\infty \left(\frac{1}{n}\right)^p=
\sum_{n=1}^\infty \frac{1}{n^p} =
\sum_{n=1}^\infty n^{-p}$$

\begin{itemize}
    \item Converges if $p>1$
    \item Diverges if $p \leq 1$
\end{itemize}

\section{$n$-th term test}
If the terms of a series (the sequence) don't converge to $0$, then the series diverges; however, the converse is not true! (e.g. $\sum \frac{1}{n}$ diverges even though its terms $\to$ 0)

\section{Ratio Test}
For $\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right| = r$ where $r$ is the ratio

\begin{itemize}
    \item $r < 1 \text{, series converges}$
    \item $r > 1 \text{, series diverges}$
    \item $r = 1 \text{, test inconclusive}$

    ---
    For Power Series

    \item $r = 0$ the radius is $\infty$ so interval is  $(-\infty, \infty)$
    \item $r = \infty$ the radius $0$ because the series converges at the center value.
    \item $r = \frac{|x-c|}{R}$ the radius is $R$ so interval is  $(-R+c, R+c)$ but we don't know if the endpoints $|c|$ are included, so we should plug them into $a_n$ for $x$

\end{itemize}

\section{Root Test}
\begin{itemize}
    \item $\lim_{n\to\infty} \sqrt[n]{|a_n|} < 1 \text{, series converges}$
    \item $\lim_{n\to\infty}
    \sqrt[n]{|a_n|} > 1 \text{, series diverges}$
    \item $\lim_{n\to\infty} \sqrt[n]{|a_n|}  = 1 \text{, test inconclusive}$
\end{itemize}

\section{Integral Test}
If $\sum_{n=1}^\infty a_n$ has positive, decreasing terms and $f(n) = a_n$ is continuous, then $\int_1^\infty f(x) dx$ and $\sum_{n=1}^\infty a_n$ either both converge or both diverge. Our resulting value is not what the series converges to!

\section{Limit Comparison Test}For some $b_n > a_n$,  $\lim_{n\to\infty} \frac{a_n}{b_n} = c$,

\begin{itemize}
    \item $c>0$ and finite$\implies$ $\sum a_n$ and $\sum b_n$ either both converge or diverge.
    \item $c=0$ $\implies$ $\sum a_n$ and $\sum b_n$ converge
    \item $c=\infty$ $\implies$ $\sum a_n$ and $\sum b_n$ diverge
\end{itemize}

\section{Alternating Series Test} If $\sum a_n$ is alternating, and the terms to go $0$ continually, then the series converges.

\section{Absolute vs Conditional}
\begin{itemize}
    \item If $\sum |a_n|$ converges, then it converges absolutely.
    \item If $\sum |a_n|$ diverges but $\sum a_n$ converges, it conditionally converges
\end{itemize}

\section{Factorial Rule}
$$(ax+n)! = (ax+n) \cdot (ax+(n-1)) \cdot (ax+(n-2)) \cdot ... \cdot (ax)!$$

% Unit 3 start

\section{Feedback}

\begin{minipage}{0.5\textwidth}
\textbf{Negative Feedback}
\begin{itemize}
    \item $y''=-y$
    \item $y=\cos(x) \to y'' = -\cos(x)$
    \item $y=\sin(x) \to y'' = -\sin(x)$
\end{itemize}

\hfill
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

\textbf{Positive Feedback}
\begin{itemize}
    \item $y''=y$
    \item $y=e^x \to y'' = e^x$
    \item $y=e^{-x} \to y'' = e^{-x}$
\end{itemize}

\end{tabular}
\end{minipage}

\section{Euler's Formula}
$$e^{ix} = \cos(x) + i \cdot \sin(x)$$

\section{2nd-order Linear DE}
\subsection{Factoring}
\begin{enumerate}
    \item Two real distinct roots; $r_1$, $r_2$; $y=c_1 e^{r_1 x} + c_2 e^{r_2 x}$
    \item Two complex roots; $\alpha \pm \beta x$; $y=e^{\alpha x}(c_1 \cos(\beta x) + c_2 \sin(\beta x))$
    \item One repeated real root; $r$; $y=c_1 e^{rx} +c_2 xe^{r x}$
\end{enumerate}

\subsection{Undetermined Coefficients}
\begin{enumerate}
    \item Constant; $y_p = A$
    \item $e^{\alpha x}$; $y_p = Ae^{\alpha x}$
    \item $\sin(\alpha x)$ or $\cos(\alpha x)$; $y_p = A\cos(\alpha x) + B\sin(\alpha x)$
\end{enumerate}

\subsection{Solving}
\subsubsection{If given two possible equations, $y_1$/$y_2$}
\begin{enumerate}
    \item Plug in the $y_1$/$y_2$ into the given equation to verify that the given functions work
    \item Write the general solution
    \item Plug in initial values, solve for constants
    \item Plug in constants to find particular solution
\end{enumerate}

\subsubsection{Initial Value}
\begin{enumerate}
    \item Turn the equation  into it's auxiliary form and find it's roots
    \item Find it's respective case and write the general solution
    \item \textbf{If non-homogeneous (RHS $\neq$ 0)}, find RHS's case and add it to the end of the general solution
    \item \text{Non-homo:} Plug $y_p$ into diff eq as $y$ and solve for constants $A$ (and  sometimes $B$)
    \item Set up the initial values equations and find $c_1$ and $c_2$
    \item Rewrite general solution with constants to get the particular solution
\end{enumerate}

\section{Parabolic Foci}
\begin{minipage}{0.5\textwidth}
$$4py=x^2$$
\begin{itemize}
    \item Focus at $(0,p)$
    \item Directrix at $y=-p$
    \item Opens along $y$
\end{itemize}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

$$4px=y^2$$
\begin{itemize}
    \item Focus at $(p,0)$
    \item Directrix at $x=-p$
    \item Opens along $x$
\end{itemize}

\end{tabular}
\end{minipage}
\begin{itemize}
    \item $p$ is the focal length; distance from vertex to focus
\end{itemize}

\section{Elliptical Foci}
\begin{minipage}{0.5\textwidth}
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$$
\begin{itemize}
    \item Wider than it is tall
    \item $a$ is the larger horizontal radius
    \item $b$ is the smaller vertical radius
    \item Focus at $(c,0)$
    \item Vertices at $(a,0), (-a,0)$
    \item Transverse axis about $x$
\end{itemize}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

$$\frac{y^2}{a^2} + \frac{x^2}{b^2} = 1$$
\begin{itemize}
    \item Taller than it is wide
    \item $b$ is the smaller horizontal radius
    \item $a$ is the larger vertical radius
    \item Focus at $(0,c)$
    \item Vertices at $(0,a), (0,-a)$
    \item Transverse axis about $y$
\end{itemize}

\end{tabular}
\end{minipage}

\begin{itemize}    \item $c=\pm\sqrt{a^2-b^2}$
\end{itemize}

\section{Hyperbolic Foci}
\begin{minipage}{0.5\textwidth}
$$\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1$$
\begin{itemize}
    \item Intersects with $x$ axis
    \item Asymptote/slope along $\pm \frac{b}{a}$
    \item Transverse axis about $x$
    \item Focus at $(c,0)$
\end{itemize}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

$$\frac{y^2}{a^2} - \frac{x^2}{b^2} = 1$$
\begin{itemize}
    \item Intersects with $y$ axis
    \item Asymptote/slope along $\pm \frac{a}{b}$
    \item Transverse axis about $y$
    \item Focus at $(0,c)$
\end{itemize}
\end{tabular}
\end{minipage}

\begin{itemize}
    \item $a$ always associated with positive
    \item $c=\sqrt{a^2+b^2}$
\end{itemize}

\section{3D}
\subsection{Distance in 3D}
$$d=\sqrt{(x-x_0)^2 + (y-y_0)^2 + (z-z_0)^2}$$

\subsection{Shapes}

\begin{enumerate}
    \item Ellipsoid -- 3 ellipses; $\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1$
    \item Paraboloid -- 2 parabolas, 1 ellipse$^2$; $\frac{x^2}{a^2}+\frac{y^2}{b^2}=\frac{z}{c}$
    \item Hyperboloid of one sheet$^1$ -- 1 ellipse, 2 hyperbolas; $\frac{x^2}{a^2}+\frac{y^2}{b^2}-\frac{z^2}{c^2}=1$
    \item Hyerpboloid of two sheets$^1$ -- 1 ellipse$^2$, 2 hyperbolas; $\frac{z^2}{c^2}-\frac{x^2}{a^2}-\frac{y^2}{b^2}=1$
    \item Elliptical Cone -- 1 ellipse$^2$, 2 lines that cross; $\frac{x^2}{a^2}+\frac{y^2}{b^2}=\frac{z^2}{c^2}$
    \item Cylinder -- Either 1 parabola, ellipse, or hyperbola.
\end{enumerate}
$^1$ One sheet has differing hyperbolic transverse axis while two sheets has the same
\newline
$^2$ non-zero value will need to be plugged in

\subsection{Finding Intercepts}
For each of the three variables, plug in $0$ for two and solve for the remaining.

\section{Parametric Equations}
$$x=f(t), y=g(t)$$
\begin{itemize}
    \item Each $t$ value gives a point on the curve: $(f(t),g(t))$.
    \item Circle goes clockwise if $x$ is with $\sin$ or $y$ with $\cos$.
\end{itemize}

\subsection{Solving Methods}
\begin{enumerate}
    \item Solve for $t$, plug in
    \item Plot points
\end{enumerate}

\subsection{Parametrizing the Curve}
Given two points -- $(x_0,y_0), (x,y)$ -- and a time interval, $\Delta t$
\begin{itemize}
    \item $x(t)=x_0 + at$ where $a=\frac{\Delta x}{\Delta t}$
    \item $y(t)=y_0 + bt$ where $b=\frac{\Delta y}{\Delta t}$
\end{itemize}

\subsection{Size Constraints}
\begin{itemize}
    \item $x=t$: Right half: [x-shift]\ $\leq t < \infty$
    \item $x=t$: Left half: $-\infty < t \leq$\ [x-shift]
    \item $y=t$: Top half: [y-shift]\ $\leq t < \infty$
    \item $y=t$: Bottom half: $-\infty < t \leq$\ [y-shift]
\end{itemize}

\subsection{Slope of Parametric Curve}
$$\frac{dy}{dx} = \frac{\frac{dy}{dt}}{\frac{dx}{dt}}$$

\subsection{Tangent Lines to Parametric}
Given point $(x_0, y_0)$ and two parametric equations, $x(t), y(t)$
\begin{enumerate}
    \item Find $t$ by setting $x$ or $y$ equal to $0$ in their respective equation
    \item Find the slope equation by solving $\frac{dy}{dx}$
    \item Plug in $t$-values into step 2 equation to find slope $m$
    \item Plug in everything to the formula $y-y_0=m(x-x_0)$
\end{enumerate}

\subsection{Second Derivative of Parametric Curve}
$$\frac{d^2y}{dx^2} = \frac{\frac{d}{dt}\left(\frac{dy}{dx}\right)}{\frac{dx}{dt}}$$

\subsection{Parametric Area}
$$A=\int_a^b f(x) \ dx = \int_a^b y(t) \cdot \frac{dx}{dt} \cdot dx$$

\subsection{Parametric Arc Length}
$$s=\int_a^b \sqrt{x' + y'}\ dt$$

\subsection{Parametric Surface Area}
$$SA = \int_a^b  2\pi \cdot y(t) \sqrt{x' + y'}\ dt$$

\section{Polar Coordinates}
\subsection{Converting}

\begin{minipage}{0.5\textwidth}
Polar to Cartesian
\begin{itemize}
    \item $x=r\cdot\cos\theta$
    \item $y=r\cdot\sin\theta$
\end{itemize}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}

Cartesian to Polar
\begin{itemize}
    \item $r^2=x^2+y^2$
    \item $\theta=\tan^{-1}\left(\frac{y}{x}\right)$
\end{itemize}
\end{tabular}
\end{minipage}

\subsection{Conics in Polar}
$$r=\frac{l}{1\pm e \cos\theta}$$ where $l$ is the size factor and $e$ is the eccentricity.

\begin{itemize}
    \item $e=0$: Circle
    \item $0<e<1$: Ellipse
    \item $e=1$: Parabola
    \item $e>1$: Hyperbola
\end{itemize}

\subsection{Area}
$$\int_0^{2\pi} \frac{1}{2} \cdot (r(\theta))^2 \ d\theta$$

%% Extra Stuff

\section{Vectors}
\subsection{Scalar Multiple}
Give $\vec{v}$ and scalar $r$;
$$r\vec{v}\ =\ <rx, ry>\ =\ r\cdot||\vec{v}||$$

\subsection{Unit Vector}
Vector of magnitude 1, such as $\hat{i}, \hat{j}, \hat{k}$

\subsection{Direction Vector}
A unit vector in some given direction found by dividing a vector $\vec{v}$ by it's magnitude

\subsection{Dot Product}
$$<a,b,c> \bullet <d,e,f> = ad + be + cf$$
$$\vec{a} \bullet \vec{b} = ||\vec{a}||\cdot ||\vec{b}|| \cdot \cos\theta$$

\begin{itemize}
    \item Tells us how similar two vectors are
\end{itemize}

\subsection{Cross Product}
$$<a_1, a_2, a_3> \times <b_1, b_2, b_3>\ =\ \begin{bmatrix}
\vec{i} & \vec{j} & \vec{k}\\
a_1 & b_2 & a_3\\
b_1 & b_2 & b_3
\end{bmatrix}_{\text{determinant}}$$

$$\ <a_2b_3 - a_3b_2,\ a_3b_1-a_1b_3,\ a_1b_2-a_2b_1>$$

\noindent Note that the cross product is not commutative
$$\vec{u} \times \vec{v} = -(\vec{v} \times \vec{u})$$

\subsection{Projection}

%$$\vec{a}\text{ on }\vec{b}\ = \text{scalar}_{\vec{b}}\vec{a} = \frac{\vec{a} \bullet \vec{b}}{||\vec{b}||}$$

$$\vec{a}\text{ on }\vec{b}\ = \text{projection}_{\vec{b}}\vec{a} = \frac{\vec{a} \bullet \vec{b}}{||\vec{b}||} \cdot \frac{\vec{b}}{||\vec{b}||}$$

\end{document}


\clearpage % so that table of contents mentions correct page
\phantomsection % so that hyperref makes correct reference
\addcontentsline{toc}{chapter}{Introduction}
\pagenumbering{arabic}
\chapter*{Introduction}

Bayesian filtering (or, recursive Bayesian estimation) is a very promising approach to estimation
of dynamic systems; it can be applied to a wide range of real-world problems in areas such as
robotics~\cite{ThrBurFox:05,Gus:02} (tracking, navigation), environmental simulations ---
e.g. tracking of the radioactive plume upon nuclear
accident~\cite{HofSmi:09,HofSmiPech:09,PechHofSmi:09}, econometrics and many more.

While many Bayesian filtering algorithms are simple enough to be implemented in software on
\emph{ad-hoc} basis, it is proposed that a well designed library can bring many advantages such as
ability to combine and interchange individual methods, better performance, programmer convenience
and a tested code-base.

\noindent{}The text is organised as follows:
\begin{enumerate}
	\item Theoretical background of Bayesian filtering is presented in the first chapter along with
	a description of well-known Bayesian filters: the Kalman filter, the particle filter and a
	simple form of the marginalized particle filter.
	\item In chapter 2 a software analysis for a desired library for Bayesian filtering is
	performed: requirements are set up, general approaches to software development are discussed and
	programming languages C++, MATLAB and Python and their implementations are compared. Interesting
	results are achieved when Python is combined with Cython.
	\item The PyBayes library that was developed as a part of this thesis is presented. PyBayes is
	written in Python with an option to use Cython and implements all algorithms presented in the
	first chapter. Performance of PyBayes is measured and confronted with concurrent implementations
	that use different implementation environments.
\end{enumerate}
Bayesian filtering is a subtask of a broader topic of Bayesian decision-making~\cite{Smi:05}; while
decision-making is not covered in this text, we expect the PyBayes library to form a good building
block for implementing decision-making systems.