% Written by Anders Sjoqvist and Ulf Lundstrom, 2009 % The main sources are: tinyKACTL, Beta and Wikipedia \subsection{Equations} \[ax^2+bx+c=0 \Rightarrow x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\] The extremum is given by $x = -b/2a$. \[\begin{aligned}ax+by=e\\cx+dy=f\end{aligned} \Rightarrow \begin{aligned}x=\dfrac{ed-bf}{ad-bc}\\y=\dfrac{af-ec}{ad-bc}\end{aligned}\] In general, given an equation $Ax = b$, the solution to a variable $x_i$ is given by \[x_i = \frac{\det A_i'}{\det A} \] where $A_i'$ is $A$ with the $i$'th column replaced by $b$. \subsection{Inequality} For positive $a$, $b$, $c$, $d$ with $\frac{a}{b} < \frac{c}{d}$, $\frac{a}{b} < \frac{a+c}{b+d} < \frac{c}{d}$ hold. Also, for positive $a$, $b$, $c$, $d$, $\min(\frac{a}{b}, \frac{c}{d}) \leqslant \frac{a+c}{b+d} \leqslant max(\frac{a}{b}, \frac{c}{d})$. e.g., for two sets of disjoint vertices $A$, $B$ of $G$, \begin{align*} \min \left( \frac{E(G[A])}{V(G[A])}, \frac{E(G[B])}{V(G[B])} \right) & \leqslant \frac{E(G[A\cup B])}{V(G[A\cup B])} = \frac{E(G[A]) + E(G[B])}{V(G[A]) + V(G[B])} \\& \leqslant \max \left( \frac{E(G[A])}{V(G[A])}, \frac{E(G[B])}{V(G[B])} \right) \end{align*} (therefore, the average degree of the disjoint set is larger when we divide them.) \subsection{Recurrences} If $a_n = c_1 a_{n-1} + \dots + c_k a_{n-k}$, and $r_1, \dots, r_k$ are distinct roots of $x^k - c_1 x^{k-1} - \dots - c_k$, there are $d_1, \dots, d_k$ s.t. \[a_n = d_1r_1^n + \dots + d_kr_k^n. \] Non-distinct roots $r$ become polynomial factors, e.g. $a_n = (d_1n + d_2)r^n$. % \subsection{Trigonometry} % \begin{align*} % \sin(v+w)&{}=\sin v\cos w+\cos v\sin w\\ % \cos(v+w)&{}=\cos v\cos w-\sin v\sin w\\ % \tan(v+w)&{}=\dfrac{\tan v+\tan w}{1-\tan v\tan w}\\ % \sin v+\sin w&{}=2\sin\dfrac{v+w}{2}\cos\dfrac{v-w}{2}\\ % \cos v+\cos w&{}=2\cos\dfrac{v+w}{2}\cos\dfrac{v-w}{2}\\ % (V+W)\tan(v-w)/2&{}=(V-W)\tan(v+w)/2 % \end{align*} % where $V, W$ are lengths of sides opposite angles $v, w$. % \begin{align*} % a\cos x+b\sin x&=r\cos(x-\phi)\\ % a\sin x+b\cos x&=r\sin(x+\phi) % \end{align*} % where $r=\sqrt{a^2+b^2}, \phi=\operatorname{atan2}(b,a)$. \subsection{Geometry} \subsubsection{Triangles} Side lengths: $a,b,c$ Semiperimeter: $p=\dfrac{a+b+c}{2}$ Area: $A=\sqrt{p(p-a)(p-b)(p-c)}$ Circumradius: $R=\dfrac{abc}{4A}$ Inradius: $r=\dfrac{A}{p}$ Length of the median (divides the triangle into two equal area triangles): $m_a=\tfrac{1}{2}\sqrt{2b^2+2c^2-a^2}$ Length of the bisector (divides angles into two): $s_a=\sqrt{bc\left[1-\left(\dfrac{a}{b+c}\right)^2\right]}$ Law of sines: $\dfrac{\sin\alpha}{a}=\dfrac{\sin\beta}{b}=\dfrac{\sin\gamma}{c}=\dfrac{1}{2R}$ Law of cosines: $a^2=b^2+c^2-2bc\cos\alpha$ Law of tangents: $\dfrac{a+b}{a-b}=\dfrac{\tan\dfrac{\alpha+\beta}{2}}{\tan\dfrac{\alpha-\beta}{2}}$ \subsubsection{Quadrilaterals} With side lengths $a,b,c,d$, diagonals $e, f$, diagonals angle $\theta$, area $A$ and magic flux $F=b^2+d^2-a^2-c^2$: \[ 4A = 2ef \cdot \sin\theta = F\tan\theta = \sqrt{4e^2f^2-F^2} \] For cyclic quadrilaterals the sum of opposite angles is $180^\circ$, $ef = ac + bd$, and $A = \sqrt{(p-a)(p-b)(p-c)(p-d)}$. % \subsubsection{Spherical coordinates} % \begin{center} % \includegraphics[width=25mm]{source/Math/sphericalCoordinates.pdf} % \end{center} % \[\begin{array}{cc} % x = r\sin\theta\cos\phi & r = \sqrt{x^2+y^2+z^2}\\ % y = r\sin\theta\sin\phi & \theta = \textrm{acos}(z/\sqrt{x^2+y^2+z^2})\\ % z = r\cos\theta & \phi = \textrm{atan2}(y,x) % \end{array}\] \subsection{Derivatives/Integrals} \begin{align*} \dfrac{d}{dx}\arcsin x = \dfrac{1}{\sqrt{1-x^2}} &&& \dfrac{d}{dx}\arccos x = -\dfrac{1}{\sqrt{1-x^2}} \\ \dfrac{d}{dx}\tan x = 1+\tan^2 x &&& \dfrac{d}{dx}\arctan x = \dfrac{1}{1+x^2} \\ \int\tan ax = -\dfrac{\ln|\cos ax|}{a} &&& \int x\sin ax = \dfrac{\sin ax-ax \cos ax}{a^2} \\ \int e^{-x^2} = \frac{\sqrt \pi}{2} \text{erf}(x) &&& \int xe^{ax}dx = \frac{e^{ax}}{a^2}(ax-1) \end{align*} Integration by parts: \[\int_a^bf(x)g(x)dx = [F(x)g(x)]_a^b-\int_a^bF(x)g'(x)dx\] \subsection{Sums} \[ c^a + c^{a+1} + \dots + c^{b} = \frac{c^{b+1} - c^a}{c-1}, c \neq 1 \] \begin{align*} 1 + 2 + 3 + \dots + n &= \frac{n(n+1)}{2} \\ 1^2 + 2^2 + 3^2 + \dots + n^2 &= \frac{n(2n+1)(n+1)}{6} \\ 1^3 + 2^3 + 3^3 + \dots + n^3 &= \frac{n^2(n+1)^2}{4} \\ 1^4 + 2^4 + 3^4 + \dots + n^4 &= \frac{n(n+1)(2n+1)(3n^2 + 3n - 1)}{30} \\ \end{align*} \subsection{Series} $$e^x = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots,\,(-\infty0$. \[f(x) = \left\{ \begin{array}{cl} \lambda e^{-\lambda x} & x\geq0\\ 0 & x<0 \end{array}\right.\] \[\mu=\frac{1}{\lambda},\,\sigma^2=\frac{1}{\lambda^2}\] % \subsubsection{Normal distribution} % Most real random values with mean $\mu$ and variance $\sigma^2$ are well described by $\mathcal{N}(\mu,\sigma^2),\,\sigma>0$. % \[ f(x) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}} \] % If $X_1 \sim \mathcal{N}(\mu_1,\sigma_1^2)$ and $X_2 \sim \mathcal{N}(\mu_2,\sigma_2^2)$ then % \[ aX_1 + bX_2 + c \sim \mathcal{N}(\mu_1+\mu_2+c,a^2\sigma_1^2+b^2\sigma_2^2) \]