# Maths

Various notes (crib sheet) from trying to understand various things... really just stuff you'd find in any old math text book. Oh and this is a useful MathJax reference on StackExchange. And Detxify can be used to draw the symbol you're looking for!

## References and Resources

The following are absolutely amazing, completely free, well taught resources that just put things in plain English and make concepts that much easier to understand! Definitely worth a look!

1. The amazing Khan Achademy.
2. The amazing CK12 Foundation.

For a more in-dept look at calculus the following book is AMAZING! Written really well. I wish I'd had this book when I was at school!

1. The Calculus Lifesaver, Adrian Banner.

## Partial fractions

The point of partial fractions is to do the reverse of: $$\frac{5}{x - 4} + \frac{3}{x + 1} = \frac{8x - 7}{x^2 - 3x -4}$$

In other words, given the following, $$\frac{8x - 7}{x^2 - 3x - 4}$$ Partial fractions let us go back to, $$\frac{5}{x - 4} + \frac{3}{x + 1}$$ We would start this by first factoring the above to get, $$\frac{8x - 7}{x^2 - 3x - 4} = \frac{8x - 7}{(x - 4)(x + 1)}$$ We know that we want to get to something like, $$\frac{8x - 7}{(x - 4)(x + 1)} = \frac{A}{(x - 4)} - \frac{B}{(x + 1)}$$ We can remove the denominators by multiplying through by $(x - 4)(x + 1)$ to give, $$8x - 7 = A(x + 1) - B(x - 4) = (A - B)x - (-A - 4B)$$ Matching terms between $8x - 7$ and $(A - B)x + (A + 4B)$, we get, $$A - B = 8 \text{ and,}\\ A + 4B = 7$$ Solving these simultaneous linear equations, we get, $$A = 7\frac{4}{5} \text{, and } B = -\frac{1}{5}$$ And so we can get back to $$\frac{8x - 7}{(x - 4)(x + 1)} = \frac{7\frac{4}{5}}{(x - 4)} + \frac{\frac{1}{5}}{(x + 1)}$$ Yucky example, sorry!

### Summary Of Partial Fraction Rules

• Numerator must be lower degree than denominator. If not, then first divide out.
• Factorise denominator into its prime factors.
• A linear factor $s+a$ gives partial fraction $A \over (s+a)$
• A repeated factor $(s+a)^2$ gives ${A \over (s+a)} + {B \over (s+a)^2}$
• Similarly $(s+a)^3$ gives ${A \over (s+a)} + { B \over (s + a)^2} + {C \over (s + a)^3}$
• A quadratic factor $(s^2 + ps + q)$ gives ${Ps + Q} \over {s^2 + ps + q}$
• A repeated quadratic factor $(s^2+ps+q)^2$ gives ${{Ps+Q} \over {s^2+ps+q}} + {{Rs+T} \over {(s^2+ps+q)^2}}$

For example, $${3s^2 - 4s + 11} \over {(s + 3)(s - 2)^2}$$ Has partial fractions of the form... $${A \over (s+3)} + {B \over (s-2)} + {C \over {(s-2)^2}}$$

## Difference Of Two Cubes

$$a^3 - b^3 = (a - b)(a^2 + ab + b^2)$$ So for example... $$x^3 - 27 = x^3 - 3^3 = (x - 3)(x^2 + 3x + 9)$$

## Trig Identities

Wikipedia has a nice list of proofs for these :)

The "cut the knot" website lists some excellent proofs of the fundamental Pythagorean Theorem

### Sum and product formulas

$$\sin(a)\cdot\cos(b) = \frac12 [\sin(a+b)+\sin(a-b)]$$ $$\cos(a)\cdot\sin(b) = \frac12 [\sin(a+b)-\sin(a-b) ]$$ $$\sin(a)\cdot\sin(b) = \frac12 [\cos(a-b)-\cos(a+b)]$$ $$\cos(a)\cdot\cos(b) = \frac12 [\cos(a+b)+\cos(a-b)]$$ $$\sin(a)+\sin(b) = 2\ \sin(\frac{a+b}{2})\ \cos(\frac{a-b}{2})$$ $$\sin(a)-\sin(b) = 2\ \cos(\frac{a+b}2)\ \sin(\frac{a-b}2)$$ $$\cos(a)+\cos(b) = 2\ \cos(\frac{a+b}2)\ \cos(\frac{a-b}2)$$ $$\cos(a)-\cos(b) = 2\ \sin(\frac{a+b}2)\ \sin(\frac{a-b}2)$$

### Reduction Formulas

$$\sin(-\theta)=-\sin(\theta)$$ $$\sin(\theta)=-\sin(\theta - \pi)$$ $$\mp\sin(\theta)=\cos(\theta \pm \frac{\pi}2)$$ $$\cos(-\theta)=\cos(\theta)$$ $$\cos(\theta)=-\cos(\theta-\pi)$$ $$\pm\cos(\theta)=\sin(\theta \pm \frac{\pi}2)$$ $$\tan(-\theta)=-\tan(\theta)$$ $$\tan(\theta)=\tan(\theta - \pi)$$

### Pythagorean Identities

$$\sin^2 (\theta)+\cos^2 (\theta)=1$$ $$\tan^2 (\theta)+1=\sec^2 (\theta)$$ $$\cot^2 (\theta)+1=csc^2 (\theta)$$

### Sum or Difference of Two Angles

$$\sin(a \pm b) = \sin(a)\cos(b) \pm \cos(a)\sin(b)$$ $$\cos(a \pm b) = \cos(a)\cos(b) \mp \sin(a)\sin(b)$$ $$\tan(a \pm b) = \frac{\tan(a) \pm \tan(b)}{1 \mp \tan(a)\tan(b)}$$

### Double Angle Formulas

$$\sin(2\theta)=2\sin(\theta)\cos(\theta)$$ $$\cos(2\theta)=1-2\sin^2(\theta)$$ $$\cos(2\theta)=2\cos^2(\theta)-1$$ $$\cos(2\theta)=\cos^2(\theta)-\sin^2(\theta)$$ $$\tan(2\theta)=\frac{2\tan(\theta)}{1-\tan^2(\theta)}$$

## Logarithms

$$\log_a(a^u )=u$$ $$a^{\log_a(u)}=u$$ $$\log_a(uv)=\log_a(u)+\log_a(v)$$ $$\log_a(\frac uv)=\log_a(u)-\log_a(v)$$ $$\log_a(u^n)=n\log_a(u)$$ $$\log_a(u)=\frac{\log_b(u)}{\log_b(a)}$$

## Series

### Basic Series

Consider summing the numbers in the series $1,2,3,4$. For each number in the series, $n$ imagine stacking $n$ blocks to the left of the last stack.... you'd build up the triangle shown to the left. It's basically one half of a square. Trouble is if you divide the square by 2 you would chop off the top half of each block at the top of its stack. Therefore for each number in the series you have "lost" half a block.

Therefore the total number of blocks is... $$number\_of\_blocks = \frac{n^2}{2} + \frac{n}{2} = \frac{n(n+1)}2$$ Where $n^2/2$ is half of the square and $n/2$ is the total of all the halves that we "cut" off (but didn't mean to) when we took the half.

Therefore, we can say... $$\sum_1^n n = \frac{n(n+1)}2$$ And... $$\sum_1^n n^2 = \frac{n(n+1)(2n+1)}6$$ $$\sum_1^n n^3 = \left(\frac{n(n+1)}2\right) ^2$$

### Arithmetic Progression

$$x(n)=a_1,a_1+d,a_1+2d,\ldots$$ $$S_n=na+\frac{(n-1)d}2$$

### Geometric Progression

$$x(n)=a,ar,ar^2,ar^3,\ldots,ar^n,\ldots$$ $$S_n= \frac{a(1-r^n)}{1-r},n>0$$ If $|r|<1$, then as $n \to \infty$, $r^n \to 0$, $$S_\infty = \frac{a}{1-r}$$ Or, if $n<0$ (useful for the z-transform), then $$S_\infty=\frac{ar}{r-1}$$

### Binomial Theorem

The binomial thorem is summarised as... $$(1+x)^n = 1 + nx + \frac{n(n-1)}{2!} x^2 + \frac{n(n-1)(n-2)}{3!} x^3 + \cdots + \frac{n(n-1)(n-2) \ldots 1}{(n-1)!} x^n$$ Where the nth term is given by the following equation. $$u_a = \frac{xn!}{a!(n-a)!}$$

### Exponential Series

The exponential series is defined as... $$e = \left(1+\frac 1x\right)^n,\ n \to \infty$$ This is why $e=2.71828\ldots$

The constant $e$ can be expanded as follows... $$e = 1 + 1 + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} + \cdots$$ And powers of $e$ as ... $$e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots$$ $$e^{kx} = 1 + kx + \frac{(kx)^2}{2!} + \frac{(kx)^3}{3!} + \cdots$$

### Malclauren's Theorem

Attempts to express a function as a polynomial. $$f(x)=a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \cdots +a_n x^n$$ Note that the series must be shown to converge. Need to figure out the $a_i$ coefficients. Notice the following. $$f(x)=a_0+a_1 x+a_2 x^2+a_3 x^3+a_4 x^4+a_5 x^5+a_6 x^6+\cdots$$ $$f' (x)=a_1+2a_2 x+3a_3 x^2+4a_4 x^3+5a_5 x^4+6a_6 x^5+\cdots$$ $$f'' (x)=2a_2+3\cdot2a_3 x+4\cdot3a_4 x^2+5\cdot4a_5 x^3+6\cdot5a_6 x^4+\cdots$$ $$f''' (x)=3\cdot2a_3+4\cdot3\cdot2a_4 x+5\cdot4\cdot3a_5 x^2+6\cdot5\cdot4a_6 x^3+\cdots$$ Notice then... $$f(0)=a_0$$ $$f' (0)=a_1$$ $$f'' (0)=2!a_2$$ $$f''' (0)=3!a_3 \ldots$$ And so on...
It thus looks like, and indeed is the case, that: $$a_n = {\frac{\operatorname{d}^nf}{\operatorname{d}x^n}} \Big/ {n!}$$

The above definition can then be used to derive the expansion of $e^x$, which is why we were able to say: $$e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots$$ Remember, the series must be shown to converge! This is easily seen because the denominator is growing at a faster rate than the numerator.

Using this we can derive Euler's Formula. $$\cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \frac{x^8}{8!} - \cdots$$ $$\sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \frac{x^9}{9!} - \cdots$$

Summing the above two expansions we get... $$\cos(x) + \sin(x) = 1 + x - \frac{x^2}{2!} - \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} - \frac{x^6}{6!} - \frac{x^7}{7!} + \cdots$$ Doing a similar expansion for $e^{jx}$ we get the following and can then see how we get Euler's formula... \begin{align} e^{jx} & = 1 + jx + \frac{(jx)^2}{2!} + \frac{(jx)^3}{3!} + \frac{(jx)^4}{4!} + \cdots \\ & = 1 + jx + \frac{x^2}{2!} + \frac{jx^3}{3!} + \frac{x^4}{4!} + + \frac{jx^5}{5!} + \cdots \\ & = \cos(x) + j\sin(x) \end{align}

## Combinations & Permutations

Selecting $r$ samples from a set of $n$ samples at random. If the order of the elements matters then it is a permutation, otherwise it is a combination. $$Permutations = {_{n}P_r} = \frac{n!}{(n-r)!}$$ If I have a set of $n$ objects and I select $r = 2$ objects, on the first selections I can choose from $n$ objects. For the second selection I can choose from $n-1$ objects. This looks like the beginning of a factorial, but the factorial would look like this. $$n! = n(n-1)(n-2)(n-3)...1$$ We only want the first 2 terms. To get rid of the remaining terms we need to divide by $(n-2)(n-3)...1$, in other words, $(n-r)!$. Hence the formula above.

With combinations the order is not important. This time take $r = 3$... for every choice I make there will be $3 \times 2$ permutations with the same elements, which is one combination (as order is now not important). This is the case because the 3 elements can be ordered any how and count as the same object. $(a,b,c)$ and $(b,a,c)$ are, for example, no different. Out of all sets containing only these elements there must be $3!$ permutations. Therefore need to get rid of this count from ${_{n}P_r}$ by divifing by $r!$ in the general case... $$Combinations = {_{n}C_r} = \frac{{_{n}P_r}}{r!} = \frac{n!}{r!(n-r)!}$$

For a fairly explicit example of combinations v.s. permutations and their application in statistics see this little example.

## Limits

### Definition

Intuitively, $$\lim_{x\to c} f(x)=L$$ If $f$ is defined near (but not necessarily at) $c$ and $\operatorname{f}(x)$ approaches $L$ as $x$ approaches $c$. More rigorously, let $f$ be defined at all $x$ in an open interval containing $c$, except possibly at $c$ itself. Then, $$\lim_{x\to c} f(x)=L$$ If and only if for each $e>0$, there exists $d>0$ such that if $0<Z|x-c|<d$ then $|f(x)-L|< e$.

I.e., no matter how close to $L$ we get, there is always a value of $x$ arbitrarily close to the limit value, $c$, but which is not $c$, that yields this value close to $L$.

Ie. We can pick a window around the y-axis value $L$ and if we keep shrinking this window, we will always find an $x$ value, either side of $c$ that will yield a y-value in this error window. So, the error can be arbitraily small and we will always find an $x$ either side of $c$ to satisfy it :) This is the two sided limit.

### Limit Properties

Most of these are only true when the limits are finite...

 Uniquness: If $\lim f(x) = L_1$ and $\lim f(x) = L_2$ then $L_1 = L_2$ Addition: $\lim [f(x) + g(x)] = \lim f(x) + \lim g(x)$ Scalar multiplication: $\lim [\alpha f(x)] = \alpha \lim f(x)$ Multiplication: $\lim [f(x) g(x)] = \lim f(x) \lim g(x)$ Division: $\lim \left[\frac{f(x)}{g(x)}\right] = \frac{\lim f(x)}{\lim g(x)},\ g(x) \neq 0$ Powers: $\lim [f(x)^n] = [\lim f(x)]^n,\ \forall n \gt 0$

### Ways To "Solve" Limits

If the limit is not of the form $x \to \infty$, i.e., $x$ tends to some known number, first try pluggin that number into the equation. If you get a determinate answer thats great.

Generally though we get an indeterminate answer because we get a divide by zero...

If you can tansform the function you're taking the limit of to something where there is no longer a divide by zero, note that original function and the transform are not exactly identical. Let's say the original function is $f(x)$ and you have transformed it to $g(x)$.

If $x \to n$ and at $n$ $f(n)$ is indeterminate, our transform to $g(n)$ is not. This means $f(x)$ and $g(x)$ are not the same function. But because limits are only concerned with values near $n$ and not at $n$, this is okay as the functions are identical everywhere else.

When numerator non-zero but demominator zero, there is at least one vertical asymptote in your function. Either the limit will exist here or you will only have a left or right sided limit if on one side the y-axis tends in the opposite direction to the other side of the asymptote.

#### Factor Everything

If $f(x) = \frac{2x^2 + 12x + 10}{2x + 2}$ then factor to $f(x) = \frac{(2x + 2)(x + 5)}{(2x+2)}$ and cancel out the denominator. You can also use the difference of two cubes to help with more complex functions: $a^3 - b^3 = (a - b)(a^2 + ab + b^2)$.

#### Get Rid Of Square Roots

For problems where $x \to a$, where a is not $\infty$ you get rid of square roots by multiplying by the conjugate. If you have $\sqrt{expr} + C$ you multiply by $\sqrt{expr} - C$. If you have $\sqrt{expr} - C$ you multiply by $\sqrt{expr} + C$: $$\lim_{x \to a} \left( \frac{\sqrt{\text{expr}} - C}{x - D} \times \frac{\sqrt{\text{expr}} + C}{\sqrt{\text{expr}} + C} \right) = \lim_{x \to a} \frac{\text{expr} - c^2}{(x - D)(\sqrt{\text{expr}} + C)}$$ Now when $x = a$, hopefully you won't have an indeterminate fraction!

#### Rational Functions

When $x \to \infty$, the leading term dominates. If $p(x) = a_0x^n + a_1x^{n-1} + a_n$ then the leading term is $a_1x^n$. Putting $p_L(x) = a_1x^n$, we say that... $$\lim_{x \to \infty} \frac{p(x)}{p_L(x)} = 1$$ This does not mean that $p(x)$ ever equals $p_L(x)$, just that the ratio of the two tends to one as $x$ tends to infinity!

If you are taking the limit of a rational function like the one below... $$\lim_{x \to \infty} \left( \frac{n(x)}{d(x)} \right)$$ ... you can't just substitute infinity for $x$ because you get $\frac{\infty}{\infty}$ which doesn't make a lot of sense...

So do this... $$\lim_{x \to \infty} \left( \frac{n(x) \times \frac{n_L(x)}{n_L(x)}}{d(x) \times \frac{d_L(x)}{d_L(x)}} \right) = \lim_{x \to \infty} \left( \frac{\frac{n(x)}{n_L(x)} \times n_L(x)}{\frac{d(x)}{d_L(x)} \times d_L(x)} \right) = \lim_{x \to \infty} \left( \frac{\frac{n(x)}{n_L(x)}}{\frac{d(x)}{d_L(x)}} \times \frac{n_L(x)}{d_L(x)} \right)$$ We know that because the leading term dominates... $$\text{As } x \to \infty \text{ the fraction } \frac{n(x)}{n_L(x)} \text{ tends to } 1 \text{ as does } \frac{d(x)}{d_L(x)}$$ Which means that we will really be looking at the limit of... $$\frac{n_L(x)}{d_L(x)}$$ ... as $x$ tends to infinity!

A numerical example. Solve $$\lim_{x \to \infty} \left( \frac{x + 5x^5}{4x^8 + 7x^4 + x + 1234} \right)$$ So we do... $$\lim_{x \to \infty} \left( \frac{ \frac{x + 5x^5}{5x^5} }{ \frac{4x^8 + 7x^4 + x + 1234}{4x^8} } \times \frac{5x^5}{4x^8} \right)$$ Everything tends to one except $\frac{5x^5}{4x^8}$, which is equal to $\frac{5}{4x^3}$, so we know that this tends to zero!

In general, for our polynomials $n(x)$ and $d(x)$:

1. If degree of n == degree of d, then limit is finite and nonzero as $x \to \pm \infty$
2. If degree of n > degree of d, then limit is $\infty$ or $-\infty$ as as $x \to \pm\infty$
3. If degree of n < degree of d, then limit is 0 as $x \to +\infty$

#### N-th Roots...

When there are square roots, or indeed n-th roots in the equation the leading term idea still works. All that happens is that when you divide the n-th root by the leading term you bring it back under the square root.

Be careful when $x \to -\infty$ because $\sqrt{x^2} \ne x$ when $x$ is negative! It equals $-x$. Use the following rule. If you write... $$^n\sqrt{x^{\text{some power}}} = x^m$$ You need a minus in front of $x^m$ when $n$ is even and $m$ is odd.

#### The Sandwich Principle

If $g(x) \le f(x) \le h(x)$ for all x near a, and $\lim_{x \rightarrow a} g(x) = \lim_{x \rightarrow a} h(x) = L$, then $\lim_{x \rightarrow a} f(x) = L$ too.

#### L'Hopital's Rule

Can be summarised as follows... $$\lim_{x\to a} \left\{\frac{f(x)}{g(x)}\right\} = \lim_{x\to a} \left\{\frac{f'(x)}{g'(x)}\right\}$$ L'Hopital's rule can be used when the normal limit is indeterminate. For example... $$\lim_{x\to 0} \frac{\cosh(x)-e^x}{x}$$ Substituting in $0$ gives $(1-1)/0$, which is indeterminate. So, apply L'Hopital's rule by differentiating numerator and denominator separately... $$\lim_{x\to 0} \frac{\cosh(x)-e^x}{x} = \lim_{x\to 0} \frac{\sinh(x)-e^x}{1}$$ Substitute in $0$ for $x$ gives $-1$. Therefore... $$\lim_{x\to 0} \frac{\cosh(x)-e^x}{x} = -1$$

#### Trig functions

For small values of $x$, $y = \sin(x)$ and $y = x$ are approximately the same. For really small values, I'm not even sure my computer has enough precision to be able to accurately show the difference. But, using a small python script we can get the idea:

The above image was generated using the following script:

import matplotlib.pyplot as pl
import numpy as np

x = np.arange(-0.0001,0.0001, 0.000001)
y_lin = x
y_sin = np.sin(x)

pl.plot(x,y_sin, color="green")
pl.plot(x,y_lin, color="red")
pl.grid()
pl.legend(['y=sin(x)', 'y=x'])
pl.show()

In fact if your print(y_sin/y_lin) you just get an array of 1's because the computer does not have the precision to do any better. I think even at small values of $x$ it is not the case that $sin(x)=x$, but it is very close. So in reality, even for tiny $x$: $$\frac{\sin(x)}{x} \ne 1$$ But, the following does hold: $$\lim_{x \to 0} \frac{\sin(x)}{x} = 1$$

The following also hold: $$\lim_{x \to 0} \cos(x) = 1$$ $$\lim_{x \to 0} \frac{\tan(x)}{x} = 1$$

## Differentiation

### Definition

A function is continuous at a point if it can "be drawn without taking the pen off the paper" [Ref]. This means, more formally, that a function $f(x)$ is continuous at $x = a$ if $\lim_{x \rightarrow a}f(x) = f(a)$. For a function to be differntiable at a point, it must be continuous at that point....

The derivative of a function $f(x)$ with respect to it's variable $x$ is defined by the following limit, assuming that limit exists. $$f'(x) = \lim_{h \rightarrow 0} \frac{f(x + h) - f(x)}{h}$$ If the limit does not exist the function does not have a derivative at that point.

This is why, for example the function $f(x) = |x|$ does not have a defined derivative at $x = 0$, because the limit (of tjhe differentiation) does not exist at that point. The function is continuous at that point because the left and right limits are the same, but the derivative function does not exist.

A function is continuous over an interval $[a,b]$ if:

1. it is continuous at every point in $(a, b)$,
2. it is right-continuous at $x = a$, i.e., $\lim_{x\rightarrow a^{+}} f(x) = f(a) \ne \infty$
3. it is left-continuous at $x = b$, i.e., $\lim_{x\rightarrow b^{-}} f(x) = f(b) \ne \infty$

If a function is differentiable then it must also be continuous.

If $h$ is replaced with $\Delta x$ we would write $$f'(x) = \lim_{\Delta x \rightarrow 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}$$ Where $\Delta$ just means a "small change in". This small change in $x$ leads to a small change in $y$, which is given by $f(x + \Delta x) - f(x)$. Therefore we can write: $$f'(x) = \lim_{\Delta x \rightarrow 0} \frac{\Delta y}{\Delta x} = \frac{\mathrm dy}{\mathrm dx}$$ I.e, if $y= f(x), f'(x)$ can be written as $\frac{\mathrm dy}{\mathrm dx}$.

Now at school, as we'll see in the integration by parts section, sometimes $\frac{\mathrm dy}{\mathrm dx}$ was treated as a fraction although my teacher always said that it wasn't a fraction. The above, which I didn't know at the time, explains why. And, finally, in the awesome book "The Calculus Lifesaver" by Adrian Banner [Ref] I know why :)

Unfortunately neither $\mathrm dy$ or $\mathrm dx$ means anything by itself ...

... the quantity $\frac{\mathrm dy}{\mathrm dx}$ is not actually a fraction at all - it's the limit of the fraction $\frac{\mathrm dy}{\mathrm dx}$ as $\Delta x \to 0$.

### Basic Differential Coefficients

$$\frac{d}{dx}(x^n) = nx^{n-1}\\ \frac{d}{dx}(\ln x) = \frac{1}{x}\\ \frac{d}{dx}(e^{kx}) = ke^{kx}\\ \frac{d}{dx}(a^x) = a^x\ln a\\ \frac{d}{dx}(\cos x) = -\sin x\\ \frac{d}{dx}(\sin x) = \cos x\\ \frac{d}{dx}(\tan x) = \sec^2 x$$
$$\frac{d}{dx}(\cosh x) = \sinh x\\ \frac{d}{dx}(\sin^{-1} x) = \frac{1}{\sqrt{1-x^2}}\\ \frac{d}{dx}(\cos^{-1} x) = \frac{-1}{\sqrt{1-x^2}}\\ \frac{d}{dx}[\ln(f(x))] = \frac{f'(x)}{f(x)}\\ \frac{d}{dx}(c^{ax}) = c^{ax}\ln(ca)\\ \frac{d}{dx}(x^x) = x^x(1+\ln x)$$

### Chain Rule

Using this when you need to differentiate a function that is made up of the result of one function passed into the next and so on. I.e. if $h(x) = f(g(x))$.

$$\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}$$

### Quotient Rule

When you have a function $h(x)$ that can be expressed as a fraction, $\frac{f(x)}{g(x)}$ use the quotient rule to allow you do differentiate $f(x)$ and $g(x)$ independently (easier!) and the combine the results using this rule. $f(x)$ becomes $u$ and $g(x)$ becomes $v$:

$$\frac{dy}{dx} = \frac{v\frac{du}{dx} \times y\frac{dv}{dx}}{v^2}$$

### Product Rule

Use the product rule when trying to differentiate a quantity that is the multiplication of two function. I.e when trying to find the derivative of $h(x)$ when $h(x) = f(x)g(x)$. One of these functions becomes $u$, the other $v$. Use this so you can diffentiate the simpler functions $f(x)$ and $g(x)$ independently and then combine the results.

For two functions...

$$\frac{dy}{dx} = u\frac{dv}{dx} \times v\frac{du}{dx}$$

Or for three functions... $$\frac{dy}{dx} = \frac{du}{dx}vw \times u\frac{dv}{dx}w \times uv\frac{dw}{dx}w$$

Or, even, for any number of funtions...

... add up the group $abc...uvw$ $n$ times and put a $d/dx$ in front of a different variable in each term ...

The following is a really cool visual tutorial by Eugene Khutoryansky...

## Integration

### Basic Integrals

$$\int{x^n \;\mathrm dx} = \frac{x^{n+1}}{n+1} + C\\ \int{\frac{1}{x} \;\mathrm dx} = \ln x + C\\ \int{e^{kx} \;\mathrm dx} = \frac{e^{kx}}{k} + C\\ \int{a^x \;\mathrm dx} = \frac{a^x}{\ln a} + C\\ \int{\sin x \;\mathrm dx} = -\cos x + C\\ \int{\cos x \;\mathrm dx} = \sin x + C$$
$$\int{\sec^2 x \;\mathrm dx} = \tan x + C\\ \int{\sinh x \;\mathrm dx} = \cosh x + C\\ \int{\frac{1}{\sqrt{1 - x^2}} \;\mathrm dx} = \sin^{-1} x + C\\ \int{\frac{-1}{\sqrt{1 - x^2}} \;\mathrm dx} = \cos^{-1} x + C\\ \int{\frac{f'(x)}{f(x)} \;\mathrm dx} = \ln[f(x)] + C$$

### Integration Of Linear Factors

Use variable substitution, for example, if the integral is $$y = \int{(ax + b)^n \;\mathrm dx}$$ Then put $u = ax + b$, giving... $$y = \int{u^n \;\mathrm dx}$$ But now we need to integrate with respect to $u$, not $x$!. In other words we need to go from the above integral to something like, $$y = \int{??? \;\mathrm du}$$ We can use the chain rule as follows... $$\frac{dy}{du} = \frac{dy}{dx} \; \frac{dx}{du}$$ By integrating both sides of the equation with respect to $u$ we get.... $$y = \int{\frac{dy}{dx} \; \frac{dx}{du} \;\mathrm du}$$ We now have an integral of some function with respect to $u$. We can find $dy/dx$ from the definition of the original integral (just differentiate both sides!). We can find $dx/du$ by firstly rearranging $u = ax + b$ to... $$x = \frac{u - b}{a}$$ Then take the derivative with respect to $u$ to get $$\frac{dx}{du} = \frac{1}{a}$$ Notice how, that because the "thing" (factor) that is raised to a power in the integral is a linear function, the $x$ terms will always dissapear, leaving only a constant, which can be differentiated w.r.t $u$. If $x$ terms remained after differentiating the "thing" (factor), it would stop us doing our desired integration w.r.t $u$! Now we can see that... $$\frac{dy}{dx} \; \frac{dx}{du} = (ax + b)^n \cdot \frac{1}{a} = u^n \cdot \frac{1}{a}$$ Substitute this into our integral and we have... $$y = \int{u^n \cdot \frac{1}{a} \;\mathrm du}$$ This we know how to integrate the above using the list of standard integrals. $$y = \frac{u^{n+1}}{a(n+1)} + C$$ Now we can substitute back in for $u$ to obtain the answer $$y = \frac{(ax + b)^{n+1}}{a(n+1)} + C$$

One point to note is as follows. I always remember being taught to re-arrange the substitution that was made... $$\frac{dx}{du} = \frac{1}{a}$$ To... $$\mathrm dx = \frac{\mathrm du}{a}$$ ..And then subsitute for the $\mathrm dx$ term in the integral. However, this is not strictly correct as far as I understand because a differential coefficient is not a fraction... it is a limit: $$\frac{\mathrm dy}{\mathrm dx} = \lim_{a\to\infty}{\frac{f(x+a)-f(x)}{a}}$$ So, as we can see $\mathrm dy / \mathrm dx$ is not really a fraction... hence the above method and explanation, even if the "trick" I was taught works.

## Phasors

This awesome GIF is produced by RadarTutorial.eu, although I couldn't find it on their site. I originally found the image on this forum thread and the watermark bears RadarTutorial's site address (it's not too visible on the white background of this page).

## Fourier

### References

This is an awesome YouTube tutorial explaining how sine waves can be combined to produce any imaginable waveform: