> restart:

Graphing (One)

We shall try to examine various kinds of graphs. We start with an example in which we want to find out where the graph is rising and where it is falling.

Example 1.

> f:= x -> 8*x^4 - x^8;

> plot(f);

[Maple Math]

Note that Maple's default scaling doesn't give us much information about the behavior of the graph in some crucial regions. Finding the derivative to see where the function is increasing and decreasing may be helpful.

> f1:= D(f);

[Maple Math]

Since the derivative function is continuous, it can only change sign where it vanishes.

> solve(f1(x) = 0, x);

[Maple Math]

Zero is a multiple root. Two of the other roots are imaginary and can be ignored. The other three (including zero) are candidates for a sign change for the derivative. Let's examine the graph of the function more carefully near these points. In order to do so, we shall only look at the portion of the graph for [Maple Math] between [Maple Math] and 2, and we shall also limit the vertical range by specifying limits [Maple Math] and [Maple Math] for [Maple Math] .

> c := -20;
d := 20;
plot(f(x), x=-2..2,y=c..d);

[Maple Math]

[Maple Math]

So the function increases up to [Maple Math] , then decreases to zero, increases up to [Maple Math] , and then decreases thereafter. This behavior was completely invisible in our first attempt to have Maple do the graphing for us. This is an example of where computer graphics used in partnership with the tools of calculus can elicit information that would otherwise not be easily available about the graph of a function.

>

Homework

Problem 1. Find an accurate graph of [Maple Math] where [Maple Math] . This graph also involves some very small ripples which might not be noticed if you didn't know where to look for them. You may do this simply by going back in the worksheet, changing the definition of the function [Maple Math] and then making suitable changes in the following statements. Warning: you will have to fiddle quite a lot with the vertical limits [Maple Math] and [Maple Math] in order to be able to see the ripples. When you are done, give a verbal description below of the behavior of the function, including information about where it is increasing, where it is decreasing and where it attains local maxima and minima.

>

Asymptotes

One of the hardest things to get right is graphs with asymptotes which are either vertical lines which the graph approaches or are lines which the graph approaches as x approaches [Maple Math] or [Maple Math] . If the line is a vertical line, you may be able to detect it because the function has an infinite discontinuity for the relevant value of x.

Example 2 .

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

> plot(f);

[Maple Math]

The "jags" in this graph are there because Maple is assuming that the function is continuous and trying to connect the graph over a vertical asymptote. We can get a better picture by scaling the axes.

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

>

But this is still not quite right because the vertical lines are not part of the graph. They are pretty close to the actual vertical asymptotes, so we get a slight dividend from Maple in this case . Note that these asymptotes occur when [Maple Math] is undefined because its denominator is 0 (and its numerator is not 0). In this case, they occur when [Maple Math] , i.e. when [Maple Math] or [Maple Math] , which is consistent with the plot above.

This graph has another kind of asymptote which we now want to investigate. To get a first look, let's plot the graph again for a very large range on the x-axis.

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

>

Notice at this scale the graph looks almost like a straight line except for some oscillation near the origin! You should now go back and change the scale to x=-1000..1000, which will have the effect of hiding what happens near the origin. Does the graph look exactly like a straight line now? That straight line is in fact an asymptote which the graph approaches as [Maple Math] approaches [Maple Math] . For large [Maple Math] , the graph of the function is not identical with that line but is so close to it that Maple cannot distinguish the two.

>

Let's now find out what the equation of that line or asymptote is.

Define [Maple Math] to be the slope of a line joining the point ( [Maple Math] ) and the point (x, f(x)) .

> m:= (f(x) - f(0))/(x-0);

[Maple Math]

As x gets larger and larger this should get closer and closer to the slope of the desired line. So we calculate the limit of [Maple Math] as [Maple Math] goes to [Maple Math] .

> limit(m, x=infinity);

[Maple Math]

So our line has an equation of the form [Maple Math] and we would like to find the value of [Maple Math] . We do that by calculating another limit of the difference between the function value [Maple Math] and the value [Maple Math] for a line of slope two through the origin.

> limit( 2*x - f(x), x=infinity);

[Maple Math]

This says for very large values of [Maple Math] the value of [Maple Math] is about 3 less than the value of [Maple Math] . In other words [Maple Math] is very close to [Maple Math] for very large values of [Maple Math] . Let's check that with another limit.

> limit( 2*x - 3 - f(x), x = infinity);

[Maple Math]

In other words the distance between the graph of the function and the graph of asymptotic line approaches [Maple Math] as [Maple Math] goes to [Maple Math] .

Homework

Problem 2. In principle, the graph could approach some other line as [Maple Math] approaches [Maple Math] , and there are functions for which that can happen. Determine in this case if you get the same line as [Maple Math] approaches [Maple Math] . Do it by going back to the limit of [Maple Math] and replace ` infinity ' by `-infinity' to see if you still get 2 as the limit. Similarly, determine if you also get the same value of [Maple Math] by replacing `infinity' by `-infinity' in the calcuation of [Maple Math] . Describe what you found below.