Skip to content

Commit

Permalink
approx
Browse files Browse the repository at this point in the history
  • Loading branch information
algasami committed Jun 22, 2024
1 parent 71cf242 commit fd0ae23
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 0 deletions.
84 changes: 84 additions & 0 deletions app/content/posts/20240621-precalc-zh-tw.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,87 @@ f(x) = a^x = e^{\ln(a)x} \\
```

。上述技巧其實就是連鎖律喔!

## 線性估計

給定函數$f, f(x)$,其在$(r, f(r))$的線性估計(直線)為$y = f'(r)(x-r)+f(r) = g(x)$。

### 好用表

```math
(1+x)^r \approx 1 + rx \text{ where } x \rightarrow 0
```

```math
\sin(x) \approx x \text{ where } x \rightarrow 0
```

```math
\cos(x) \approx 1 \text{ where } x \rightarrow 0
```

```math
e^x \approx 1 + x \text{ where } x \rightarrow 0
```

```math
\ln(1+x) \approx x \text{ where } x \rightarrow 0
```

### 推導

```math
(1+x)^r \approx (1+0)^r + r(1+0)^{r-1}x=1+rx
```

```math
\sin(x)\approx \sin(0) + \cos(0)x = x
```

```math
\cos(x)\approx \cos(0) + -\sin(0)x = 1
```

```math
e^x \approx e^0 + e^0 x = 1 + x
```

```math
\ln(1+x) \approx \ln(1) + \frac{x}{1+0}=x
```

## 二次估計

設定函數$f(x)=ax^2+bx+c$,查看其在$x=0$的導數,

```math
f(0)=c,
f'(0)=b,
f''(0)=2a
```

可以用來表示$f(x) = f(0) + f'(0)x + f''(0)x^2 \cdot (2!)^{-1}$。
推廣這心得,我們得到對於函數在$x=r$的二次估計為

```math
f(x) \approx f(r) + \frac{f'(r)(x-r)^1}{1!} +
\frac{f''(r)(x-r)^2}{2!}
```

$f$的二次估計為$Q(f)$。

## 估計定理

```math
Q(f(x) \cdot g(x)) = Q(Q(f(x))\cdot Q(g(x)))
```

## 泰勒級數

由上面的估計不難看出規則,對於函數$f$在$x=r$的估計而言,

```math
f(x) = f(r) + \sum^{\infty}_{n=1}{\frac{f^{(n)}(x) \cdot (x-r)^n}{n!}}
```

,稱為泰勒級數。
87 changes: 87 additions & 0 deletions app/content/posts/20240621-precalc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,90 @@ so for function $f$,
```

. The above technique is actually chain rule if you look closely!

## Linear Approximation

Given function $f(x)$, the linear approximation (tangent lines) at
$(r, f(r))$ is $y = f'(r)(x-r)+f(r) = g(x)$.
($f'$ is the derivative of $f$)

### Cheatsheet

```math
(1+x)^r \approx 1 + rx \text{ where } x \rightarrow 0
```

```math
\sin(x) \approx x \text{ where } x \rightarrow 0
```

```math
\cos(x) \approx 1 \text{ where } x \rightarrow 0
```

```math
e^x \approx 1 + x \text{ where } x \rightarrow 0
```

```math
\ln(1+x) \approx x \text{ where } x \rightarrow 0
```

### Deduction

```math
(1+x)^r \approx (1+0)^r + r(1+0)^{r-1}x=1+rx
```

```math
\sin(x)\approx \sin(0) + \cos(0)x = x
```

```math
\cos(x)\approx \cos(0) + -\sin(0)x = 1
```

```math
e^x \approx e^0 + e^0 x = 1 + x
```

```math
\ln(1+x) \approx \ln(1) + \frac{x}{1+0}=x
```

## Quadratic Approximation

Think of a function $f(x)=ax^2+bx+c$, we want to see its derivatives at $x=0$:

```math
f(0)=c,
f'(0)=b,
f''(0)=2a
```

which can represent $f(x)$ as $f(0) + f'(0)x + f''(0)x^2 \cdot (2!)^{-1}$.
Generalizing this observation, we can get that the quadratic approximation at $x=r$ is

```math
f(x) \approx f(r) + \frac{f'(r)(x-r)^1}{1!} +
\frac{f''(r)(x-r)^2}{2!}
```

The notation for quadratic approximation of function $f$ is $Q(f)$.

## Approximation Laws

```math
Q(f(x) \cdot g(x)) = Q(Q(f(x))\cdot Q(g(x)))
```

## Taylor Series

It's not particularly difficult to see the pattern from above approximations. For function $f$, its
approximation at $x=r$ would be

```math
f(x) = f(r) + \sum^{\infty }_{n=1}{\frac{f^{(n)}(x) \cdot (x-r)^n}{n!}}
```

, which is called Taylor series.

0 comments on commit fd0ae23

Please sign in to comment.