Jupyter Snippet CB2nd 02_solvers
Jupyter Snippet CB2nd 02_solvers
15.2. Solving equations and inequalities
from sympy import *
init_printing()
var('x y z a')
solve(x**2 - a, x)
x = Symbol('x')
solve_univariate_inequality(x**2 > 4, x)
solve([x + 2*y + 1, x - 3*y - 2], x, y)
solve([x**2 + y**2 - 1, x**2 - y**2 - S(1) / 2], x, y)
solve([x + 2*y + 1, -x - 2*y - 1], x, y)
var('a b c d u v')
M = Matrix([[a, b, u], [c, d, v]])
M
solve_linear_system(M, x, y)
det(M[:2, :2])