I am trying to use sagetex to calculate some limits and it is having difficulties with the branch cuts for roots. Specifically, things like (-1)^(1/3) won't simplify to -1, presumably because it's on the branch cut. All the limits that I want to calculate are for real valued functions, but I can't seem to figure out how to convince sagetex that is the case. I can use
assume(x,'real')
But this only tells sagetex that the input is real, so it still doesn't assume the output is real. This command won't work on the function itself.
For example;
\documentclass{article}
\usepackage{sagetex}
\begin{document}
\begin{sagesilent}
f(x) = (x + 1)/(x^(1/3)+1)
ans=limit(f(x), x=-1)
\end{sagesilent}
\sage{ans}
\end{document}
Running this gives an output of 0, when in fact the limit should be 3 (using sum of cubes). I can only assume this is a result of the branch cut issue as it only happens on negative reals.
Is there a way to redefine the branch cut, or better yet, tell sagetex that f is a real valued function and to use the real valued cube root and not the complex one?