## $ \nabla f \iff \text{ 공간 미분}$
## $ \overset{\cdot}{x} \iff \text{ 시간 미분}$
## $ 

# Total Derivative
> ### $$ df 
\begin{cases} 
\lim\limits_{\Delta x \to 0\\\Delta y \to 0}
\Delta f \\
\lim\limits_{\Delta x \to 0\\\Delta y \to 0}
f(x+\Delta x , y+\Delta y) - f(x,y) \\
\lim\limits_{\Delta x \to 0\\\Delta y \to 0}
f(x+\Delta x , y+\Delta y) - \big( - f(x, y + \Delta y) + f(x+\Delta y, y)\big) - f(x,y,z) \\
\lim\limits_{\Delta x \to 0\\\Delta y \to 0}
f(x+\Delta x , y+\Delta y) - f(x, y + \Delta y) + f(x+\Delta y, y)\big) - f(x,y,z) \\
\lim\limits_{\Delta x \to 0\\\Delta y \to 0}
\frac{f(x+\Delta x , y+\Delta y) - f(x, y + \Delta y)}{\Delta x}\Delta x + 
\frac{f(x+\Delta y, y)\big) - f(x,y,z)}{\Delta y}\Delta y \\
\therefore f_x(x,y)dx + f_y(x,y)dy\\
\therefore \frac{df(x,y)}{dx}dx +  \frac{df(x,y)}{dy}dy \\
\therefore \frac{d}{dx}f(x,y)dx +  \frac{d}{dy}f(x,y)dy \\
\therefore \;<\frac{d}{dx}f(x,y),  \frac{d}{dy}f(x,y)> \;\cdot < dx, dy > \\
\therefore \;<\frac{d}{dx},  \frac{d}{dy}>f(x,y) \;\cdot < dx, dy > \\
\end{cases}$$

> ### Del , nabla 
>> ### $ \nabla = \begin {bmatrix}
\frac{\partial}{\partial x_0},&
\frac{\partial}{\partial x_1},&
\frac{\partial}{\partial x_2},&...
\end{bmatrix}$
>>> ### $ \nabla \; f \cdot (dx_0, dx_1, dx_2 ..)$
>>> ### $ \nabla \; f \cdot d\vec{r}$
> ### Gradient 
>> ### $ \nabla \; f $
>> ### $ f$ is scalar function

> ### Total derivative 
>> ### $df =:\begin{cases}
\nabla \; f \cdot (dx,dy,dz)\\
\nabla \; f \cdot d\vec{r}\\
\text{f is scalar function}
\end{cases}$


```python
# find the total dervative dz/dy of z = 5x+xy+y^2, where x=3y^2 
# dz = f_x(z) * dx/dy + f_y(x)
import sympy as sm
import sympy.vector
N = sm.vector.CoordSys3D('')
A = sm.Matrix([N.x, N.y, N.z])
v = sm.vector.matrix_to_vector(A,N)
z = 5*N.x + N.x*N.y+N.y**2
g = 3*N.y**2
sm.diff(z,N.x)*sm.diff(g,N.y) + sm.diff(z,N.y).subs({N.x:3*N.y**2})
```




$\displaystyle 3 \mathbf{{y}_{}}^{2} + 6 \mathbf{{y}_{}} \left(\mathbf{{y}_{}} + 5\right) + 2 \mathbf{{y}_{}}$




```python
# find the total derivative dz/dt of z=x^2-8xy-y^3, where x=3t and y=1-t
z = N.x**2 - 8*N.x*N.y - N.y**3
t = sm.symbols('t')
x = 3*t
y = 1-t
# dz = z_x*dx/dt + z_y*dy/dt
(sm.diff(z,N.x)*sm.diff(x,t) + sm.diff(z,N.y)*sm.diff(y,t)).subs({N.x:3*t,N.y:1-t}).simplify()
```




$\displaystyle 3 t^{2} + 60 t - 21$




```python
# find the total derivative dz/dt of z = 7*u+v*t, where u=2t^2 and v=t+1
# u(t)
u = 2*t**2
# v(t)
v = t+1
# z(u,v,t)
z = 7*u+v*t
sm.diff(z,t)
```




$\displaystyle 30 t + 1$




```python
# https://www.youtube.com/watch?v=j91ijDR-YIc
# T(x,y) = 20 - 4x^2 - y^2
T = 20 - 4*N.x**2 - N.y**2
# sm.Matrix
mTg = sm.Matrix([sm.diff(T,N.x), sm.diff(T,N.y)])
# matrix_to_vector ~ to_matrix
vTg = sm.vector.matrix_to_vector(mTg, N)
mTg = mTg.subs({N.x:2,N.y:-3})
# Matrix norm()
mTg.norm()

sm.N(sm.atan(mTg.norm()))
```




$\displaystyle 1.51234242057036$




```python

```

b04a328ac565940f5a315d73365e9db4920034e0
ipynb
Jupyter Notebook
python/Vectors/TotalDeriveative.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/Vectors/TotalDeriveative.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/Vectors/TotalDeriveative.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
Qwen/Qwen-72B
1. YES
2. YES