ON-LINE LESSON ONE: GRAPHING POLYNOMIALS AND RATIONAL FUNCTIONS (sections 3.1 and 3.5 in the book)

This file was produced using the Maple symbolic computation package. Maple commands are displayed along with text explanations

of the content being discussed. It should not be necessary to understand Maple in order to understand what is happening, but it would

help. Only quite simple Maple commands are used and I will sometimes explain points of Maple notation.

It is important to note that the Maple notation for "a times b" is a*b (never ab) and that the Maple notation for "a to the power of b" is "a^b".

When functions are written in Maple commands, this notation is used, but when functions are displayed the notation will be familiar math notation.

Maple is used as a component of more advanced Boise State math courses.

> x^2+2*x+4; #an example of Maple command line notation and the resulting display

x^2+2*x+4

1. Definition of Polynomial Functions and Degree.

Definitions:

A polynomial function is a function P(x) which is a sum of constant multiples of non-negative integer powers of x. Some examples of polynomials

follow:

> 5;

5

If you don't believe that 5 is a polynomial by my definition, look at it this way:

> 5*x^0; #Maple automatically simplifies it.

5

> 2*x+5;

2*x+5

> 3*x^2+4*x-5;

3*x^2+4*x-5

> (2/3)*x^4-5*pi*x+14; #there is no need for coefficients to be integers.

2/3*x^4-5*pi*x+14

An important property of polynomials is their "degree". The "degree" of a polynomial P(x) is the largest power of x which has a non-zero coefficient in

P(x). We discuss the degrees of a few polynomials.

> 5;

5

The degree of 5 is zero (x^0 is the largest power with a non-zero coefficient).

> 2-3*x^3+5*x^2+7*x;

2-3*x^3+5*x^2+7*x

The degree of the polynomial above is 3 (presenting the terms of the polynomial in a strange order should not confuse us).

> x^2*(5-2*x)*(x+4);

x^2*(5-2*x)*(x+4)

The degree of the polynomial above is 4. This should be fairly easy to see without actually expanding it (multiply together the highest degree terms

of the factors to get the highest-degree term of the product).

> expand(x^2*(5-2*x)*(x+4)); #Maple can do this expansion for us.

-3*x^3+20*x^2-2*x^4

When we expand it, we do get a fourth degree polynomial.

> 0;

0

The constant function zero is a polynomial, but it does not have a defined degree, because it has no non-zero power of x as a term.

There is a good reason not to say that the degree of 0 is zero, like the degree of other constant functions: if we don't assign a degree to 0,

we can say that the degree of the product of two polynomials is always the sum of the degrees of the two polynomials (when their degrees

are defined): but P(x)*0 = 0 no matter what the degree of P(x) is. Sometimes it is said that the degree of the constant zero polynomial

is "minus infinity" (but you don't need to know this).

> degree(5);

0

> degree(2-3*x^3+5*x^2+7*x);

3

> degree(x^2*(5-2*x)*(x+4));

4

> degree(0);

-infinity

Notice that the built-in "degree" function of Maple agrees with us (even about the degree of 0)!

2. Graphing Polynomial Functions.

Maple preliminaries: we will use the Maple "plot" function to produce our pictures.

> plot(5,x,color=black);

[Maple Plot]

> plot(2-3*x,x,color=black);

[Maple Plot]

The illustrations above remind us that we already know how to graph constant functions and linear functions (polynomial functions of

degrees 0 and 1).

> plot(2*x^2-3*x+1,x,color=black);

[Maple Plot]

We also already should know about graphing quadratic functions (polynomials of degree 2); their graphs are parabolas.

2a. End Behavior of Graphs of Polynomial Functions.

Let's look at the graphs of some even powers of x.

> plot(x^2,x,color=black);

[Maple Plot]

> plot(x^4,x,color=black);

[Maple Plot]

> plot(x^6,x,color=black);

[Maple Plot]

Notice that all these graphs have something in common: they all "go up" on both the left and the right. If x is a very large positive number,

an even power of x will be an even larger positive number. If x is a negative number with large absolute value, an even power of x will also

be a large positive number.

The same will be true for any function with even degree and a positive leading coefficient. For values of x with large absolute value, the effect

of the largest (even) power will overwhelm the effects of the other terms.

> plot(x^4+100*x+3000,x,color=black);

[Maple Plot]

Notice that even though the coefficient of x is much larger than the coefficient of x^4, the behavior of x^4 determines the overall

shape of the graph.

If we look at a polynomial with even degree and negative leading coefficient, we will find that its "end behavior" is again the same as

the "end behavior" of its leading term: for large positive values of x and for negative values of x with large absolute value, the values of

the function will be negative with large absolute value: the graph will "go down" on both the left and the right.

> plot(-2*x^6,x,color=black);

>

[Maple Plot]

> plot(16*x^3-x^4,x,color=black); #this graph doesn't look right?

[Maple Plot]

> plot(16*x^3-x^4,x=-100..100,color=black); #on a larger range (-100<x<100), it has the expected shape.

[Maple Plot]

Now we look at graphs of polynomials of odd degree.

> plot(x^3,x,color=black);

[Maple Plot]

> plot(x^5,x,color=black);

[Maple Plot]

> plot(x^7,x,color=black);

[Maple Plot]

The graphs of these odd powers of x all have the common feature that they "go up" on the right and "go down" on the left: for large positive values

of x, these functions will have large positive values, and for large negative values, these functions will have large negative values.

Polynomials of odd degree with positive leading coefficients will have the same "end behavior": for values of x with large enough absolute value,

the behavior of the largest power of x (which will be odd in an odd degree polynomial) will be dominant.

> plot(x^3-x+1,x,color=black);

[Maple Plot]

> plot(2*x^3-100*x^2+1,x,color=black); #This doesn't look the way we expect!

[Maple Plot]

> plot(2*x^3-100*x^2+1,x=-50..50,color=black); # but on a larger range we begin to see the expected behavior

[Maple Plot]

> plot(2*x^3-100*x^2+1,x=-100..100,color=black); #and now it begins to look clear

[Maple Plot]

If the coefficient of the largest power in a polynomial of odd degree is negative, the end behavior will be "reversed": the graph will "go up" as we go toward

the left and "go down" as we go toward the right (if we go far enough). That is, a polynomial of odd degree with negative leading coefficient will have

negative values with large absolute value when x has a large positive value, and will have large positive values when x has a negative value with

large absolute value.

> plot(1+10*x^2-2*x^5,x,color=black); #This is the behavior we expect.

[Maple Plot]

2b. Zeroes and Local Extrema of Polynomial Functions.

Suppose we are given a polynomial function as a product of linear factors:

> P := x -> (x-1)*(x+2)*(x-3);

P := proc (x) options operator, arrow; (x-1)*(x+2)*...

This is an example of Maple notation for functions: the function which sends x to (x-1)*(x+2)*(x-3) is written (x -> (x-1)*(x+2)*(x-3) ).

The command line above sets the variable P equal to this function.

You should already know that the polynomial P(x) has zeroes at 1, -2, and 3, and nowhere else.

> plot(P(x),x,color=black); #Sometimes you need to set ranges explicitly to see features of graphs!

[Maple Plot]

> plot(P(x),x=-4..4,color=black); #the range from -4 to 4 should show us the zeroes we want to see.

[Maple Plot]

If a polynomial is given to us in standard form (as a sum of products of powers) it is helpful in graphing the polynomial if we can factor it. In

the following example, I'm going to use Maple's automated factoring capability.

> factor(2*x^3-5*x^2-2*x+5);

(2*x-5)*(x-1)*(x+1)

From this information about its factors, we can tell that the graph of the function f(x) = 2*x^3-5*x^2-2*x+5 crosses the x-axis at the

points x = -1, x = 1, and x = 5/2 = 2.5: now we graph it in an appropriate interval to check this conclusion.

> plot(2*x^3-5*x^2-2*x+5,x=-2..3,color=black); #we see exactly what we expect.

[Maple Plot]

Now I'm going to show you a graph and ask you what we can tell about the function that is graphed. I'll tell you for free that it is a third degree polynomial.

>

Solution: you should be able to tell me that this polynomial is of the form -a(x+4)(x+1)(x-2) with a>0. The end behavior tells you that

the polynomial has negative leading coefficient, and the three roots give you all the linear factors (since it is a third degree polynomial).

You could solve for the value of a if you knew the y-coordinate of some point on the graph not on the x-axis.

Local Extrema of Polynomial Functions:

I can illustrate but not prove the facts about local extrema. A "local extremum" is a local "high point" (local maximum) or local "low point" (local

minimum) of the graph. The fact which we will illustrate but not prove is that a degree n polynomial can have no more than n-1 local extrema.

> plot(x^3-2*x^2+3,x=-4..4,y=-2..5,color=black); #third degree polynomial, two extrema visible in this window

[Maple Plot]

> plot(x^5-2*x^4-15*x^3+2*x^2+30*x,x=-3..5,color=black); #Here is a fifth degree polynomial with four visible extrema

[Maple Plot]

Putting it all together: categorize graphs of polynomials given their shape (numbers of local extrema combined with end behavior). Give the

best information you can about the degree and leading coefficient of the following polynomials based on their apparent end behavior and

number of zeroes or local extrema.

>

Solution: This is an odd degree polynomial with negative leading coefficient, because of its end behavior. It has degree at least 3,

because it has 2 local extrema.

>

This is an even polynomial with positive leading coefficient, because of its end behavior. It has degree 4 or greater, because we can

see 3 local extrema.

Graphing polynomials efficiently given their factored form:

If you are given a polynomial as a product of linear factors, use the following information: factors tell you where the zeroes are.

End behavior tells you whether you start above or below the x-axis at the ends; the exponent of the linear factor tells you

if the graph crosses the x-axis at that zero or not -- if the exponent is even, the graph will not cross the axis (there will be no change of sign);

if the exponent is odd, the graph will cross the x-axis at that zero (there will be a change of sign).

Example: sketch the graph of f(x) = (x+4)*(x+2)^2*(x-1)

Solution: the polynomial is 4th degree with positive leading coefficient so it starts above the x-axis on the extreme left.

The function has zeroes at -4, -2, and 1. The exponent of

x+4 is odd (1) so the graph crosses the x-axis at -4 and is below the x-axis from -4 to -2. The exponent of x+2 is even (2)

so the graph does not cross the x-axis at 2, and so returns below the x-axis from -2 to 1. The exponent of the factor x-1

is odd (1), so the graph crosses the axis at 1 and goes above the axis at the extreme right (which is what we expect from the end behavior).

> plot((x+4)*(x+2)^2*(x-1),x=-5..2,color=black); #Maple agrees with our conclusions.

[Maple Plot]

4. Introducing Rational Functions.

A rational function R(x) is any function which can be written as a quotient of polynomial functions P(x)/Q(x).

Polynomial functions have domain (-infinity, infinity) - a polynomial function has a value at every value of x. A rational function

P(x)/Q(x) is undefined at those values where the denominator Q(x) is equal to zero. This means that factoring the denominator

of a rational function is quite useful... A rational function P(x)/Q(x) is equal to zero at those values of x where P(x) = 0 (as long

as Q(x) =/= 0).

Summarizing: zeroes of the "numerator" P(x) of a rational function correspond to x-intercepts)of the graph of

P(x)/Q(x) (as long as x is not also a zero of Q(x), which will not usually happen).

zeroes of the denominator Q(x) of a rational function are values not in the domain of P(x)/Q(x). Something quite dramatic happens to the graph

of P(x)/Q(x) at such points (as long as P(x) is not also zero).

> plot((x-2)/((x+1)*(x-1)),x,y=-4..4,color=black);

[Maple Plot]

Notice that the function has an x-intercept (a zero value) at 2, just as expected. At -1 and 1, something much more exciting happens.

> R := x -> (x-2)/((x+1)*(x-1));

R := proc (x) options operator, arrow; (x-2)/(x+1)/...

> R(-2); R(-1.5); R(-1.25); R(-1.125); R(-1.00001);

-4/3

-2.800000000

-5.777777778

-11.76470588

-149999.7500

> R(-.9); R(-.99); R(-.999);

15.26315789

150.2512563

1500.250125

As values of x approach -1 from below, R(x) takes on negative values with larger and larger absolute value. As values of x approach -1 from

above, R(x) takes on larger and larger positive values. The effect of this on the graph is that the graph approaches the vertical line x = -1

indefinitely closely but never quite reaches it: we say that x = -1 is a "vertical asymptote" of the graph of R(x).

For x close to -1, the quotient (x-2)/(x-1) is positive (it is the quotient of two negative quantities, and in fact will be close to 1/2). Now divide

this by (x+1) to get R(x): x+1 will be positive if x is slightly greater than -1 and negative if x is slightly less than -1, and in addition is very small.

Suppose x is slightly less than -1: then we divide (x-2)(x-1) (a positive number close to 1/2) by (x+1) (a very small negative number) to get

a negative number with very large absolute value (larger and larger as x gets closer to -1, making the absolute value of x-1 smaller).

Similarly, if x is slightly greater than -1, we divide (x-2)(x-1) (a positive number close to 1/2) by (x+1) (a very small positive number) to

get a very large positive number (larger and larger as x is taken closer to -1, which makes x+1 smaller).

In general, zeroes of the denominator Q(x) of a rational function P(x)/Q(x) which are not also zeroes of P(x) correspond to vertical asymptotes of the

graph. Notice that Maple gets confused near a vertical asymptote and draws in segments on the graph which look like the asymptote itself: what Maple

is doing is connecting the two points plotted on either side of the asymptote. If I add the parameter "style=point", this feature disappears, but the

graph looks more sketchy:

> plot(R(x),x,y=-4..4,style=point,color=black);

[Maple Plot]

Another kind of behavior near asymptotes happens when linear factors of Q(x) have even exponents:

> plot((x+1)/(x-1)^2,x,y=-20..20,color=black);

[Maple Plot]

If x is close to 1, x+1 is positive whether x is slightly less than 1 or slightly greater than 1, and so is (x-1)^2; in addition, (x-1)^2 is very small, and division by a very small number gives a very large number, so (x+1)/(x-1)^2 is positive and very large (larger and larger as x gets closer to 1), whether x is above 1 or below 1.

This graph has an x-intercept at -1, which is very hard to see because values of the function near -1 are very small in absolute value. This

is something you should watch out for. It is actually easy to determine where this rational function is above the x-axis and where it is below it

(where its values are positive and where they are negative) but it can be a little tricky to pick a viewing window in which all the facts are readily

visible on your grapher.

If you are given a rational function in factored form, you can use a strategy similar to that which works for polynomials in factored form

to determine where the function is positive and where it is negative. You can make a sign chart to do this (I'll discuss this in class), but another

way to do it is this: it is fairly easy to determine what the sign will be at the extreme right or extreme left of the graph (when x is a very large

positive number, or when x is a negative number with very large absolute value); the sign of the rational function can change only at x-intercepts

(zeroes of the numerator) or y-intercepts (zeroes of the denominator): the sign will change at a given x-intercept or vertical asymptote just

in case the exponent of the corresponding linear factor is odd, and will not change if the exponent is even. Once you know the sign on each

side of an x-intercept or vertical asymptote, it is clear how to draw the graph there. There is one more consideration about end behavior which

we will look at in the next part before doing examples.

Another Important Feature of Rational Function Graphs: Horizontal Asymptotes.

The end behavior of rational functions is an important feature for graphing. The basic idea is this: if R(x) = P(x)/Q(x), and the highest degree term

of P(x) is ax^m and the highest degree term of Q(x) is bx^n, the behavior of P(x)/Q(x) will be very much like that of (ax^m)/(bx^n) for x with

very large absolute value: the behavior of the largest powers in the numerator and denominator will overwhelm the behavior of the other

parts of the polynomials P(x) and Q(x) for large enough x. (ax^m)/(bx^n) is easier to understand if it is written in the form (a/b)x^(m-n).

> (a*x^m)/(b*x^n) = (a/b)*x^(m-n); #Maple display makes notation more familiar

a*x^m/b/(x^n) = a/b*x^(m-n)

There are three cases:

a: the degree of P(x) is less than the degree of Q(x). Then m-n < 0 and (a/b)x^(m-n) will get closer and closer to 0 as x gets larger in absolute value,

because x^(m-n) will be a negative power of x (the reciprocal of a positive power of x). In this case, the graph of R(x) will get closer and closer to the

x-axis as x gets larger in absolute value, so we say that the x-axis is a "horizontal asymptote" of the graph of R(x).

b: the degree of P(x) is equal to the degree of Q(x). In this case, m-n = 0, and (a/b)x^(m-n) = a/b. As |x| gets larger and larger (whether x is positive or

negative) R(x) will get closer and closer to the nonzero constant a/b. In this case, the graph of R(x) will get closer and closer to the horizontal line

y = a/b on both the left and the right, and we call the line y=a/b a "horizontal asymptote" of the graph of R(x).

c. the degree of P(x) is greater than the degree of Q(x). In this case, x^(m-n) will be a positive power of x, and the absolute value of (a/b)x^(m-n) will

increase without bound as |x| increases (on the left or the right). Whether the graph "goes up" or "goes down" on each side will need to be determined

using sign charts or some appropriate method: the graph will not have a horizontal asymptote.

For the rest of the lesson, we present examples.

> f:=(x^2-3*x+2)/(x^2-9);

f := (x^2-3*x+2)/(x^2-9)

Sketch the graph of the function f.

The first thing we need to do is factor the numerator and denominator.

> factor(x^2-3*x+2); factor(x^2-9);

(x-1)*(x-2)

(x-3)*(x+3)

Of course, we didn't need Maple to do this! Now we see that the x-intercepts of the graph of f are at 1 and 2, while the vertical asymptotes to the graph

are at -3 and 3.

Since the sign of each linear factor is 1, the sign of the function changes at each x-intercept and linear factor. Clearly the function is

positive for x>3 (because all the factors are positive there. So between 2 and 3 the function is negative, between 1 and 2 the function is

positive, between -3 and 2 the function is negative, and below -3 it is positive.

Behavior near the vertical asymptotes can be determined using these signs: for example, below the asymptote at 3, the value of the function

is negative, so the graph goes down the line x=3 as it approaches it from the left, and above the asymptote the function is positive, so as the graph approaches

the asymptote from the right it goes up the asymptote (that is, if we read the graph from left to right, it comes down off the asymptote after x = 3).

The degree of numerator and denominator are the same, so there is a horizontal asymptote at the ratio of the leading coefficients of the numerator

and denominator, that is at y = 1/1 = 1.

This is enough information to sketch the graph.

> plot(f(x),x,y=-1..1,color=black); # but it is quite hard to get a window which shows all features of the sketch!

>

[Maple Plot]

The window above shows the zeroes, but completely misses the part of the graph left of the asymptote at x = -3. (This is something you

really need to watch out for when graphing rational functions -- it is easy to miss pieces of them if you just believe your grapher...)

> plot (f(x),x,y=-10..10,color=black);

[Maple Plot]

This window gives an excellent picture of the behavior near the asymptotes, but is quite uninformative about the x-intercepts;

it is not clear at all from this picture that the function is positive between 1 and 2.

The sketch we generate from a sign chart and information about asymptotes will not be to scale but will often be a better qualitative picture

of the graph than any single grapher view.

We exhibit an algebraic manipulation which helps us believe the horizontal asymptote at y = 1:

> f;

(x^2-3*x+2)/(x^2-9)

> A:=expand((x^2-3*x+2)/x^2);

A := 1-3/x+2/x^2

> B:=expand((x^2-9)/x^2);

B := 1-9/x^2

The expressions A and B are obtained by dividing the numerator and denominator of f(x) by the largest power that appears in f(x),

namely x^2.

> A/B;

(1-3/x+2/x^2)/(1-9/x^2)

We know that A/B = f(x) (we divided numerator and denominator by the same thing). Now suppose that |x| is very large:

the terms 3/x, 2/x^2, 9/x^2 will all be very close to zero, and the expression will approximate 1.

> simplify(A/B); #we check our algebra

(x^2-3*x+2)/(x^2-9)

> limit(f,x=infinity); #Maple knows how to compute this as well.

1

>

>