# Symbolic Computation with SymPy (Incomplete)

As humans we manipulate and compute with mathematical expressions fluidly, but you may realize that abstract manipulation is not so simple for computers. People have built some very complex computer algebra systems but imagine just how involved the system that can rectify

$$\cos x - \sqrt{3}\sin x  = 2\sin(x+2\pi/3)$$

Such an open source system is called [SymPy](https://www.sympy.org/en/index.html). Feel free to explore their [tutorial](https://docs.sympy.org/latest/tutorial/index.html#tutorial) if you want to dive deeper than this brief intro.


```python
# WARNING! Importing everything with * from a python module is generally a BAD idea. 
# You may not realize what you are overwriting. We're just playing around in this notebook so it is ok.

from sympy import *
```

First up, we need to tell sympy what variables we're using. The `var` function does this. 


```python
# error if executed before declaration
x
```




$\displaystyle x$




```python
x,y,z,t,r,th = var("x y z t r theta")
```


```python
type(x)
```




    sympy.core.symbol.Symbol



SymPy knows how to assemble ex


```python
x**2
```




$\displaystyle x^{2}$




```python
sin(th)
```




$\displaystyle \sin{\left(\theta \right)}$




```python
type(sin)
```




    sympy.core.function.FunctionClass




```python
sqrt(0-1)
```




$\displaystyle i$




```python
1j
```




    1j




```python

```

dd52156a1f509ce5318241d27f57a1b66299d16a
ipynb
Jupyter Notebook
tutorial/MVC with Jupyter - Symbolic computation.ipynb
drewyoungren/mvc
f5217ae7888050d722c66de95756586f662841d2
MIT
tutorial/MVC with Jupyter - Symbolic computation.ipynb
drewyoungren/mvc
f5217ae7888050d722c66de95756586f662841d2
MIT
tutorial/MVC with Jupyter - Symbolic computation.ipynb
drewyoungren/mvc
f5217ae7888050d722c66de95756586f662841d2
MIT
Qwen/Qwen-72B
1. YES
2. YES