diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py index 3ae4743a745a..ccfcfbc05e6b 100644 --- a/sympy/solvers/solvers.py +++ b/sympy/solvers/solvers.py @@ -452,18 +452,26 @@ def solve(f, *symbols, **flags): >>> solve(x < 3) And(-oo < x, x < 3) + * to always get a list of solution mappings, use flag dict=True >>> solve(x - 3, dict=True) [{x: 3}] - >>> solve([x - 3, y - 1], dict=True) + >>> sol = solve([x - 3, y - 1], dict=True) + >>> sol [{x: 3, y: 1}] + >>> sol[0][x] + 3 + >>> sol[0][y] + 1 + * to get a list of symbols and set of solution(s) use flag set=True >>> solve([x**2 - 3, y - 1], set=True) ([x, y], {(-sqrt(3), 1), (sqrt(3), 1)}) + * single expression and single symbol that is in the expression >>> solve(x - y, x) diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py index 791b491664b2..83d5ebbeb5f6 100644 --- a/sympy/solvers/solveset.py +++ b/sympy/solvers/solveset.py @@ -1293,6 +1293,8 @@ def linsolve(system, *symbols): return solution + + ############################################################################## # ------------------------------nonlinsolve ---------------------------------# ##############################################################################