Graphing with Calculus and Calculators

Contributed by:
In this section, we will learn about:
The interaction between calculus and calculators. We start with a graph produced by a graphing calculator or computer, and then we refine it. We use calculus to make sure that we reveal all the important aspects of the curve.
1. 4
APPLICATIONS OF DIFFERENTIATION
2. APPLICATIONS OF DIFFERENTIATION
The method we used to sketch curves
in Section 4.5 was a culmination of much
of our study of differential calculus.
The graph was the final object we produced.
3. APPLICATIONS OF DIFFERENTIATION
In this section, our point of view is
completely different.
calculator or computer, and then we refine it.
 We use calculus to make sure that we reveal
all the important aspects of the curve.
4. APPLICATIONS OF DIFFERENTIATION
With the use of graphing devices,
we can tackle curves that would be
far too complicated to consider without
5. APPLICATIONS OF DIFFERENTIATION
4.6
Graphing with
Calculus and Calculators
In this section, we will learn about:
The interaction between calculus and calculators.
6. CALCULUS AND CALCULATORS Example 1
Graph the polynomial
f(x) = 2x6 + 3x5 + 3x3 – 2x2
Use the graphs of f’ and f” to estimate all
maximum and minimum points and intervals
of concavity.
7. CALCULUS AND CALCULATORS Example 1
If we specify a domain but not
a range, many graphing devices will
deduce a suitable range from the values
8. CALCULUS AND CALCULATORS Example 1
The figure shows the plot from one such
device if we specify that -5 ≤ x ≤ 5.
9. CALCULUS AND CALCULATORS Example 1
This viewing rectangle is useful for showing
that the asymptotic behavior (or end behavior)
is the same as for y = 2x6.
However, it is
obviously hiding
some finer detail.
10. CALCULUS AND CALCULATORS Example 1
So, we change to the viewing rectangle
[-3, 2] by [-50, 100] shown here.
11. CALCULUS AND CALCULATORS Example 1
From this graph, it appears:
 There is an absolute minimum value of about -15.33
when x ≈ -1.62 (by using the cursor).
 f is decreasing
on (-∞, -1.62)
and increasing
on (-1.62, -∞).
12. CALCULUS AND CALCULATORS Example 1
Also, it appears:
 There is a horizontal tangent at the origin and
inflection points when x = 0 and when x is somewhere
between -2 and -1.
13. CALCULUS AND CALCULATORS Example 1
Now, let’s try to confirm these impressions
using calculus.
We differentiate and get:
f’(x) = 12x5 + 15x4 + 9x2 – 4x
f”(x) = 60x4 + 60x3 + 18x – 4
14. CALCULUS AND CALCULATORS Example 1
When we graph f’ as in this figure, we see
that f’(x) changes from negative to positive
when x ≈ -1.62
 This confirms—by
the First Derivative
Test—the minimum
value that we found
earlier.
15. CALCULUS AND CALCULATORS Example 1
However, to our surprise, we also notice
that f’(x) changes from positive to negative
when x = 0 and from negative to positive
when x ≈ 0.35
16. CALCULUS AND CALCULATORS Example 1
This means that f has a local maximum at 0
and a local minimum when x ≈ 0.35, but these
were hidden in the earlier figure.
17. CALCULUS AND CALCULATORS Example 1
Indeed, if we now zoom in toward the
origin, we see what we missed before:
 A local maximum value of 0 when x = 0
 A local minimum
when x ≈ 0.35
18. CALCULUS AND CALCULATORS Example 1
What about concavity and inflection points?
 From these figures, there appear to be
inflection points when x is a little to the left
of -1 and when x is a little to the right of 0.
19. CALCULUS AND CALCULATORS Example 1
However, it’s difficult to determine
inflection points from the graph of f.
 So, we graph the second derivative f” as follows.
20. CALCULUS AND CALCULATORS Example 1
We see that f” changes from positive to
negative when x ≈ -1.23 and from negative
to positive when x ≈ 0.19
21. CALCULUS AND CALCULATORS Example 1
So, correct to two decimal places, f is
concave upward on (-∞, -1.23) and (0.19, ∞)
and concave downward on (-1.23, 0.19).
 The inflection points
are (-1.23, -10.18)
and (0.19, -0.05).
22. CALCULUS AND CALCULATORS Example 1
We have discovered that no single
graph shows all the important features
of the polynomial.
23. CALCULUS AND CALCULATORS Example 1
However, when taken together, these two
figures do provide an accurate picture.
24. CALCULUS AND CALCULATORS Example 2
Draw the graph of the function 2
x + 7x + 3
f ( x) = 2
x
in a viewing rectangle that contains
all the important features of the function.
 Estimate the maximum and minimum values
and the intervals of concavity.
 Then, use calculus to find these quantities exactly.
25. CALCULUS AND CALCULATORS Example 2
This figure, produced by a computer
with automatic scaling, is a disaster.
26. CALCULUS AND CALCULATORS Example 2
Some graphing calculators use
[-10, 10] by [-10, 10] as the default
viewing rectangle.
So, let’s try it.
27. CALCULUS AND CALCULATORS Example 2
We get this graph—which is a major
 The y-axis appears to be a vertical asymptote.
 It is because:
x2 + 7 x + 3
lim 2
=∞
x→ 0 x
28. CALCULUS AND CALCULATORS Example 2
The figure also allows us to estimate
the x-intercepts: about -0.5 and -6.5
 The exact values are obtained by using
to solve the equation
x2 + 7x + 3 = 0
 We get:
x = (-7 ± 37 )/2
29. CALCULUS AND CALCULATORS Example 2
To get a better look at horizontal
asymptotes, we change to the viewing
rectangle [-20, 20] by [-5, 10], as follows.
30. CALCULUS AND CALCULATORS Example 2
It appears that y = 1 is the horizontal
 This is easily confirmed:
x2 + 7 x + 3
lim
x → ±∞ x2
⎛ 7 3 ⎞
= lim ⎜1 + + 2 ⎟
x → ±∞
⎝ x x ⎠
=1
31. CALCULUS AND CALCULATORS Example 2
To estimate the minimum value,
we zoom in to the viewing rectangle
[-3, 0] by [-4, 2], as follows.
32. CALCULUS AND CALCULATORS Example 2
The cursor indicates that the absolute
minimum value is about -3.1 when x ≈ -0.9
 We see that the function
decreases on
(-∞, -0.9) and (0, ∞)
and increases on
(-0.9, 0)
33. CALCULUS AND CALCULATORS Example 2
We get the exact values by differentiating:
7 6 7x + 6
f '( x) = − 2 − 3 = − 3
x x x
 This shows that f’(x) > 0 when -6/7 < x < 0
and f’(x) < 0 when x < -6/7 and when x > 0.
⎛ 6⎞ 37
 The exact minimum value is: f ⎜− ⎟ = − ≈−3.08
⎝ 7⎠ 12
34. CALCULUS AND CALCULATORS Example 2
The figure also shows that an inflection point
occurs somewhere between x = -1 and x = -2.
 We could estimate it much more accurately using
the graph of the second derivative.
 In this case, though,
it’s just as easy
to find exact values.
35. CALCULUS AND CALCULATORS Example 2
Since 14 18 2(7 x + 9)
f ''( x) = 3 + 4 = 4
x x x
we see that f”(x) > 0 when x > -9/7 (x ≠ 0).
 So, f is concave upward on (-9/7, 0) and (0, ∞)
and concave downward on (-∞, -9/7).
 The inflection point is: ⎛ 9 71 ⎞
⎜− , − ⎟
⎝ 7 27 ⎠
36. CALCULUS AND CALCULATORS Example 2
The analysis using the first two derivatives
shows that these figures display all the major
aspects of the curve.
37. CALCULUS AND CALCULATORS Example 3
Graph the function 2 3
x ( x + 1)
f ( x) = 2 4
( x −2) ( x −4)
 Drawing on our experience
with a rational function
in Example 2, let’s start
by graphing f in the
viewing rectangle
[-10, 10] by [-10, 10].
38. CALCULUS AND CALCULATORS Example 3
From the figure, we have the feeling
that we are going to have to zoom in to see
some finer detail and also zoom out to see
the larger picture.
39. CALCULUS AND CALCULATORS Example 3
However, as a guide to intelligent
zooming, let’s first take a close look
at the expression for f(x).
40. CALCULUS AND CALCULATORS Example 3
Due to the factors (x – 2)2 and (x – 4)4 in
the denominator, we expect x = 2 and x = 4
to be the vertical asymptotes.
2 3
x ( x + 1)
 Indeed, lim 2 4
=∞
x → 2 ( x −2) ( x −4)
and
2 3
x ( x + 1)
lim 2 4
=∞
x → 4 ( x −2) ( x −4)
41. CALCULUS AND CALCULATORS Example 3
To find the horizontal asymptotes, we divide
the numerator and denominator by x6:
3
2
x ( x + 1)3 1⎛ 1⎞
2 3 ⋅ 3 ⎜1+ ⎟
x ( x + 1) x 3
x x⎝ x⎠
2
= 2 4
= 2 4
( x −2) ( x −4) 4
( x − 2) ( x − 4) ⎛ 2⎞ ⎛ 4⎞
2
⋅ 4 ⎜1 − ⎟ ⎜1 − ⎟
x x ⎝ x⎠ ⎝ x⎠
 This shows that f(x) → 0 as x → ± ∞.
 So, the x-axis is a horizontal asymptote.
42. CALCULUS AND CALCULATORS Example 3
It is also very useful to consider the behavior
of the graph near the x-intercepts using an
analysis like that in Example 11 in Section 2.6
 Since x2 is positive, f(x) does not change sign at 0,
so its graph doesn’t cross the x-axis at 0.
 However, due to the factor (x + 1)3, the graph does
cross the x-axis at -1 and has a horizontal tangent there.
43. CALCULUS AND CALCULATORS Example 3
Putting all this information together, but
without using derivatives, we see that the
curve has to look something like the one here.
44. CALCULUS AND CALCULATORS Example 3
Now that we know what
to look for, we zoom in
(several times) to produce
the first two graphs and
zoom out (several times)
to get the third graph.
45. CALCULUS AND CALCULATORS Example 3
graphs that the absolute
and occurs when x ≈ -20.
46. CALCULUS AND CALCULATORS Example 3
There is also a local
maximum ≈ 0.00002 when
x ≈ -0.3 and a local minimum
≈ 211 when x ≈ 2.5
47. CALCULUS AND CALCULATORS Example 3
The graphs also show
three inflection points near
-35, -5, and -1 and two
between -1 and 0.
48. CALCULUS AND CALCULATORS Example 3
To estimate the inflection points closely,
we would need to graph f”.
 However, to compute f” by hand is an unreasonable
chore.
 If you have a computer algebra system, then it’s easy
to do so.
49. CALCULUS AND CALCULATORS Example 3
We have seen that, for this particular
function, three graphs are necessary to
convey all the useful information.
 The only way to display all these features
of the function on a single graph is to draw it
by hand.
50. CALCULUS AND CALCULATORS Example 3
Despite the exaggerations and distortions,
this figure does manage to summarize
the essential nature of the function.
51. CALCULUS AND CALCULATORS Example 4
Graph the function f(x) = sin(x + sin 2x).
For 0 ≤ x ≤ π, estimate all (correct to one
decimal place):
 Maximum and minimum values
 Intervals of increase and decrease
 Inflection points
52. CALCULUS AND CALCULATORS Example 4
First, we note that f is periodic with
period 2π.
Also, f is odd and |f(x)| ≤ 1 for all x.
 So, the choice of a viewing rectangle is
not a problem for this function.
53. CALCULUS AND CALCULATORS Example 4
 It appears there are three local maximum values
and two local minimum values in that window.
54. CALCULUS AND CALCULATORS Example 4
To confirm this and locate them more
accurately, we calculate that
f’(x) = cos(x + sin 2x) . (1 + 2 cos 2x)
55. CALCULUS AND CALCULATORS Example 4
Then, we graph both
f and f’.
56. CALCULUS AND CALCULATORS Example 4
Using zoom-in and the First Derivative Test,
we find the following values to one decimal
 Intervals of increase: (0, 0.6), (1.0, 1.6), (2.1, 2.5)
 Intervals of decrease: (0.6, 1.0), (1.6, 2.1), (2.5, π)
 Local maximum values: f(0.6) ≈ 1, f(1.6) ≈ 1, f(2.5) ≈ 1
 Local minimum values: f(1.0) ≈ 0.94, f(2.1) ≈ 0.94
57. CALCULUS AND CALCULATORS Example 4
The second derivative is:
f”(x) = -(1 + 2 cos 2x)2 sin(x + sin 2x)
- 4 sin 2x cos(x + sin 2x)
58. CALCULUS AND CALCULATORS Example 4
Graphing both f and f”, we obtain the following
approximate values:
 Concave upward on: (0.8, 1.3), (1.8, 2.3)
 Concave downward on: (0, 0.8), (1.3, 1.8), (2.3, π)
 Inflection points:
(0, 0), (0.8, 0.97),
(1.3, 0.97), (1.8, 0.97),
(2.3, 0.97)
59. CALCULUS AND CALCULATORS Example 4
Having checked that the first figure does
represent f accurately for 0 ≤ x ≤ π, we can
state that the extended graph in the second
figure represents f accurately for -2π ≤ x ≤ 2π.
60. FAMILIES OF FUNCTIONS
Our final example concerns families
of functions.
 As discussed in Section 1.4, this means that
the functions in the family are related to each other
by a formula that contains one or more arbitrary
constants.
 Each value of the constant gives rise to a member
of the family.
61. FAMILIES OF FUNCTIONS
The idea is to see how the graph of
the function changes as the constant
62. FAMILIES OF FUNCTIONS Example 5
How does the graph of
the function f(x) = 1/(x2 + 2x + c)
vary as c varies?
63. FAMILIES OF FUNCTIONS Example 5
These graphs (the special cases c = 2
and c = - 2) show two very different-looking
64. FAMILIES OF FUNCTIONS Example 5
Before drawing any more graphs,
let’s see what members of this family
have in common.
65. FAMILIES OF FUNCTIONS Example 5
1
lim 2 =0
x → ±∞ x + 2 x + c
for any value of c, they all have the x-axis
as a horizontal asymptote.
66. FAMILIES OF FUNCTIONS Example 5
A vertical asymptote will occur when
x2 + 2x + c = 0
Solving this quadratic equation, we get:
x = −1 ± 1 −c
67. FAMILIES OF FUNCTIONS Example 5
When c > 1, there is no vertical
68. FAMILIES OF FUNCTIONS Example 5
When c = 1, the graph has a single vertical
asymptote x = -1.
This is because:
1
lim 2
x → −1 x + 2 x + 1
1
= lim
x → −1 ( x + 1) 2
=∞
69. FAMILIES OF FUNCTIONS Example 5
When c < 1, there are two vertical
asymptotes: x = −1 ± 1 −c
70. FAMILIES OF FUNCTIONS Example 5
Now, we compute the derivative:
2x + 2
f '( x) = − 2 2
( x + 2 x + c)
This shows that:
 f’(x) = 0 when x = -1 (if c ≠ 1)
 f’(x) > 0 when x < -1
 f’(x) < 0 when x > -1
71. FAMILIES OF FUNCTIONS Example 5
For c ≥ 1, this means that f increases
on (-∞, -1) and decreases on (-1, ∞).
For c > 1, there is an absolute maximum
value f(-1) = 1/(c – 1).
72. FAMILIES OF FUNCTIONS Example 5
For c < 1, f(-1) = 1/(c – 1) is a local
maximum value and the intervals of increase
and decrease are interrupted at the vertical
73. FAMILIES OF FUNCTIONS Example 5
Five members of the family are displayed,
all graphed in the viewing rectangle [-5, 4] by
[-2, 2].
74. FAMILIES OF FUNCTIONS Example 5
As predicted, c = 1 is the value at which
a transition takes place from two vertical
asymptotes to one, and then to none.
75. FAMILIES OF FUNCTIONS Example 5
As c increases from 1, we see that the
maximum point becomes lower.
 This is explained by the fact that 1/(c – 1) → 0
as c → ∞.
76. FAMILIES OF FUNCTIONS Example 5
As c decreases from 1, the vertical
asymptotes get more widely separated.
 This is because the distance between them is 2 1 −c ,
which becomes large as c → – ∞.
77. FAMILIES OF FUNCTIONS Example 5
Again, the maximum point approaches
the x-axis because 1/(c – 1) → 0 as
c → – ∞.
78. FAMILIES OF FUNCTIONS Example 5
There is clearly no inflection point
when c ≤ 1.
79. FAMILIES OF FUNCTIONS Example 5
For c > 1, we calculate that
2
2(3 x + 6 x + 4 −c)
f ''( x) = 2 3
( x + 2 x + c)
and deduce that inflection points occur
when x = −1 ± 3(c −1) / 3
80. FAMILIES OF FUNCTIONS Example 5
So, the inflection points become more