```python
import sympy as sy

sy.init_printing()
```

## 2 equations, 2 unknowns


```python
x, y = sy.symbols('x y')
a, b, c, d = sy.symbols('a b c d')

eq1 = sy.Eq(a*x + b*y + 2, 0)
eq2 = sy.Eq(c*x + d*y - 2, 0)

sol = sy.solve((eq1, eq2), (x, y))
sol
```

## Try subscripts


```python
x, y = sy.symbols('x_mz y_ny')
a, b, c, d = sy.symbols('a_1 b_2 c_3 d_4')

eq1 = sy.Eq(a*x + b*y + 2, 0)
eq2 = sy.Eq(c*x + d*y - 2, 0)

sol = sy.solve((eq1, eq2), (x, y))
sol
```

## 3 equations, 3 unknowns


```python
x, y, z = sy.symbols('x y z')
a, b, c, d, e, f, g, h, i, j = sy.symbols('a b c d e, f, g, h, i, j')

eq1 = sy.Eq(a*x + b*y + c*z + 2, 0)
eq2 = sy.Eq(d*x + e*y + f*z - 2, 0)
eq3 = sy.Eq(g*x + h*y + i*z, 0)

sol = sy.solve((eq1, eq2, eq3), (x, y, z))
sol
```


```python
sol[x]
```


```python

```

97f0b1e4177b413638fd04a9f7cbb550bff65e42
ipynb
Jupyter Notebook
python/sympy.ipynb
gregnordin/python-notes_to_self
6458271d585f5beabfd18577290de64b82666018
MIT
2017-04-18T18:41:44.000Z
2022-03-19T20:18:25.000Z
python/sympy.ipynb
gregnordin/python-notes_to_self
6458271d585f5beabfd18577290de64b82666018
MIT
2021-03-30T13:50:55.000Z
2022-01-13T02:54:45.000Z
python/sympy.ipynb
gregnordin/python-notes_to_self
6458271d585f5beabfd18577290de64b82666018
MIT
2021-05-07T19:20:08.000Z
2021-11-11T20:37:57.000Z
Qwen/Qwen-72B
1. YES
2. YES