Some thoughts for sketching the graph of a factored polynomial...

As an example, let's look at this polynomial:

P(x) = -(x - 1)^3(x + 1)^2(x+2).

(Don't be scared by the computer code that follows. In fact, you can run Mathematica in the Math Lab and some of the other labs and try these commands yourself.)

In[1]:=

P[x_] = -(x - 1)^3 (x + 1)^2 (x + 2) ;

The zeros give us the x-intercepts: x=1,-1,-2. Before we discuss the techniques for sketching this by hand, let's see what it really looks like. To plot this function in such a way that we see the "details", I choose an interval that contains the zeros but not much more. Here I use the interval [-3,2]. I also restrict the vertical range to [-4,3.1]. (I didn't know beforehand, I had to experiment.)

In[2]:=

Plot[P[x], {x, -3, 2}, PlotRange {-4, 3.1}] ;

[Graphics:HTMLFiles/index_5.gif]

For comparison, here is the view if I choose a larger interval (zoom out).

In[3]:=

Plot[P[x], {x, -4, 4}, PlotRange {-300, 4}] ;

[Graphics:HTMLFiles/index_7.gif]

Here we see one of the clues to understanding this function, which we can then use to make a sketch. (Actually, it is the other way round --- we develop the art of sketching is to help us understand the functions.) Notice now that the graph starts to resemble a basic power function for large values of x. Which power func? I showed you in class how to calculate this function with no difficulty: we consider what happens for large x by approximating the expressions in the formula for P(x). In this case, I write

(x-1) ≈ x,     (x+1)≈x,    (x+2) ≈ x

and thereby approximate P(x):

  P(x) = -(x - 1)^3(x + 1)^2(x+2)  ≈  - x^3  x^2  x  = -x^6.

Thus the power function -x^6 will be a good asymptotic approximation to P(x), i.e., a good approximation for large x. This power function also happens to be the leading term when you expand (multiply out) the polynomial (which I don't like doing by hand, but would do if you paid me a dollar).

In[4]:=

Expand[P[x]]//TraditionalForm

Out[4]//TraditionalForm=

-x^6 - x^5 + 4 x^4 + 2 x^3 - 5 x^2 - x + 2

Here is a plot of this power function, -x^6.

In[5]:=

Plot[-x^6, {x, -4, 4}, PlotRange {-300, 4}] ;

[Graphics:HTMLFiles/index_18.gif]

Here they are together:

In[6]:=

Plot[{P[x], -x^6}, {x, -4, 4}, PlotRange {-300, 4}] ;

[Graphics:HTMLFiles/index_20.gif]

Here are a few more views, with color. We are zooming out with each successive image, to see more of the behavior for large x. Watch the horizontal and vertical scales change.

In[7]:=

Plot[{-x^6, P[x]}, {x, -3, 3}, PlotStyle {Hue[0], {Thickness[.01], Hue[.7]}}] ;

[Graphics:HTMLFiles/index_22.gif]

In[8]:=

Plot[{-x^6, P[x]}, {x, -4, 4}, PlotStyle {Hue[0], {Thickness[.01], Hue[.7]}}] ;

[Graphics:HTMLFiles/index_24.gif]

In[9]:=

Plot[{-x^6, P[x]}, {x, -5, 5}, PlotStyle {Hue[0], {Thickness[.01], Hue[.7]}}] ;

[Graphics:HTMLFiles/index_26.gif]

In[10]:=

Plot[{-x^6, P[x]}, {x, -10, 10}, PlotStyle {Hue[0], {Thickness[.01], Hue[.7]}}] ;

[Graphics:HTMLFiles/index_28.gif]

In[11]:=

Plot[{-x^6, P[x]}, {x, -20, 20}, PlotStyle {Hue[0], {Thickness[.01], Hue[.7]}}] ;

[Graphics:HTMLFiles/index_30.gif]

Clearly, as you zoom out farther and farther, you can't see the difference between the functions. This is because the relative sizes of the values are very close. In other words, their ratios are very nearly equal. Let's take a moment to see why. First we can write,

P(x)/-x^6 =  (-(x - 1)^3 (x + 1)^2 (x + 2))/-x^6 = (x - 1)^3/x^3(x + 1)^2/x^2(x + 2)/x=((x - 1)/x)^3((x + 1)/x)^2((x + 2)/x)=(1 - 1/x)^3(1 + 1/x)^2(1+2/x).

But the last expression has the terms 1/x and 2/x, each of which is approaching zero (i.e., getting very small) as x approaches infinity or negative infinity (when x is extremely large). This implies that

(1 - 1/x)^3(1 + 1/x)^2(1+2/x) ≈ (1 - 0)^3(1 + 0)^2(1+0) = 1.

Putting it together, we have P(x)/-x^6≈ 1 when x is large. The larger x is, the closer that ratio is to 1. (The Limit of the ratio approaches 1: Underscript[lim, x ± ∞]P(x)/-x^6=1.) And when a ratio is nearly 1, the numerator and denominator are, relatively speaking, close. We say that P(x) is asymptotic to -x^6 and we express this by writing P(x) ∼ -x^6.

Now let's see how to go about sketching the poly. I plot the zeros first and keep in mind that for large x, the graph looks like -x^6. NOTE: For our purposes, we really only need to know that the graph will be below the x-axis when x is to the right of all the zeros. (Down to the right, down to the left.) So that's where I start, coming up toward the rightmost zero (at x=1).

In[12]:=

Plot[P[x], {x, 1.33, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog {PointSize[.02], Hue[.7], Point[{#, 0}] &/@{-2, -1, 1}}] ;

[Graphics:HTMLFiles/index_54.gif]

(I'm sketching the graph from right to left but you can just as easily go left to right.) Now I need to know what to do when I hit the zero at x=1. As we discussed in class, and as I'll show you again in a while, what we know is that the zero at x=1 came from the factor (x - 1)^3, so the local behavior at that zero will be that of a simple cubic function. More precisly, it will resemble a power function of the form c(x - 1)^3 for some constant c. You don't need to worry about the actual value of c (but we know how to find it and will do so shortly), just flatten out at the zero, like a cubic:

In[13]:=

Plot[P[x], {x, .6, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog {PointSize[.02], Hue[.7], Point[{#, 0}] &/@{-2, -1, 1}}] ;

[Graphics:HTMLFiles/index_58.gif]

Another important thing to keep in mind is that the graph cannot cross the x-axis anywhere except at the x-intercepts that we have already determined. If you find yourself crossing at another point, you goofed up.

The next zero, going right toleft, is at x=-1. Clearly, the graph will have to turn back down to get there. How high does it go in the meantime? We cannot answer that now, so just make it look nice. You'll learn how to find such a relative maximum ("top of the hill") when you take calculus. For now, we simply note that the zero at x=-1 comes from the factor (x + 1)^2, so the local behavior at that point will be like that of a parabola.

In[14]:=

Plot[P[x], {x, -1.25, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog {PointSize[.02], Hue[.7], Point[{#, 0}] &/@{-2, -1, 1}}] ;

[Graphics:HTMLFiles/index_61.gif]

Moving left again, we need to turn back down and head for the last zero, at x=-2. This comes from a first degree factor, (x+2), so we slice through the x-axis at this zero like a linear function.

In[15]:=

Plot[P[x], {x, -2.03, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog {PointSize[.02], Hue[.7], Point[{#, 0}] &/@{-2, -1, 1}}] ;

[Graphics:HTMLFiles/index_63.gif]

Finally, we just head on down, again imitating the behavior of -x^6 for large (but negative) values of x. We're done.

In[16]:=

Plot[P[x], {x, -3, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog {PointSize[.02], Hue[.7], Point[{#, 0}] &/@{-2, -1, 1}}] ;

[Graphics:HTMLFiles/index_66.gif]

Once again, let's discuss in some detail the local behavior at the zeros. To see what happens, for instance, near x=-1, we use the following, simple idea: when x≈-1, we have

P(x) = -(x - 1)^3(x + 1)^2(x+2) ≈-(-1 - 1)^3(x + 1)^2(-1+2) = 8(x + 1)^2.

Notice that we "keep" the                              2 TextData[Cell[BoxData[(x + 1) ]]] factor "as is", because otherwise we just get (x + 1)^2 ≈0, hence P(x) ≈0 near x=-1, which doesn't tell us anything new, since we already know that P(-1)=0.

Here are the graphs of our  P(x) and this function 8(x + 1)^2. Notice that the nearer to the zero, the more the functions match. Of course, it is only a good estimate when x is very close to -1.

In[17]:=

Needs["Graphics`Graphics`"]

In[18]:=

DisplayTogether[Plot[P[x], {x, -3, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog ... , -1, 1}}], Plot[8 (x + 1)^2, {x, -3, 2}, PlotStyle {Thickness[.01], Hue[0]}]] ;

[Graphics:HTMLFiles/index_77.gif]

I'll let Mathematica do it:

In[19]:=

P2[x_] = ((P[x]/(x + 1)^2)/.x -1) (x + 1)^2

Out[19]=

8 (1 + x)^2

Here are the functions that approximate our poly near the other two zeros.

In[20]:=

P1[x_] = ((P[x]/(x - 1)^3)/.x1) (x - 1)^3

Out[20]=

-12 (-1 + x)^3

In[21]:=

P3[x_] = ((P[x]/(x + 2))/.x -2) (x + 2)

Out[21]=

27 (2 + x)

All together now:

In[22]:=

{{a1, a2}, {b1, b2}} = {{-1.45, -.55}, {0, 1.5}} ;

In[23]:=

DisplayTogether[Plot[P[x], {x, -3, 2}, PlotRange {{-3, 2}, {-4, 3.1}}, Prolog ... , Hue[0]}], Plot[P3[x], {x, -2.1, -1.92}, PlotStyle {Thickness[.01], Hue[0]}]] ;

[Graphics:HTMLFiles/index_86.gif]

If you want to zoom in real close you'll see good agreement:

In[24]:=

{{a3, a4}, {b3, b4}} = {{-1.15, -.85}, {0, P2[-.85]}} ;

In[25]:=

DisplayTogether[Plot[P[x], {x, a1, a2}, PlotRange {{a1, a2}, {b1, b2}}, Prologᢃ ... , {x, a1, a2}, PlotStyle {Thickness[.01], Hue[0]}], Background->RGBColor[1, 1, .7]] ;

[Graphics:HTMLFiles/index_89.gif]

In[26]:=

DisplayTogether[Plot[P[x], {x, a3, a4}, PlotRange {{a3, a4}, {b3, b4}}, Prologᢃ ... #62754; {Thickness[.01], Hue[0]}], Background->RGBColor[.8, 1, .8], AspectRatio.25] ;

[Graphics:HTMLFiles/index_91.gif]

I hope this has helped.

RM


Created by Mathematica  (May 4, 2005) Valid XHTML 1.1!