Reputation: 1219
Using SymPy, can I automatically simplify something like this:
sqrt(a**2 + 2ab + b**2)
to:
[(a+b), -(a+b)]?
Upvotes: 1
Views: 385
Reputation: 19057
Perhaps something like:
>>> var('a b',positive=True)
(a, b)
>>> solve(x**2-(a**2 + 2*a*b + b**2), x)
[-a - b, a + b]
Upvotes: 1