Mathematica Demystified

Consider the graph of f (x ) =tan x, whose graph is shown below between ?2 ? and 2 ?.
We have plotted the function twice to point out a subtlety that can occur when a function is not continuous. Notice that in the first plot vertical lines appear at odd multiples of ?/2. These are not part of the graph and should not be present. To eliminate them we use the Exclusions option in the second plot and specifically tell Mathematica not to plot anything at points where tan x is undefined. Notice that we use the Table function to create the list of points to be excluded from the plot.
What is the limit of tan x as x approaches ?/2? In this case, it depends on whether we approach ?/2 from the right or from the left. If we approach from the right the function approaches negative infinity, but if we approach from the left, the function approaches positive infinity. Thus different one-sided limits exist at ?/2. We can restrict the Limit function to take only one-sided limits as shown in Example 7.2.2. To do this, we use the Direction option. Using this option with a value of 1 or ?1 will produce one-sided limits from either the left or right side, respectively.
In[35]:= (* using exclusion in...