A function can be graphically represented by the use of rectangular coordinates. If we represent the independent variable by
By carefully drawing the graph of a function, a good idea is obtained of the behavior of the function as the independent variable changes. For example, the graph of the function
(a) For
(b) For
(c) For
(d)
To plot the graph of a function over an interval:
- construct a table of values by substituting several values for
in the formula of the function ; - plot the
points whose coordinates appear in the table of values; - draw a smooth line free-hand through these points.
For example, suppose we want to plot the graph of
Now we can plot these points in the plane, and connect these points with a curve. As we will learn later, the curve connecting these points should be a smooth curve, but for now let’s simply connect them with straight lines (Figure 2 (a) ). For a finer representation of the graph, we can increase the number of
Now if we show these points in the plane and connect them, we will get Figure 2 (b).
|
|
(a) Graph of |
(b) Graph of the same function when the number of points increases |
Figure 2
This is the way that we can plot functions over a (finite) interval using computer programs, such as MATLAB and Matplotlib (a plotting library for the Python programming language). First, we assume many values of