Graphs being plotted despite being undefined.

426 Views Asked by At

I've not really understood why this happens. I'm quite new to the idea of limits, etc. But I've seen that when you use a grapher, it plots undefined points. For example in the function $f(x) = \frac{x^2+x-6}{x-2}$, the value $f(2)$ would be undefined, so why does a grapher not show that $f$ is undefined at $2$ and instead carries on through it? It seems to be plotting the $\lim\limits_{x \to 2} \frac{x^2+x-6}{x-2}$.

I hope this makes sense, apologies if it doesn't.

Graph of $\frac{x^2+x-6}{x-2}$

4

There are 4 best solutions below

0
On BEST ANSWER

A simple way a computer can make a graph of a function $f$ on an interval $[a,b]$ is to divide $[a,b]$ up in $n$ ascending points $x_1,\dots x_n$ with $x_1=a$ and $x_n=b$ and then draw straight lines between $\left(x_i,f(x_i)\right)$ and $\left(x_{i+1},f(x_{i+1})\right)$. The number $n$ and the ways the partition $x_1,\dots x_n$ is chosen depends on the software and is often adjustable. If I use the following Mathematica code

Plot[(x^2 + x - 6)/(x - 2), {x, 0, 4}]

to plot your function I get the following image.

enter image description here

If I now ask Mathematica which points it used to plot I get a long list of which these are a few:

$$\dots,(1.88078, 4.88078), (1.96018, 4.96018), (2.03801,5.03801), (2.12244, 5.12244),\dots.$$

So we see that the point $x=2$ wasn't sampled and as a result we might as well have asked it to plot $f(x)=x+3$. The shortcomings of this naive way of plotting are felt stronger when we for instance plot $f(x)=\tan(x)$. The code

Plot[Tan[x], {x, 0, Pi}]

produces the following image.

enter image description here

The software does not know that the function is not defined at $x=\frac{1}{2}\pi$. Sophisticated software often knows how or has a way to deal with this. In Mathematica this

Plot[Tan[x], {x, 0, Pi}, Exclusions -> {Cos[x] == 0}]

produces

enter image description here

2
On

That graph is wrong. There should be a hole at $x=2$, as you correctly guessed. The correct plot are two lines with arrows at the ends where they touch the point $(2,5)$.

0
On

The limit is identical from the left and from the right, so there is only an infinitely small point at $x=2$ where there is nothing to plot.

But since you don't have infinite precision in your plot, it "looks" as though the plot just goes "right through" as you say.

0
On

Unsophisticated graphing software evaluates the function at a number of points, and then draws straight lines between the points it obtained. There is typically not one function evaluation per pixel, and even if there is, the odds of hitting the exact point where your function is undefined are quite low.