# Why are Desmos and W/A not plotting the graph correctly for a rational function?

I had this question to plot this rational fraction function:

$$y=\frac{x-2}{x^2-4}$$ With asymptotes at $x=2,-2$

Now, I did immediately realise that this could be simplified to: $$y=\frac{1}{x+2}$$

But, when one immediately simplifies it into this form, wouldn't one lose one of the asymptotes at $x=2$?

When I went to check online, on both Desmos and WolframAlpha, both gave this result (which does not have the x=2 asymptote):

This is the way I thought was correct:

I further justify myself by subbing in x = 2 into the original formula, which produces a divide by zero case.

Could someone point me in the right direction or is Desmos/Wolfram at fault here?

• There is no "$x=2$ asymptote". – Angina Seng Sep 2 '17 at 7:35
• ahh ok. I see my issue now. But perhaps it would be nice if desmos atleast put an open circle there then. – John Hon Sep 2 '17 at 7:57
• CAS were never meant to replace thought. – Did Sep 2 '17 at 8:13
• Exercise 2 Level 1 Question 1 of Dr Du homework? Not even asking on forum. Disappointed... – anonymous Sep 2 '17 at 8:46
• For future filing: the thing at $x=2$ is what's called a removable singularity. – J. M. isn't a mathematician Sep 2 '17 at 15:10

Let $f(x)=\frac{x-2}{x^2-4}$. Let us prove that there is an asymptote at $x = -2$:

$$\lim_{x\to -2^+}f(x)=\lim_{x\to -2^+}\frac{x-2}{x^2-4} = \lim_{x\to -2^+}\frac{1}{x+2} = +\infty,$$

$$\lim_{x\to -2^-}f(x)=\lim_{x\to -2^-}\frac{x-2}{x^2-4} = \lim_{x\to -2^-}\frac{1}{x+2} = -\infty.$$

However, there is actually no asymptote at $x = 2$. Your mistake is that you didn't check the limit:

$$\lim_{x\to 2}f(x)=\lim_{x\to 2}\frac{x-2}{x^2-4} = \lim_{x\to 2}\frac{1}{x+2} = \frac 14.$$

As you can see, the limit is not $\pm\infty$, which would be needed for it to be an asymptote. Actually, $f$ can be extended continuously:

$$g(x):=\begin{cases} f(x),& x\neq 2\\ \lim_{t\to 2}f(t),& x= 2\\ \end{cases}$$ and immediately it follows that $g(x) = \frac{1}{x+2}$.

This explains why the graph of $f$ looks like the graph of $g$; the only difference is that one point must be erased from the graph: $(2,\frac 14)$. If you want to emphasize it, this would be a way to do it:

If you want similar example, plot function $x\mapsto \frac{\sin x}x$ and observe that there is no asymptote at $x = 0$.

• dang, I was never taught to actually have to check for the limits. Will keep in mind! thanks – John Hon Sep 2 '17 at 15:55
• @John Hon, you are welcome. – Ennar Sep 2 '17 at 16:40
• @Typhon, I'm a high school teacher and in the curriculum I teach, graphing rational functions is preceded by limits and basic calculus. Of course I'm aware that curriculum may vary greatly across the globe, but I have a hard time imagining curriculum where you teach rational functions and their graphs without introducing limits beforehand. What's the point of that? Also, John's comment seems to confirm that he knows what limits are. – Ennar Sep 2 '17 at 17:03
• @Typhon, in many countries calculus is normally taught at high school, and at university you start straight with real analysis (e.g., I was taught calculus at high school and not only did I have to study limits, derivatives and integrals -- with the construction of the Riemann integral, but also the proofs of the basic theorems like Rolle's, mean value etc.). – Massimo Ortolano Sep 2 '17 at 20:21
• @Typhon The experience wasn't particularly rough: many classmates at the time struggled to get good grades, but we had an excellent teacher and most of the students, later in life, were glad of what they learned. For instance, all those of my class who later went to the university didn't have any issues in passing the mathematical courses with high grades, because we had a strong background. – Massimo Ortolano Sep 2 '17 at 20:47

To complement Ennar's excellent answer, a less formal reason why there's not a singularity at $x = 2$ is that, although the denominator of the fraction $\frac{x-2}{x^2 - 4}$ equals zero there, the numerator does too. This means that you effectively have $\frac 0 0$ (which is undefined rather than equal to $\infty$) so you need to take the limit to work out the value of the function at $x=2$, and proceed as Ennar described.