# Calculus Examples



```python
# import symbolic capability to Python
from sympy import *
```


```python
# print things all pretty
from sympy.abc import *
init_printing()
```


```python
# Need to define variables as symbolic for sympy to use them. 
x, y= symbols("x, y", real = True)
```


```python
diff((3*x**4+5)**3,x)
```


```python
diff((5*x**3+2)**4,x)
```


```python
simplify(diff((3*x-2)/(2*x+1),x))
```


```python
simplify(diff((1-x)/(2*x+1),x))
```


```python
simplify(diff((0*x-2)/(3-x**2),x))
```


```python
simplify(diff((-1)/(2*x**2+1)**3,x))
```


```python
simplify(diff((x+1)**3/(x-1)**3,x))
```


```python
simplify(diff(sqrt(6*x-2),x))
```


```python
simplify(diff(2*x*sqrt(3*x-1),x))
```


```python
diff(sqrt(x)+1/2/sqrt(x),x)
```


```python
simplify(diff(x**(5/2),x))
```


```python
simplify(diff(sqrt(t+sqrt(t)),t))
```


```python
simplify(diff((3-2*x+x**3)*(x**4+7),x))
```


```python
simplify(diff((t**3+1)*(t**2+t+1),t))
```


```python
(diff((-3*x**5+1)**4*(2-x**3)**5,x))
```


```python
simplify(diff((t**2-5)/(t**2+5),t))
```


```python
simplify(diff((x**3-2*x+5)/(x**2+4),x))
```


```python
simplify(diff((2*x-7)**3/(x-1)**5,x))
```


```python
simplify(diff(((2*t+1)/(2*t-1))**3,t))
```


```python
a = simplify(diff((-3)/(3*x**5-2*x+7)**11,x))
a
```


```python
a == 33*(3*x**5-2*x+7)*(15*x**4-2)/(3*x**5-2*x+7)**22
```




    False



but that was way too easy. 

We could compare them, just to be sure they are the same


```python
simplify(diff(y,x))==simplify(diff(ln(y),x)*y)
```




    True



Or plot this monstrosity


```python
plot((diff(y,x),(x,0.2,10)), (y, (x,0.5,10)))
```


```python
# To change colors
# show = False delays the plot until we can set all of the parameters
# legend turns on the legend and uses the labels we have later. 
p = plot((diff(y,x),(x,0.2,10)), (y, (x,0.5,10)), show = False, legend = True)
p[0].line_color = 'blue'
p[0].label = '$\\frac{dy}{dx}$'
p[1].line_color = 'green'
p[1].label = '$y$'
p.show()
```

What if we wanted to make a substitution?


```python
y.subs(x,alpha)
```


```python

```

3ee7592433348090915f42dc86c7ee9041978bfa
ipynb
Jupyter Notebook
Calc_Review.ipynb
josephcslater/JupyterExamples
4f2af75b9fda80dcab6cac0b9210713eeb703839
BSD-3-Clause
Calc_Review.ipynb
josephcslater/JupyterExamples
4f2af75b9fda80dcab6cac0b9210713eeb703839
BSD-3-Clause
Calc_Review.ipynb
josephcslater/JupyterExamples
4f2af75b9fda80dcab6cac0b9210713eeb703839
BSD-3-Clause
2020-02-07T20:28:39.000Z
2020-02-07T20:28:39.000Z
Qwen/Qwen-72B
1. YES
2. YES