How can I solve system of linear equations in SymPy?
Sorry, I am pretty new to sympy and python in general. I want to solve the following underdetermined linear system of equations: x + y + z = 1 x + y + 2z = 3 SymPy recently got a new Linear system solver: linsolve in sympy.solvers.solveset , you can use that as follows: In [38]: from sympy import * In [39]: from sympy.solvers.solveset import linsolve In [40]: x, y, z = symbols('x, y, z') List of Equations Form: In [41]: linsolve([x + y + z - 1, x + y + 2*z - 3 ], (x, y, z)) Out[41]: {(-y - 1, y, 2)} Augmented Matrix Form: In [59]: linsolve(Matrix(([1, 1, 1, 1], [1, 1, 2, 3])), (x, y, z)) Out