# [SymPy](http://www.sympy.org/en/index.html)
A Python library for symbolic mathematics. Among others things, it provides:
1. [Symbolic simplification](http://docs.sympy.org/latest/tutorial/simplification.html).
2. [Calculus (derivatives, integrals, limits, and series expansions)](http://docs.sympy.org/latest/tutorial/calculus.html).
3. [Algebraic solver](http://docs.sympy.org/latest/tutorial/solvers.html).
4. [Matrix operations](http://docs.sympy.org/latest/tutorial/matrices.html).
5. [Combinatorics](http://docs.sympy.org/latest/modules/combinatorics/index.html)
6. [Cryptography](http://docs.sympy.org/latest/modules/crypto.html).

<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Example" data-toc-modified-id="Example-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Example</a></span></li></ul></div>

## Example


```python
try:
    from sympy import init_session
except:
    !pip3 install sympy
    from sympy import init_session

init_session(use_latex='matplotlib')
```

    IPython console for SymPy 1.5.1 (Python 3.7.7-64-bit) (ground types: python)
    
    These commands were executed:
    >>> from __future__ import division
    >>> from sympy import *
    >>> x, y, z, t = symbols('x y z t')
    >>> k, m, n = symbols('k m n', integer=True)
    >>> f, g, h = symbols('f g h', cls=Function)
    >>> init_printing()
    
    Documentation can be found at https://docs.sympy.org/1.5.1/
    



```python
# https://github.com/AeroPython/Taller-Aeropython-PyConEs16
expr = cos(x)**2 + sin(x)**2
expr
```


```python
simplify(expr)
```


```python
expr.subs(x, y**2)
```


```python
expr = (x + y) ** 2
expr
```


```python
expr = expr.expand()
expr
```


```python
expr = expr.factor()
expr
```


```python
expr = expr.integrate(x)
expr
```


```python
expr = expr.diff(x)
expr
```

10f863d2f5d7dd7c638af590fc524428e2757ff1
ipynb
Jupyter Notebook
scientific_computation/sympy.ipynb
vicente-gonzalez-ruiz/python-tutorial
e6a79510a0b3663786d6476a40e79fc8e8726f61
CC0-1.0
2017-03-06T09:49:11.000Z
2019-10-16T00:09:38.000Z
scientific_computation/sympy.ipynb
vicente-gonzalez-ruiz/python-tutorial
e6a79510a0b3663786d6476a40e79fc8e8726f61
CC0-1.0
scientific_computation/sympy.ipynb
vicente-gonzalez-ruiz/python-tutorial
e6a79510a0b3663786d6476a40e79fc8e8726f61
CC0-1.0
2017-11-02T11:00:30.000Z
2020-01-31T22:41:27.000Z
Qwen/Qwen-72B
1. YES
2. YES