How about SymPy? Their solver looks like what you need. Have a look at their source code if you want to build the library yourself…
How about SymPy? Their solver looks like what you need. Have a look at their source code if you want to build the library yourself…