Right, we need to be careful about infinite solutions. solve()
currently doesn't handle them, but it one day will.
I think the solution is to just have it return a Set object. Sets are
pretty advanced by now so that they can represent things like log(x) +
n*pi*I or asin(x) + 2*n*pi, for n integer. If there is just one
inverse, it can just return a singleton set. For now, solve() will
just have to pick one element or something until we make it capable of
returning Set objects itself.
As for multiargument functions, we can model it against fdiff, which
also handles multiple arguments.
We might also think of other ways that we could let users extend solve
via API. For example, something like the LambertW is the inverse of
x*exp(x). Obviously we could set the inverse of LambertW and make
solve(LambertW(x) - y, x) work, but how could we make solve(x*exp(x) -
y, x) work, without modifying the solve code (yes, I know this already
works, but I mean imagine for a function like LambertW that isn't
implemented already).
Aaron Meurer