## Setting up python environment


```python
# reset all previously defined varibles
%reset -f

# import everything from sympy moduleb 
from sympy import *

# pretty math formatting
init_printing()   # latex
```

### Symbolic variables must be declared


```python
x,y,z = symbols('x y z')
```

###  Function definition


```python
## Example 1

f = 2*x**3  # define function
f           # print function

```


```python
## Example 2

g = x**2 + x*y**2 # define function
g           # print function
```

### Function Evaluation


```python
# f(0)
f.subs(x,0)
```


```python
# f(1)
f.subs(x,1)
```


```python
# g(x=2,y=3)
g.subs([(x,2),(y,3)])
```

## Plotting


```python
## Graph of f = x^2

f = x**2

plot(f)
```


```python
## multiple graph in same window

f = x**2
g = x**3

p = plot(f,g, (x, -2, 2),show=False, legend=True  )

p[0].line_color = 'blue'
p[1].line_color = 'green'


p[0].label      = 'f(x)'
p[1].label      = 'g(x)'
p.show()

```


```python
## undocking plots out of browser
%matplotlib qt  

f = x**2
plot(f)

```




    <sympy.plotting.plot.Plot at 0x7f5b173ce850>




```python
## forcing plots inside browser
%matplotlib inline

f = x**2
plot(f)
```


```python

```

da51b4c1101f2051f3f67d0cffc3b97abe463d2f
ipynb
Jupyter Notebook
sympy/generalCalculus.ipynb
krajit/krajit.github.io
221c8bcdf0612b3ae28c827809aa309ea6a7b0c2
MIT
2018-09-29T07:40:07.000Z
2022-02-28T22:17:04.000Z
sympy/generalCalculus.ipynb
krajit/krajit.github.io
221c8bcdf0612b3ae28c827809aa309ea6a7b0c2
MIT
2019-08-26T08:42:47.000Z
2019-08-26T09:48:21.000Z
sympy/generalCalculus.ipynb
krajit/krajit.github.io
221c8bcdf0612b3ae28c827809aa309ea6a7b0c2
MIT
2017-09-09T23:32:09.000Z
2020-01-28T21:11:39.000Z
Qwen/Qwen-72B
1. YES
2. YES