# 15.2. Solving equations and inequalities

https://ipython-books.github.io/152-solving-equations-and-inequalities/


## Ref

* SymPy Matrix guide at http://docs.sympy.org/latest/modules/matrices/matrices.html).
* Linear algebra on Wikipedia, at https://en.wikipedia.org/wiki/Linear_algebra#Further_reading
* Linear algebra on Wikibooks, at http://en.wikibooks.org/wiki/Linear_Algebra
* Linear algebra lectures on Awesome Math, at https://github.com/rossant/awesome-math/#linear-algebra


```python
from sympy import *
init_printing()
```


```python
var('x y z a')
```


```python
solve(x**2 - a, x)
```


```python
type(x)
```




    sympy.core.symbol.Symbol




```python
x = Symbol('x')
solve_univariate_inequality(x**2 > 4, x)
```


```python
x + 2*y + 1, x - 3*y - 2
```


```python
solve([x + 2*y + 1, x - 3*y - 2], x, y)
```


```python
solve([x + 2*y + 1, -x - 2*y - 1], x, y)
```


```python
solve([x**2 + y**2 - 1, x**2 - y**2 - S(1) / 2], x, y)
```


```python
var('a b c d u v')
```


```python
M = Matrix([[a, b, u], [c, d, v]])
M
```




$$\left[\begin{matrix}a & b & u\\c & d & v\end{matrix}\right]$$




```python
solve_linear_system(M, x, y)
```


```python
M[:2, :2]
```




$$\left[\begin{matrix}a & b\\c & d\end{matrix}\right]$$




```python
det(M[:2, :2])
```


```python

```
