\documentclass[methods-collated.tex]{subfiles}

\begin{document}

\section{Calculus}

\subsection*{Average rate of change}

\[m \operatorname{of} x \in [a,b] = \dfrac{f(b)-f(a)}{b - a} = \frac{dy}{dx}\]

\colorbox{cas}{On CAS:} Action \(\rightarrow\) Calculation
\(\rightarrow\) \texttt{diff}

\subsection*{Average value}

\[ f_{\text{avg}} = \dfrac{1}{b-a} \int^b_a f(x) \> dx \]

\subsection*{Instantaneous rate of change}

\textbf{Secant} - line passing through two points on a curve\\
\textbf{Chord} - line segment joining two points on a curve

\subsection*{Limit theorems}

\begin{enumerate}
    \def\labelenumi{\arabic{enumi}.}
    \tightlist
  \item For constant function \(f(x)=k\), \(\lim_{x \rightarrow a} f(x) = k\)
  \item \(\lim_{x \rightarrow a} (f(x) \pm g(x)) = F \pm G\)
  \item \(\lim_{x \rightarrow a} (f(x) \times g(x)) = F \times G\)
  \item \({\lim_{x \rightarrow a} {f(x) \over g(x)}} = {F \over G}, G \ne 0\)
\end{enumerate}

A function is continuous if \(L^-=L^+=f(x)\) for all values of \(x\).

\subsection*{First principles derivative}

\[f^\prime(x)=\lim_{h \rightarrow 0}{{f(x+h)-f(x)} \over h}\]

Not differentiable at:
\begin{itemize}
    \tightlist
  \item discontinuous points
  \item sharp point/cusp
  \item vertical tangents (\(\infty\) gradient)
\end{itemize}

\subsection*{Tangents \& gradients}

\textbf{Tangent line} - defined by \(y=mx+c\) where
\(m={dy \over dx}\)\\
\textbf{Normal line} - \(\perp\) tangent
(\(m_{{tan}} \cdot m_{\operatorname{norm}} = -1\))\\
\textbf{Secant} \(={{f(x+h)-f(x)} \over h}\)

\begin{cas}
  \textbf{In main}: Interactive \(\rightarrow\) Calculation \(\rightarrow\) Line \\
  \-\hspace{1em} \texttt{tanLine(f(x), x, p)} \\
  \-\hspace{1em} \texttt{normal(f(x), x, p)} \\
  where \texttt{p} is the \(x\)-value of the coordinate

  \textbf{In graph}: define function, then Analysis \(\rightarrow\) Sketch \(\rightarrow\) (Normal \textbar{} Tan line). Type \(x\) value to solve for a point. Return to show equation for line.
\end{cas}

\subsection*{Strictly increasing/decreasing}

For \(x_2\) and \(x_1\) where \(x_2 > x_1\):

\begin{itemize}
    \tightlist
  \item \textbf{strictly increasing}\\ where \(f(x_2) > f(x_1)\) or \(f^\prime(x)>0\)
  \item \textbf{strictly decreasing}\\ where \(f(x_2) < f(x_1)\) or \(f^\prime(x)<0\)
  \item Endpoints are included, even where gradient \(=0\)
\end{itemize}

\subsection*{Stationary points}

\begin{align*}
  \textbf{Stationary point:} && f^\prime(x) &= 0 \\
  \textbf{Point of inflection:} && f^{\prime\prime} &= 0
\end{align*}

\begin{tikzpicture}
  \begin{axis}[xmin=-21, xmax=21, ymax=1400, ymin=-1000, ticks=none, axis lines=middle]
    \addplot[color=red, smooth, thick] gnuplot [domain=-15:15,unbounded coords=jump,samples=500] {x^3-3*x^2-144*x+432} node [black, pos=1, right] {\(f(x)\)};
    \addplot[color=darkgray, dashed, smooth, thick] gnuplot [domain=-15:15,unbounded coords=jump,samples=500] {3*x^2-6*x-144} node [black, pos=1, right] {\(f^\prime(x)\)};
    \addplot[mark=*, blue] coordinates {(1,286)} node[above right, align=left, font=\footnotesize]{inflection \\ (falling)} ;
    \addplot[mark=*, orange] coordinates {(-6,972)} node[above left, align=right, font=\footnotesize]{stationary \\ (local max)} ;
    \addplot[mark=*, orange] coordinates {(8,-400)} node[below, align=left, font=\footnotesize]{stationary \\ (local min)} ;
  \end{axis}
\end{tikzpicture}\\
\begin{tikzpicture}
  \begin{axis}[enlargelimits=true, xmax=3.5, ticks=none, axis lines=middle]
    \addplot[color=blue, smooth, thick] gnuplot [domain=0.74:3,unbounded coords=jump,samples=500] {(x-2)^3+2} node [black, pos=0.9, left] {\(f(x)\)};
    \addplot[color=darkgray, dashed, smooth, thick] gnuplot [domain=1:3,unbounded coords=jump,samples=500] {3*(x-2)^2} node [black, pos=0.9, right] {\(f^\prime(x)\)};
    \addplot[mark=*, purple] coordinates {(2,2)} node[below right, align=left, font=\footnotesize]{stationary \\ inflection} ;
  \end{axis}
\end{tikzpicture}

\subsection*{Derivatives}

\rowcolors{1}{white}{peach}
\renewcommand{\arraystretch}{1.4}

\begin{tabularx}{\columnwidth}{rX}
  \hline
  \hspace{6em}\(f(x)\) & \(f^\prime(x)\)\\
  \hline
  \(\sin x\) & \(\cos x\)\\
  \(\sin ax\) & \(a\cos ax\)\\
  \(\cos x\) & \(-\sin x\)\\
  \(\cos ax\) & \(-a \sin ax\)\\
  \(\tan f(x)\) & \(f^2(x) \sec^2f(x)\)\\
  \(e^x\) & \(e^x\)\\
  \(e^{ax}\) & \(ae^{ax}\)\\
  \(ax^{nx}\) & \(an \cdot e^{nx}\)\\
  \(\log_e x\) & \(\dfrac{1}{x}\)\\
  \(\log_e {ax}\) & \(\dfrac{1}{x}\)\\
  \(\log_e f(x)\) & \(\dfrac{f^\prime (x)}{f(x)}\)\\
  \(\sin(f(x))\) & \(f^\prime(x) \cdot \cos(f(x))\)\\
  \(\sin^{-1} x\) & \(\dfrac{1}{\sqrt{1-x^2}}\)\\
  \(\cos^{-1} x\) & \(\dfrac{-1}{\sqrt{1-x^2}}\)\\
  \(\tan^{-1} x\) & \(\dfrac{1}{1 + x^2}\)\\
  \(\frac{d}{dy}f(y)\) & \(\dfrac{1}{\frac{dx}{dy}}\) \hfill(reciprocal)\\
  \(uv\) & \(u \frac{dv}{dx}+v\frac{du}{dx}\) \hfill(product rule)\\
  \(\dfrac{u}{v}\) & \(\dfrac{v\frac{du}{dx}-u\frac{dv}{dx}}{v^2}\) \hfill(quotient rule)\\
  \(f(g(x))\) & \(f^\prime(g(x))\cdot g^\prime(x)\)\\
  \hline
\end{tabularx}

\subsection*{Antiderivatives}

\rowcolors{1}{white}{lblue}
\renewcommand{\arraystretch}{1.4}

\begin{tabularx}{\columnwidth}{rX}
  \hline
  \(f(x)\) & \(\int f(x) \cdot dx\) \\
  \hline
  \(k\) (constant) & \(kx + c\)\\
  \(x^n\) & \(\dfrac{1}{n+1} x^{n+1}\) \\
  \(a x^{-n}\) &\(a \cdot \log_e |x| + c\)\\
  \(\dfrac{1}{ax+b}\) &\(\dfrac{1}{a} \log_e (ax+b) + c\)\\
  \((ax+b)^n\) & \(\dfrac{1}{a(n+1)}(ax+b)^{n-1} + c\>|\>n\ne 1\)\\
  \((ax+b)^{-1}\) & \(\dfrac{1}{a}\log_e |ax+b|+c\)\\
  \(e^{kx}\) & \(\dfrac{1}{k} e^{kx} + c\)\\
  \(e^k\) & \(e^kx + c\)\\
  \(\sin kx\) & \(\dfrac{-1}{k} \cos (kx) + c\)\\
  \(\cos kx\) & \(\dfrac{1}{k} \sin (kx) + c\)\\
  \(\sec^2 kx\) & \(\dfrac{1}{k} \tan(kx) + c\)\\
  \(\dfrac{1}{\sqrt{a^2-x^2}}\) & \(\sin^{-1} \dfrac{x}{a} + c \>\vert\> a>0\)\\
  \(\dfrac{-1}{\sqrt{a^2-x^2}}\) & \(\cos^{-1} \dfrac{x}{a} + c \>\vert\> a>0\)\\
  \(\frac{a}{a^2-x^2}\) & \(\tan^{-1} \frac{x}{a} + c\)\\
  \(\frac{f^\prime (x)}{f(x)}\) & \(\log_e f(x) + c\)\\
  \(\int f(u) \cdot \frac{du}{dx} \cdot dx\) & \(\int f(u) \cdot du\) \hfill(substitution)\\
  \(f(x) \cdot g(x)\) & \(\int [f^\prime(x) \cdot g(x)] dx + \int [g^\prime(x) f(x)] dx\)\\
  \hline
\end{tabularx}

\end{document}
