# Taylor series
> ### $ f(x) = a_0 + a_1x + a_2x^2 + a_3x^3 + a_4x^4 + ... = \displaystyle \sum_{i=0}^{\infty} a_{i}x^{i} $
> ### $ f(x) = a_0(x-a)^0 + a_1(x-a)^1 + a_2(x-a)^2 + a_3(x-a)^3 + a_4(x-a)^4 + ... = \displaystyle \sum_{i=0}^{\infty} a_{i}(x-a)^{i} $

$$\require{cancel}$$
# differential
> ### $ \therefore  f(x)|_{x=a} = \color{red}{f(a) = a_0} \\ f(x) = f(a) + a_1(x-a) + a_2(x-a)^2 + a_3(x-a)^3 + a_4(x-a)^4 + ...$
> ### $ f'(x)= \cancelto{}{a_0}  + a_1 + \frac{a_2(x-a)}{2}  + \frac{a_3(x-a)^2}{3} + \frac{a_3(x-a)^3}{4} + \frac{a_3(x-a)^4}{5} + .... \\ \therefore f'(x)|_{x=a} = \color{red}{f'(a) = a_1} $
> ### $ f''(x)= \cancelto{}{a_0}  + \cancelto {}{a_1} + \frac{a_2\cancel{(x-a)}}{2} + \frac{a_3(x-a)^1}{3*2} + \frac{a_3(x-a)^2}{4*3} + \frac{a_3(x-a)^3}{5*4} + .... \\ \therefore f''(x)|_{x=a}= \color{red}{f''(a) = \frac{a_2}{2}} $
> ### $ f^{3}(x)= \cancelto{}{a_0}  + \cancelto {}{a_1} + \cancelto{}{\frac{a_2}{2}} + \frac{a_3\cancel{(x-a)^1}}{3*2} + \frac{a_3(x-a)^1}{4*3*2} + \frac{a_3(x-a)^2}{5*4*3} + .... \\ \therefore f^{3}(x)|_{x=a} = \color{red}{f^{3}(a) = \frac{a_2}{3*2}} $

---
> ###  $
f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)(x-a)^2}{2} + \frac{f^{(3)}(a)(x-a)^3}{3*2} + \frac{f^{(4)}(a) (x-a)^4}{4*3*2} + \frac{f^{(5)}(a) (x-a)^5}{5*4*3*2} + ...
\\
f(x) = \frac{f(a)}{0!} + \frac{f'(a)(x-a)}{1!} + \frac{f''(a)(x-a)^2}{2!} + \frac{f^{(3)}(a)(x-a)^3}{3!} + \frac{f^{(4)}(a) (x-a)^4}{4!} + \frac{f^{(5)}(a) (x-a)^5}{5!} + ...
$
> ## $ \displaystyle \therefore f(x)|_{x=a} = \color{red}{\sum_{n=0}^{\infty} \frac{(x-a)^n}{n!} f^{(n)}(a)}\;$
> ## $ \displaystyle \therefore f(x)|_{x=0} = \color{red}{\sum_{n=0}^{\infty} \frac{x^n}{n!}f^{(n)}(0)} $

# $\color{red}{e^{x}|_{x=0}}$
> ### $
\left . 
\begin{array}{} 
e^0 = 1, \therefore a_0 = 1 \\
\frac{d}{dx}e^x|_{x=0} \to  e^{0} \therefore a_1 = 1 \\
\frac{d^2}{dx^2}e^x|_{x=0} \to  e^{0} \therefore a_2 = 1 \\
\frac{d^3}{dx^3}e^x|_{x=0} \to  e^{0} \therefore a_3 = 1 \\
\end{array}\right \} 
\begin{array}{}
\displaystyle \sum_{n=0}^{\infty} \frac{x^n}{n!}f^{(n)}(0) \\
e^x = 1 + \frac{x}{1} + \frac{x^2}{2!} + \frac{x^3}{3!} + ..,
= \displaystyle \sum_{n=0}^{\infty} \frac{x^{n}}{n!}
\end{array}
$

# [$\cos(x)|_{x=0}$](https://www.youtube.com/watch?v=LDBnS4c7YbA&t=160s)
> ### $
\left . 
\begin{array}{} 
cos(0) = 1 \therefore a_0 =1 \\
\frac{d}{dx}\cos x|_{x=0} = -sin(x)|_{x=0} \therefore a_1 = 0 \\
\frac{d^2}{dx^2}\cos x|_{x=0} = -cos(x)|_{x=0} \therefore a_2 = -1 \\
\frac{d^3}{dx^3}\cos x|_{x=0} = sin(x)|_{x=0} \therefore a_3 = 0 \\
\frac{d^4}{dx^4}\cos x|_{x=0} = cos(x)|_{x=0} \therefore a_4 = 1 \\
\frac{d^5}{dx^5}\cos x|_{x=0} =  a_1 \\
\frac{d^6}{dx^6}\cos x|_{x=0} = a_2 \\
\end{array}\right \}
\begin{array}{} 
1 + 0\frac{x}{1} + -1\frac{x^2}{2!} + 0\frac{x^3}{3!} + 1\frac{x^4}{4!} + 0 \frac{x^5}{5!} + -1\frac{x^6}{6!} + .., \\
1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \frac{x^8}{8!} .., = \displaystyle \sum_{n=0}^{\infty} \frac{x^{2n}}{(2n)!}(-1)^n
\end{array}
$

# $\color{red}{\sin(x)|_{x=0}}$
> ### $
\left . 
\begin{array}{} 
sin(0) = 0 \therefore a_0 = 0 \\
\frac{d}{dx}\sin x|_{x=0} = cos(x) \therefore a_1 = 1 \\
\frac{d^2}{dx^2}\sin x|_{x=0} = -sin(x) \therefore a_2 = 0 \\
\frac{d^3}{dx^3}\sin x|_{x=0} = -cos(x) \therefore a_3 = -1 \\
\frac{d^4}{dx^4}\sin x|_{x=0} = sin(x) \therefore a_4 = a_0 = 0 \\
\frac{d^5}{dx^5}\sin x|_{x=0} \therefore a_1 = a_5 = 1 \\
\frac{d^6}{dx^6}\sin x \therefore a_2 = a_6 = 0 \\
\end{array}\right \}
\begin{array}{} 
0 + 1\frac{x}{1} + (0)\frac{x^2}{2!} + (-1)\frac{x^3}{3!} + (0)\frac{x^4}{4!} + (1) \frac{x^5}{5!} + (0)\frac{x^6}{6!} + .., \\
\frac{x^1}{1!} - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} .., 
= \displaystyle \sum_{n=0}^{\infty} \frac{x^{2n+1}}{(2n+1)!}(-1)^n
\end{array}
$

# [$\Delta f$](https://www.youtube.com/watch?v=6fBiTe3LA8c)
> ### $[x_0-h] - [x_0] - [x_0+h]$
>> ### $[x_0]$ is constant, but x is independent variable
>>> ### $ f(x_0) = f(x_0) + (x-x_0)\,f'(x_0) + \frac{(x-x_0)^2}{2!}f''(x_0) + \frac{(x-x_0)^3}{3!}f^{(3)}(x_0) + ...$ 
>> ### $[x_0 + h]$ - substitude $x$ to $[x_0 + h]$
>>> ### $ f(x_0 + h) = f(x_0) + (x_0+h - x_0)f'(x_0) + \frac{((x_0 + h)  - x_0)^2}{2!}f''(x_0) + \frac{((x_0+h)-x_0)^3}{3!}f^{(3)}(x_0) + ...$ 
>>> ### $ f(x_0 + h) = f(x_0) + hf'(x_0) + \frac{h^2}{2!}f''(x_0) + \frac{h^3}{3!}f^{(3)}(x_0) + ...$ 
>> ### gneralization
>>> ### $ f(x+h) = f(x) + h\, f'(x) + \frac{h^2}{2!}f''(x) + \frac{h^3}{3!}f^{(3)}(x) + ...$ 
> ### $\because f(x+h) - f(x) = h f'(x) + \frac{h^2}{2!}f''(x) + \frac{h^3}{3!}f^{(3)}(x) + ... $ 
> ### $ h = \Delta x$
> ### $ \because \color{magenta} {\Delta f} = f(\color{magenta} {x+h}) - f(\color{magenta}{x}) = \color{magenta} {\Delta{x}} f'(x) + \frac{\color{magenta}{\Delta {x}^2}}{2!}f''(x) + \frac{\color{magenta}{\Delta{x}^3}}{3!}f^{(3)}(x) \, + ... $ 

# [Taylor series](https://www.youtube.com/watch?v=of6_jCLW5HI&list=PLxjFN6S-kT9-BUCQ0oTKW1X6KG2gkomwp&index=62&t=558s)
## $f(x,y,z) = \begin{cases}
f(a,b,c)\: + 
\\
\frac{(x-a)}{1!}\; \frac{\partial f}{\partial{x}}\; \big|_{(a,b,c)}\: +\: 
\frac{(y-b)}{1!}\; \frac{\partial f}{\partial{y}}\; \big|_{(a,b,c)}\: +\: 
\frac{(z-c)}{1!}\; \frac{\partial f}{\partial{z}}\; \big|_{(a,b,c)}\: +\: 
\\
\frac{(x-a)^2}{2!}\frac{\partial^2 f}{\partial{x}^2}\,\big|_{(a,b,c)}\: +\: 
\frac{(y-b)^2}{2!}\frac{\partial^2 f}{\partial{y}^2}\,\big|_{(a,b,c)}\: +\: 
\frac{(z-c)^2}{2!}\frac{\partial^2 f}{\partial{z}^2}\,\big|_{(a,b,c)}\: +\: 
\frac{(x-a)(x-b)}{2!}\frac{\partial f}{\partial{x}}\, \frac{\partial f}{\partial{y}}\,\big|_{(a,b,c)}\: +\: 
\\
\frac{(x-a)^3}{3!}\frac{\partial^3 f}{\partial{x}^3}\,\big|_{(a,b,c)}\: +\: 
\frac{(y-b)^3}{3!}\frac{\partial^3 f}{\partial{y}^3}\,\big|_{(a,b,c)}\: +\: 
\frac{(z-c)^3}{3!}\frac{\partial^3 f}{\partial{z}^3}\,\big|_{(a,b,c)}\: +\: \dots 
\end{cases}
$

> ## $ \text{such that }\begin{cases} 
\delta x = x-a\\
\delta y = y-b\\
\delta z = z-c\\
\end{cases}$
> ### $
df = f(x,y,z) - f(a,b,c) \\
\quad =\frac{(x-a)}{1!}\frac{\partial f}{\partial x}\big|_{(a,b,c)} 
+
\frac{(y-b)}{1!}\frac{\partial f}{\partial y}\big|_{(a,b,c)}
+
\frac{(z-c)}{1!}\frac{\partial f}{\partial z}\big|_{(a,b,c)}
+
\frac{(x-a)^2}{2!}\frac{\partial^2f}{\partial x^2}\big|_{(a,b,c)}
+
\frac{(y-b)^2}{2!}\frac{\partial^2f}{\partial y^2}\big|_{(a,b,c)}
+
\frac{(z-c)^2}{2!}\frac{\partial^2f}{\partial z^2}\big|_{(a,b,c)}\\
\quad =\frac{dx}{1!}\frac{\partial f}{\partial x}\big|_{(a,b,c)} 
+
\frac{dy}{1!}\frac{\partial f}{\partial y}\big|_{(a,b,c)}
+
\frac{dz}{1!}\frac{\partial f}{\partial z}\big|_{(a,b,c)}
+
\frac{(dx)^2}{2!}\frac{\partial^2f}{\partial x^2}\big|_{(a,b,c)}
+
\frac{(dy)^2}{2!}\frac{\partial^2f}{\partial y^2}\big|_{(a,b,c)}
+
\frac{(dz)^2}{2!}\frac{\partial^2f}{\partial z^2}\big|_{(a,b,c)}
\\
\quad =\frac{dx}{1!}\frac{\partial f}{\partial x}\big|_{(a,b,c)} 
+
\frac{dy}{1!}\frac{\partial f}{\partial y}\big|_{(a,b,c)}
+
\frac{dz}{1!}\frac{\partial f}{\partial z}\big|_{(a,b,c)}
+ \dots
\\
\quad = 
(\frac{\partial f}{\partial x}, 
\frac{\partial f}{\partial y}, 
\frac{\partial f}{\partial z}) \cdot (dx, dy, dz) \\
\quad = 
(\frac{\partial }{\partial x}f, 
\frac{\partial }{\partial y}f, 
\frac{\partial }{\partial z}f) \cdot (dx, dy, dz) \\
\quad = 
(\frac{\partial }{\partial x}, 
\frac{\partial }{\partial y}, 
\frac{\partial }{\partial z})f \cdot (dx, dy, dz) \\
\begin{cases}
\quad \because \nabla = 
(\frac{\partial}{\partial x}, 
\frac{\partial}{\partial y}, 
\frac{\partial}{\partial z}) \\
\nabla f \cdot (dx,dy,dz) \\
\nabla f \cdot d\vec{r} \\
\quad d\vec{r} = \text{ 쬐끔 변하는 방향벡터}
\end{cases}
$

## Del() nabla ($\nabla$)
> sympy.vector.Del()
>> sympy.vector.Del(f),...dot(u), ..cross(u)
>>> where, u is potential field vector, f is scalar function

> ### $ \nabla = \; <
\frac{\partial}{\partial x_0},
\frac{\partial}{\partial x_1},
\frac{\partial}{\partial x_2},
\frac{\partial}{\partial x_3},
\dots>
$ 
>> ### $\nabla f(x,y,z) = [f(x,y,z)_x, f(x,y.z)_y, f(x,y,z)_z]$
>>> ### $ \because f(x,y,z) \text{ is scalar function}$
>> ### $\nabla \cdot f(x,y,z) = <g(t)_x, h(t)_y, k(t)_z>$
>>> #### $ \because f(x,y,z) \begin{cases} x=g(t),\\y=h(t),\\z=k(t)\end{cases}
\text{ is vector function of parameterized}$

## Gradient ($\nabla f$)
> ## f is scalar function
>> ## the result turns out a vector
> ## sympy.vector.Del(f)
>> $\therefore  f $ has to return a real number

---
# 전미분 (df)
> ## $ df =  \frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy + \frac{\partial f}{\partial z}dz$
>> ## $ (\frac{\partial f}{\partial x} , \frac{\partial f}{\partial y} , \frac{\partial f}{\partial z}) \cdot (dx,dy,dz)$
>> ## $ (\frac{\partial}{\partial x} , \frac{\partial}{\partial y} , \frac{\partial}{\partial z})f \cdot (dx,dy,dz)$
>> ## $ (\frac{\partial}{\partial x} , \frac{\partial}{\partial y} , \frac{\partial}{\partial z})f \cdot d\vec{r}$
>> ## $ \nabla f \cdot d\vec{r} $

> ## 전미분에서 방향 벡터를 제거하면 그래디언트  
>> ## $\nabla f \cdot d\vec{r} \Rightarrow  \nabla f\\
\because \nabla f = (\frac{\partial}{\partial x} , \frac{\partial}{\partial y} , \frac{\partial}{\partial z})f  $
> ## 그래디언트에서 포텐셜 필드 함수를 빼내고 나면 델(nabla)가 된다.
>> ## $\nabla f \cdot d\vec{r} \Rightarrow \nabla f \Rightarrow \nabla \\
\because \nabla  = (\frac{\partial}{\partial x} , \frac{\partial}{\partial y} , \frac{\partial}{\partial z})  $
---

# Directional Derivative
> ## $ \nabla_v f(x) = \nabla f(x) \cdot \vec{v}
$
>> ### 함수 f가 어떤 포인트에서 벡터 v방향으로 움직일때 그 지점에서 함수의 도함수(기울기,함수값의 변화율)를 구하려는 것임
> ## $ \nabla_v f(x) = \nabla f(x) \cdot \frac{\vec{v}}{||\vec{v}||}
$
> ## $ \quad \text{ where } \vec{u} = <a,b,c>, \\
\nabla_uf(x_0,x_1,x_2) 
= 
\lim\limits_{h\to0}
\frac{f(x_0 + h_a,\; x_1+h_b,\; x_2h_c) - f(x_0,\;x_1,\;x_2)}{h} \\
\quad = f_{x_0}a + f_{x_1}b + f_{x_2}c \\
\quad = \;< f_{x_0}, \;f_{x_1}, \; f_{x_2}> \cdot < a,\; b,\; c > \\
\quad = \;< 
\frac{\partial}{\partial x_0}, 
\frac{\partial}{\partial x_0}, 
\frac{\partial}{\partial x_0}>
f(x_0,\;x_1\;,x_2) \; \cdot < a,\; b,\; c >
\\
$
> ## $ \quad \text{ restriction to a unit vector } \vec{u} = <a,b,c>, \\
\nabla_{\hat{u}}f(x_0,x_1,x_2) 
= 
\lim\limits_{h\to0}
\frac{f(x_0 + h_a,\; x_1+h_b,\; x_2h_c) - f(x_0,\;x_1,\;x_2)}{h|v|}
$

> # $ D_uf(x,y) = \lim\limits_{h\to 0} \frac{f(x+hcos\theta,\; y + hsin\theta) - f(x,y)}{h}$
> [link](https://www.youtube.com/watch?v=r0NL1s6urhs)
>> ### if $\theta = 0$ then $D_uf(x,y) = f_x $  
>> ### if $\theta = \frac{\pi}{2}$ then $D_uf(x,y) = f_y$

# [problem](https://www.youtube.com/watch?v=H2eND512nQQ&t=596s)

> ## $ f(x,y) = x^2y^3 - 4y, \quad  v=<2,5> $ 
> ## find $ D_{u}F(3,-1) $
> ## $\vec{v}$ 방향으로 함수 f가 <3,-1> 지점에서 도함수를 구하라


```python
# https://www.youtube.com/watch?v=H2eND512nQQ&t=596s
# f(x,y) = x^y^3 - 4y v=<2,5> find D_{u}F(3,-1)
## \vec{v} 방향으로 함수f가 <3,-1> 지점에서 도함수를 구하라
import sympy as sm
import sympy.vector
B = sm.vector.CoordSys3D('')
n,x,y,z = sm.symbols('n x y z')

f = B.x**2 * B.y**3 - 4*B.y

# u vector and matrix
um = sm.Matrix([3, -1, 0])
uv = sm.vector.matrix_to_vector(umat,B)
# normal u vector and matirx
uvn = uvec/sm.sqrt(uvec.dot(uvec))
umn = umat/sm.sqrt(umat.dot(umat)) 

# \nabla f(x,y) = gradient
nabla = sm.vector.Del()
nabla.gradient(f).doit()

# gradient = f_x + f_y + f_z
gradient = sm.Matrix([f.diff(B.x), f.diff(B.y), f.diff(B.z)])
grad = gradient.subs({B.x:3,B.y:-1,B.z:0})

# \nabla f(x,y)|_{x=3,y=-1,z=0} \iff matrix.subs|_{}
nabla.gradient(f).subs({B.x:3,B.y:-1,B.z:0}).doit()
nabla.gradient(f).subs({B.x:3,B.y:-1,B.z:0}).doit().dot(uvn)
gradient.subs({B.x:3,B.y:-1,B.z:0}).dot(umn)
```




$\displaystyle - \frac{41 \sqrt{10}}{10}$



# Mean value theorem $\iff$ total derivative
> ## $ f'(c) = \frac{f(b)-f(a)}{(b-a)}$
>> ## $ \quad a < c < b$
>> ## $ f'(c)(b-a) = f(b) - f(a)$
>> ## $ f'(c)(b-a) + f(a) = f(b)$
> ## $\therefore f(b) = f(a) + f'(c)(b-a)$
> ## $\therefore f(a+h) = f(a) + f'(a+(c-a))h, $
> ## $\therefore f(x + \Delta x) = f(x) + f'(x+\Delta x - \epsilon_0)\Delta x$
> ## $\therefore f(x + dx) \approx f(x) + f'(x)\;dx$
> ## $\therefore df \approx f'(x)\;dx$


# Sequences and Series
> ## $$ \sum_{n=0}^{\infty}\frac{6}{4^n}$$


```python
sm.Sum(6/4**n,(n,0,sm.oo))
```




$\displaystyle \sum_{n=0}^{\infty} 6 \cdot 4^{- n}$




```python
sm.Sum(6/4**n,(n,0,sm.oo)).doit()
```




$\displaystyle 8$



> ## approximation = n()
>> n() : n is acronym of number
>> ## $$ \sum_{n=1}^{\infty} \frac{tan^{-1}(n)}{n^{1.1}}$$


```python
eq = sm.atan(n) / n**sm.Rational(11,10)
eq
```




$\displaystyle \frac{\operatorname{atan}{\left(n \right)}}{n^{\frac{11}{10}}}$




```python
sm.Sum(eq,(n,1,sm.oo)).doit()
```




$\displaystyle \sum_{n=1}^{\infty} \frac{\operatorname{atan}{\left(n \right)}}{n^{\frac{11}{10}}}$




```python
sm.Sum(eq,(n,1,sm.oo)).n()
```




$\displaystyle 15.3028821020457$




```python
import sympy as sm
x,a = sm.symbols('x a')
f = sm.symbols('f',cls=sm.Function)
sm.series(f(a-x),x,a,6,"+")
```




$\displaystyle f{\left(0 \right)} - \left(- a + x\right) \left. \frac{d}{d \xi} f{\left(\xi \right)} \right|_{\substack{ \xi=0 }} + \frac{\left(- a + x\right)^{2} \left. \frac{d^{2}}{d \xi^{2}} f{\left(\xi \right)} \right|_{\substack{ \xi=0 }}}{2} - \frac{\left(- a + x\right)^{3} \left. \frac{d^{3}}{d \xi^{3}} f{\left(\xi \right)} \right|_{\substack{ \xi=0 }}}{6} + \frac{\left(- a + x\right)^{4} \left. \frac{d^{4}}{d \xi^{4}} f{\left(\xi \right)} \right|_{\substack{ \xi=0 }}}{24} - \frac{\left(- a + x\right)^{5} \left. \frac{d^{5}}{d \xi^{5}} f{\left(\xi \right)} \right|_{\substack{ \xi=0 }}}{120} + O\left(\left(- a + x\right)^{6}; x\rightarrow a\right)$



# [Tayloar series]( https://www.youtube.com/watch?v=UT4QY-H4Dyk&list=PLIxff5DJJR7oBEy0Kdg12WWSlS6XFtr6r&index=18)
> ### $
f(x+hx, y+hy) = 
f(x,y) + 
\Big(hx \frac{\partial f}{\partial x} + hy \frac{\partial f}{\partial y}\big) +
\frac{1}{2}\Big({hx}^2 \frac{\partial^2 f}{\partial x^2} + 
2{hx}^2{hy}^2 \frac{\partial^2 f}{\partial x \partial y} + 
{hy}^2 \frac{\partial^2 f}{\partial y^2} \Big) + ...
$
> ### $
f(x+hx, y+hy) =  f(x,y) + 
\begin{bmatrix}
\frac {\partial f}{\partial x} & \frac{\partial f}{\partial y}
\end{bmatrix} 
\begin{bmatrix} hx \\ hy \end{bmatrix}
+ \frac{1}{2}
\begin{bmatrix} hx & hy \end{bmatrix}
\begin{bmatrix}
\frac{\partial^2 f}{\partial x^2}  & \frac{\partial^2 f}{\partial x \partial y} \\ 
\frac{\partial^2 f}{\partial y \partial x}  & \frac{\partial^2 f}{\partial y^2}
\end{bmatrix} 
\begin{bmatrix} hx \\ hy \end{bmatrix}
$

# 독립변수 미소 변화량 
>> ### $ d = \begin{bmatrix}hx \\ hy  \end{bmatrix}$

# gradient matrix
>> ### $ g = \frac{\partial f}{\partial \vec{x}} 
= 
\Big(
\frac{\partial f}{\partial x_i} 
\Big)$

>> ### $ df = g^T[d\vec{x}]$

# Hesian matrix
> ### $
H = \frac{\partial^2 f}{\partial \vec{x} \partial \vec{x}} 
= \Big(\frac{\partial^2 f}{\partial x_i \partial x_j}\Big)
=
\begin{bmatrix}
\frac{\partial^2 f}{\partial x^2} & 
\frac{\partial^2 f}{\partial x \partial y }\\
\frac{\partial^2 f}{\partial y \partial x } & 
\frac{\partial^2 f}{\partial y2}\\
\end{bmatrix}
$
> ### $ df = [d\vec{x}]^TH[d\vec{x}]$

# $ 
f(x+d) = f(x) + \Big( \frac{\partial f}{\partial\vec{x}}\Big)^T d + d^THd
$
# $ 
f(x+dx) = f(x) + \Big( \frac{\partial f}{\partial\vec{x}}\Big)^T dx + (dx)^TH(dx)
$

# Multi function
> ## multi independent variable
>> ### $x = \begin{bmatrix} x \\ y \end{bmatrix}$

> ## multi dependent variable
>> ### $ f = \begin{bmatrix} f_1 \\ f_2\end{bmatrix}$
> ### $
df_1(x,y) = 
\frac{\partial f_1}{\partial x}dx + 
\frac{\partial f_1}{\partial y}dy$

> ### $ 
df_2(x,y) = 
\frac{\partial f_2}{\partial x}dx + 
\frac{\partial f_2}{\partial y}dy$

> ### $\begin{bmatrix} df_1 \\ df_2 \end{bmatrix}
= \begin{bmatrix} 
\frac{\partial f_1}{\partial x} &
\frac{\partial f_1}{\partial y} \\
\frac{\partial f_2}{\partial x} &
\frac{\partial f_2}{\partial y}
\end{bmatrix} 
\begin{bmatrix} 
dx \\  dy
\end{bmatrix}$

> ### $ \frac{\partial \vec{f}}{\partial \vec{x}}
= \Big( \frac{\partial f_i}{\partial x_j} \Big)
= \begin{bmatrix} 
\frac{\partial f_1}{\partial x_1} &
\frac{\partial f_1}{\partial x_2} \\
\frac{\partial f_2}{\partial x_1} &
\frac{\partial f_2}{\partial x_2}
\end{bmatrix} $

# Jacobian
> ### $ J = \frac{\partial \vec{f}}{\partial \vec{x}}
= \Big( \frac{\partial f_i}{\partial x_j}\Big)$
> ### $ [d\vec{f}] = J[d \vec{x}]$

# gradient in n-space
>### $
d\vec{r} = \vec{e}_1dx_1 + \vec{e}_2dx_2 + ... + \vec{e}_ndx_n,
\quad \vec{e}_i\cdot \vec{e}_j = \delta_{ij}$
> ### $
f(\vec{r} + d\vec{r}) = f(\vec{r}) + dx_1\frac{\partial f}{\partial x_1} + 
dx_2\frac{\partial f}{\partial x_2} + ... + 
dx_n\frac{\partial f}{\partial x_n} \\
= f(\vec{r}) + d\vec{r}\cdot \frac{\partial f}{\partial \vec{r}} + ...
$
> ### $
\frac{df}{d\vec{r}} = \frac{d}{d\vec{r}}(f) = \Big(\vec{e}_1 \frac{\partial}{\partial x_1} + \vec{e}_2 \frac{\partial}{\partial x_2}+...+ \vec{e}_n \frac{\partial}{\partial x_n}  \Big)(f) = \nabla f
$

# $ \nabla f = \frac{df}{dr} \\ \therefore d = dr \cdot \nabla$



```python

```

5ce5371943aaa03e908095d54545ceefd2ee15dd
ipynb
Jupyter Notebook
python/TaylorSeries.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/TaylorSeries.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/TaylorSeries.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
Qwen/Qwen-72B
1. YES
2. YES