<h1>Differential</h1>

<h2>1. limit</h2>


```python
import sympy as sp
```


```python
x, a, c, h, n, = sp.symbols('x a c h n')
```


```python
fx=(x**2-x-6)/(x-3)
```


```python
sp.limit(fx,x,3)
```




$\displaystyle 5$




```python
sp.limit(fx,x,3,"+")
```




$\displaystyle 5$




```python
sp.limit(fx,x,3,"-")
```




$\displaystyle 5$



<h2>2. Derivative</h2>


```python
from sympy import Derivative
```


```python
fx = x**2
```


```python
Derivative(fx,x).doit()
```




$\displaystyle 2 x$




```python
Derivative(fx,x).doit().subs({x:2})
```




$\displaystyle 4$




```python
fxr = -x+2
fxl = x**2 - x + 2
```


```python
fx0 = fxl.subs({x:0})
```


```python
fx0
```




$\displaystyle 2$




```python
sp.limit(fxr,x,0,'+')
```




$\displaystyle 2$




```python
sp.limit(fxr,x,0,'-')
```




$\displaystyle 2$




```python
sp.limit((fxr-fx0)/(x-0),x,0,'+')
```




$\displaystyle -1$




```python
sp.limit((fxr-fx0)/(x-0),x,0,'-')
```




$\displaystyle -1$




```python
fx = c
fxh = fx.subs({x:x*h})
sp.limit((fxh-fx)/h,h,0)

```




$\displaystyle 0$




```python
fx = x**3
fxh = fx.subs({x:x*h})
sp.limit((fxh - fx)/h,h,0)
```




$\displaystyle - \infty \operatorname{sign}{\left(x^{3} \right)}$




```python
Derivative(fx,x).doit()
```




$\displaystyle 3 x^{2}$




```python
fx=sp.log(x)
fxh = fx.subs({x:x*h})
sp.limit((fxh-fx)/h,h,0)
```




$\displaystyle -\infty$




```python
Derivative(fx,x).doit()
```




$\displaystyle \frac{1}{x}$




```python
fx = sp.log(x)
fxh = fx.subs({x:x*h})
sp.limit((fxh-fx)/h,h,0)
```




$\displaystyle -\infty$




```python
Derivative(fx,x).doit()
```




$\displaystyle \frac{1}{x}$




```python
fx = sp.log(x, 10)
fxh = fx.subs({x:x*h})
sp.limit((fxh-fx)/h,h,0)
```




$\displaystyle -\infty$




```python
Derivative(fx,x).doit()
```




$\displaystyle \frac{1}{x \log{\left(10 \right)}}$




```python
fx = sp.exp(x)
fxh = fx.subs({x:x*h})
sp.limit((fxh-fx)/h,h,0)
```




$\displaystyle - \infty \operatorname{sign}{\left(e^{x} - 1 \right)}$




```python
Derivative(fx,x).doit()
```




$\displaystyle e^{x}$




```python
fx = a**x
fxh = fx.subs({x:x+h})
sp.limit((fxh-fx)/h,h,0)
```




$\displaystyle a^{x} \log{\left(a \right)}$




```python
Derivative(fx,x).doit()
```




$\displaystyle a^{x} \log{\left(a \right)}$




```python

```

43502e2281d2791c01cc03f3d873e14527c2849e
ipynb
Jupyter Notebook
python/math_with_sympy.ipynb
yeonghwanchoi/TIL
9271541a2c74f3bfbc52b1a65e5221d85e0e15b5
MIT
python/math_with_sympy.ipynb
yeonghwanchoi/TIL
9271541a2c74f3bfbc52b1a65e5221d85e0e15b5
MIT
python/math_with_sympy.ipynb
yeonghwanchoi/TIL
9271541a2c74f3bfbc52b1a65e5221d85e0e15b5
MIT
Qwen/Qwen-72B
1. YES
2. YES