**Exploring a rational function with asymptotes**

Ideas adapted from
*Maple V Fight Manual*
by Ellis, Johnson, Lodi, and Schwalbe.

We use Maple's
*plot*
function and other functions to explore the behavior of a rational function, i.e. the quotient of two polynomials. First, let's name the function:

`> `
**f := (3*x^3 - x^2 -3*x + 5) / (x^2 -2*x - 1);**

Note that you need parentheses around the numerator and denominator. Let's see what we can determine about asymptotes and roots. Let's start with a misleading plot.

`> `
**plot(f, x = -1000..1000);**

From this plot, it appears to be a linear function. But if we narrow the range:

`> `
**plot(f, x = -100..100);**

Well, there appears to be something different when
*x *
is near 0, possibly some vertical asymptotes. We can't tell much about roots. Let's try a still more specific graph:

`> `
**plot(f, x = -5..5);**

Not much better! Notice the scale on the
*y*
-axis. Maybe we should narrow down the
*y*
-range:

`> `
**plot(f, x = -5..5, y = -50..50);**

Now we can see better. It looks like there are two vertical asymptotes and a single root. Recall that if a rational function has a vertical asymptote, it occurs at a value of
*x *
for which the denominator is 0. The
*denom*
function is useful here. Can you guess what it does? If not, use
**?denom**
or
**???denom**
to find out.

`> `
**sol := solve( denom(f) = 0, x );**

We can get a decimal approximation of each of these values:

`> `
**evalf( sol );**

We could also have used
*fsolve*
(floating point solve):

`> `
**fsolve( denom(f) = 0, x );**

There are no horizontal asymptotes. But there is an oblique asymptote. The
*quo*
function finds the quotient of two polynomials (ignoring the remainder):

`> `
**quotient := quo( numer(f), denom(f), x );
**

Now we can watch the function approach the asymptote (
) as
*x *
becomes large:

`> `
**plot( {quotient, f}, x = -6..6, y = -50..50 );
**

Finding the
*x*
-intercept is easy:

`> `
**solve( f = 0, x );**

Making sense out of the answer is another story! Let's get a decimal approximation:

`> `
**fsolve( f = 0, x );**

That is consistent with the graph. It's very easy to find the
*y*
-intercept.

`> `
**subs( x=0, f );**

`> `

But you could have done that without Maple!