---
# System prepended metadata

title: Math

---

# Math

[TOC]

## Arithmetic Series

- $a_1 = a_1$
- $a_2 = a_1 + d$
- $a_3 = a_1 + 2d$
- $\dots$
- $a_{n-1} = a_1 + (n-2)d$
- $a_n = a_1 + (n-1)d$

$$
\begin{split}
S_n 
&= a_1 + a_2 + a_3 + \dots + a_n \\
&= \frac{(a_1 + a_n) n}{2} \\
&= \frac{(2a_1 + (n-1)d) n}{2}
\end{split}
$$



:::info

Example 1: 

$$
1+2+3+\dots+99 = \; ?
$$

:::spoiler Solution
$$
\begin{split}
1+2+3+\dots+99
&= \frac{(1 + 99) \times 99}{2} \\
&= 4950
\end{split}
$$
:::success
:::

:::info
Exercise 1:

$$
1+3+5+\dots + 99 = \; ?
$$

:::spoiler Solution
$$
99 = 1 + (n-1) \times 2
$$

$$
98 = (n-1) \times 2
$$

$$
n = 50
$$

$$
S_n = \frac{(1 + 99) \times 50}{2}
= 2500
$$
:::

:::info
Exercise 2:

$$
1+4+7+10+\dots + 100 = 1717
$$
:::

:::info
Exercise 3:

Calculate the sum of the first 77 even numbers.

:::spoiler Solution

Method 1:
$$
a_1 = 2, \; d = 2, \; n = 77
$$

$$
a_{77} = 154
$$

$$
\begin{split}
S &= 2 + 4 + 6 + \dots + 154 \\
&= \frac{(2 + 154) \times 77}{2}
\end{split}
$$

Method 2:

$$
S = \frac{(2 + 2 + (77 -1) \times 2) \times 77}{2}
$$

Method 3:

$$
\begin{split}
S &= 2 + 4 + 6 + \dots + 154 \\
&= 2 (1 + 2 + 3 + \dots + 77) \\
&= 2 \times \frac{(1 + 77) \times 77}{2}
\end{split}
$$

:::

:::info
Exercise 4

:::spoiler Solution
$$
20 + 17 + 14 + \dots + (-40) = \; ?
$$

$$
d = -3
$$

$$
-40 = 20 + (n-1) \times (-3)
$$

$$
-60 = -3 (n-1), \; n-1 = 20
$$

$$
n = 19
$$
:::success
:::

## Polynomial

$$
(x + a)^n = x^n + C^n_1 x^{n-1}a + C^n_2 x^{n-2} a^2 + \dots + C^n_{n-1} x a^{n-1} + a^n 
$$

## Calculus

$$
f(x) = 
\begin{cases}
\frac{x - 1}{x^2 - 1} &,\quad x \neq 1 \\
2 &,\quad x = 1
\end{cases}
$$

$$
\bar f(x) = \frac 1 {x+1}
$$

$$
x = 1: f(1) = 2
,\quad f'(1) = \frac 1 2
$$

$$
\lim_{x \rightarrow 1} f(x) = \frac 1 2
$$

$$
\lim_{x \rightarrow \infty} f(x) = 0
$$

Derivative of $f(x)$:

$$
f'(x_1) = \lim_{x_2 \rightarrow x_1} \frac{f(x_2) - f(x_1)}{x_2 - x_1}
$$

$$
f'(x) = \lim_{h \rightarrow 0} \frac{f(x + h) - f(x)}{h}
$$

---

$$
f(x) = x^2
\qquad 
f'(x) = 2x
$$

$$
f'(x) = \lim_{h \rightarrow 0} \frac{(x+h)^2 - x^2}{h}
= \lim_{h \rightarrow 0}\frac{2hx + h^2}{h}
= \lim_{h \rightarrow 0} (2x + h)
= 2x
$$

---

$$
f(x) = x^n
$$

$$
\begin{split}
f'(x) &= \lim_{h \rightarrow 0} \frac{(x+h)^n - x^n}{h} \\
&= \lim_{h \rightarrow 0} \frac{(x^n + C^n_1x^{n-1}h + C^n_2 x^{n-2} h^2 + \dots) - x^n}{h} \\
&= \lim_{h \rightarrow 0} \frac{C^n_1x^{n-1}h + C^n_2 x^{n-2} h^2 + \dots}{h} \\
&= \lim_{h \rightarrow 0} (C^n_1 x^{n-1} + C^n_2 x^{n-2} h + \dots)\\
&= C^n_1 x^{n-1} = n x^{n-1}
\end{split}
$$

---

$$
f(x) = c
$$

$$
f'(x) = \lim_{h \rightarrow 0} \frac{c - c}{h}
= \lim_{h \rightarrow 0} \frac{0}{h}
= 0
$$

---

$$
f(x) = x^3 - 5x^2
$$

$$
f'(x) = 3 x^2 - 10 x
$$

$$
f''(x) = 6x - 10
$$

$$
f'''(x) = 6
$$

$$
f''''(x) = 0
$$

---

$$
f(x) = x^4 - 3 x^3 + 10x -9
\qquad
f'(x) = 4 x^3 - 9 x^2 + 10
$$

$$
g(x) = \frac 1 2 x^6 + 7 x^5 - \frac 2 9 x^3
\qquad 
g'(x) = 3 x^5 + 35 x^4 - \frac 2 3 x^2
$$

---

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

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

---

$$
f(x) = \ln(x)
\qquad
f'(x) = \frac 1 x
$$

---

$$
y = x^2 + 2x + 5
$$

$$
y' = 2x + 2
$$

Let $y' = 0$:

$$
2x + 2 = 0
\qquad
x = -1
$$

When $x = -1$:

$$
y = 1 - 2 + 5 = 4
$$

Minimum point: (-1, 4)

$$
y = x^2 +2x +5
= (x^2 + 2x + 1) - 1 + 5
= (x + 1)^2 + 4
$$

---

$$
f(x) = \sin(x)
$$

$$
\begin{split}
f'(x) &= \lim_{h \rightarrow 0} \frac{\sin(x+h) - \sin(x)}{h} \\
&= \lim_{h \rightarrow 0} \frac{\sin(x) \cos(h) + \cos(x) \sin(h) - \sin(x)}{h} \\
&= \lim_{h \rightarrow 0} \frac{\sin(x) \cos(h)  - \sin(x)}{h} + \lim_{h \rightarrow 0} \frac{\cos(x) \sin(h)}{h}\\
&= \lim_{h \rightarrow 0} \frac{\sin(x) \cos(h)  - \sin(x)}{h} + \cos(x) \\
&= \sin(x) \lim_{h \rightarrow 0} \frac{\cos(h) - 1}{h} + \cos(x) \\
&= \cos(x)
\end{split}
$$

$$
\frac{d}{dx} \sin x = \cos x
$$

$$
\frac{d}{dx} \cos x = -\sin x
$$

The product rule:

$$
\frac{d}{dx} \Big( f(x) \cdot g(x) \Big)
= f(x) \cdot \frac{d}{dx} g(x) + g(x) \frac{d}{dx} f(x)
$$

---

$$
f(x) = x^2 \sin x
$$

$$
\begin{split}
f'(x) &= x^2 (\sin x)' + \sin x (x^2)' \\
&= x^2 \cos x + 2x \sin x
\end{split}
$$

---

$$
f(x) = (x^2 + 3x)(2x^3 - 5x^2 + 3)
$$

---

The chain rule:

$$
\Big(f(g(x))\Big)' = f'(g(x)) \cdot g'(x)
$$

---

$$
u = 3x^2 + 4x - 5
$$

$$
f(x) = (3x^2 + 4x - 5)^2 = u^2
$$

$$
\begin{split}
f'(x) &= 2u \cdot (6x + 4) \\
&= 2(3x^2 + 4x - 5) \cdot (6x + 4)
\end{split}
$$

$$
f(x) = \sin(x^2)
$$

---

$$
f(x) = (x^2 + 1)^5
$$

$$
\begin{split}
f'(x) &= 5(x^2 + 1)^4 \cdot 2x \\
&= 10x (x^2 + 1)^4
\end{split}
$$