A function can be graphically represented by the use of rectangular coordinates. If we represent the independent variable by x and the corresponding value of the function by y, we can stick them together in an ordered pair (x,y). This ordered pair will determine a point in the plane, and a number of such points will outline a curve indicating the correspondence of values of the independent and dependent variables. This curve is called the graph of the function.

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 y=log2x is drawn in Figure 1. Here we see the following facts clearly pictured to the eye:

(a) For x=1, the value of log2x is zero; that is, log21=0.
(b) For x>1, log2x is positive and increases as x increases.
(c) For 0<x<1, log2x is negative and increases indefinitely in numerical value as x diminishes.
(d) log2x is not defined for x=0 because the logarithm of zero cannot be calculated.

 
Figure 1 : Graph of y=log2x.

To plot the graph of a function over an interval:

  1. construct a table of values by substituting several values for x in the formula of the function y=f(x);
  2. plot the (x,y) points whose coordinates appear in the table of values;
  3. draw a smooth line free-hand through these points.

 

For example, suppose we want to plot the graph of f(x)=x3/2 when x[2,2]. First, we construct a table like the one below:

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 (x,y) points:

Now if we show these points in the plane and connect them, we will get Figure 2 (b).

(a) Graph of y=x3/2 when connecting a few point with straight lines (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 x and calculate the corresponding values of y; these programs can then plot this series of points and connect them with straight lines.