Say I have two symbolic expressions:
a = symbols("a")
thing = symbols("2*a**2")
If one then calls a.free_symbols()
one gets {a}
, and for thing.free_symbols()
one gets {2*a**2}
.
Is there a way to format the object thing
such that I get the equivalent expression but with eq_expr.free_symbols() = {a}
?