Basic Math

Quadratic Equation

ax2+bx+c=0x2+bax+ca=0x2+bax=caForcibly create a perfect square on the leftx2+bax+(b2a)2=ca+(b2a)2(x+b2a)2=ca+(b2a)2(x+b2a)2=ca+b24a2(x+b2a)2=b24ac4a2x+b2a=±b24ac4a2x=b2a±b24ac4a2\begin{align*} ax^2 + bx + c = 0 \\ x^2 + \frac{b}{a}x + \frac{c}{a} = 0 \\ x^2 + \frac{b}{a}x = -\frac{c}{a} \\ \text{Forcibly create a perfect square on the left} \\ x^2 + \frac{b}{a}x + \big(\frac{b}{2a}\big)^2 = -\frac{c}{a} + \big(\frac{b}{2a}\big)^2 \\ (x + \frac{b}{2a})^2 = -\frac{c}{a} + \big(\frac{b}{2a}\big)^2 \\ (x + \frac{b}{2a})^2 = -\frac{c}{a} + \frac{b^2}{4a^2} \\ (x + \frac{b}{2a})^2 = \frac{b^2 - 4ac}{4a^2} \\ x + \frac{b}{2a} = \pm \sqrt{\frac{b^2 - 4ac}{4a^2}} \\ x = -\frac{b}{2a} \pm \sqrt{\frac{b^2 - 4ac}{4a^2}} \\ \end{align*}

Series

Geometric series

Sni=0nari=a+ar+ar2+ar3++arn=a(1rn+1)1r\begin{align*} S_n &\coloneqq \sum_{i=0}^{n} ar^i \\ &= a + ar + ar^2 + ar^3 + \dots + ar^n \\ &= \frac{a(1 - r^{n+1})}{1 - r} \end{align*}

Derivation:

Sn=a+ar+ar2+ar3++arnrSn=ar+ar2+ar3++arn+arn+1\begin{align*} S_n &= a + &&{\color{magenta}ar + ar^2 + ar^3 + \dots + ar^n} \\ rS_n &= &&{\color{magenta}ar + ar^2 + ar^3 + \dots + ar^n} + ar^{n+1} \\ \end{align*}

By subtracting the two equations, we get:

SnrSn=aarn+1(1r)Sn=a(1rn+1)Sn=a(1rn+1)1r\begin{align*} S_n - rS_n &= a - ar^{n+1} \\ (1-r)S_n &= a(1 - r^{n+1}) \\ S_n = \frac{a(1 - r^{n+1})}{1 - r} \end{align*}

Notice that this only works when r1r \neq 1. For r=1r = 1, the sum is simply Sn=a(n+1)S_n = a(n+1).

A good example to memorize:

i=1ri=r+r2+r3+=r1r\begin{align*} \sum_{i=1}^{\infty} r^i &= r + r^2 + r^3 + \dots \\ &= \frac{r}{1-r} \end{align*}

NOTE: You can simply set a=r in the previous formula.

A variant:

Si=0iri=r+2r2+3r3++nrn+\begin{align*} S'_\infty &\coloneqq \sum_{i=0}^{\infty} i r^{i} \\ &= r + 2r^2 + 3r^3 + \dots + nr^n + \dots \\ \end{align*}

Derivation:

S=r+2r2+3r3+4r4++nrn+rS=2r2+2r3+3r4++(n1)rn+nrn+1+\begin{align*} S'_\infty &= r + &&{\color{magenta}2r^2 + 3r^3 + 4r^4 + \dots + nr^n} &&&{\color{magenta}+ \dots} \\ rS'_\infty &= &&{\color{magenta}\hphantom{2}r^2 + 2r^3 + 3r^4 + \dots + (n-1)r^n} &&&{\color{magenta}+ nr^{n+1} + \dots }\\ \end{align*}

By subtracting the two equations, we get:

SrS=r+r2+r3++rn+=r1r\begin{align*} S'_\infty - rS'_\infty &= r + {\color{magenta}r^2 + r^3 + \dots + r^n + \dots} \\ &= \frac{r}{1-r} \end{align*}

Thus,

(1r)S=r1rS=r(1r)2\begin{align*} (1-r)S'_\infty &= \frac{r}{1-r} \\ S'_\infty &= \frac{r}{(1-r)^2} \end{align*}