On Apr 23, 10:44 am, Benjamin Jones <
benjaminfjo...@gmail.com> wrote:
> The `symbolic_inverse` function you posted on ask.sagemath looks good.
> I might suggest catching the RuntimeError when no roots are found and
> raising a more informative error, e.g. "Sage could not find a symbolic
> inverse" ...
I am thinking about directly using "solve()", rather than "roots()",
to implement "inverse()". That way I can raise my own exception.
Another consideration is whether we want to let "inverse()" itself be
representable as a symbolic expression. I need to learn about how this
works in Sage, but I am referring to the behavior of "integral()" when
it can't integrate something. For example:
sage: Ei(x).integral(x)
integrate(Ei(x), x)
sage: Ei(x).integral(x).diff(x)
Ei(x)
In the case of "inverse()", this might look like:
sage: f(x) = x + sin(x)
sage: f.inverse(x)
inverse(x + sin(x), x)
sage: f(f.inverse(x))
x + sin(x)
Then this can be used to allow Sage to apply the inverse function
theorem[1], for example.
I have a lot to learn about how symbolics works in Sage before I can
work on this. Maybe the easier route would be not to let inverse() be
representable as a symbolic expression and simply raise an exception
if Maxima's "solve()" fails. Later down the line, I might be able to
do something fancier.
I would like to know whether letting inverse() "play" with the
symbolics as outlined above is desirable.
[1]
http://en.wikipedia.org/wiki/Inverse_function_theorem
-- Kelvin