# CAS based math program that can evaluate two sided limits? Ex:$\lim _{x\to 0}\left(\frac{1}{x}\right)=DNE$

I am new to Calculus and would like a CAS program to check my work without any hassles. I tried evaluating $\lim _{x\to 0}\left(\frac{1}{x}\right)$, a limit where the two sided limit DOES NOT EXIST in mathmatica, but it only evaluates the right side and gives me $\infty$.

Limit[1/x, x -> 0]->$\infty$

The graph of $\frac{1}{x}$ is as follows:

As you can see, the right side is $\lim _{x\to 0+}\left(\frac{1}{x}\right)=\infty$ and the left side is $\lim _{x\to 0-}\left(\frac{1}{x}\right)=-\infty$. So mathematica, just gives me the wrong answer! What CAS program do you guys suggest that would evaulate these limits correctly? One that gives me doesn't exist when the left and right side are not equal!

This is not a bug in Mathematica, it is a feature; see Examples $\to$ Scope in the Mathematica documentation for the command $\texttt{Limit[]}$.

As that documentation shows, one can compute left- and right-handed limits of real-valued functions in Mathematica respectively with the commands

Limit[1 / x, x -> 0, direction = -1]


and

Limit[1 / x, x -> 0, direction = 1]


which respectively return

-∞


and

∞


Since these limits disagree, by definition the limit (in the real sense) does not exist.

Anyway, perhaps anticipating this complaint (and presumably its disproportionate use by students relative to Mathematica), submitting the query

Limit[1 / x, x -> 0]


to WolframAlpha returns explicit, separate results for the two-sided, left-handed, and right-handed limits:

By default Maple operates the way you'd like: The command

limit(1 / x, x = 0)


returns

undefined


and one can indicate that one wants the complex interpretation of the limit with the command

limit(1 / x, x = 0, complex)


which returns the slightly peculiar output

∞ - ∞ I