Introduction
- Graphing functions is drawing the curve that represents the function on the coordinate plane. If a curve (graph) represents a function, then every point on the curve satisfies the function equation. For example, the following graph represents the linear function f(x) = -x+ 2.
Take any point on this line, say, (-1, 3). Let us substitute (-1, 3) = (x, y) (i.e., x = -1 and y = 3) in the function f(x) = -x + 2 (note that it can be written as y = -x + 2). Then
- 3 = -(-1) + 2
- 3 = 1 + 2
- 3 = 3, thus, (-1, 3) satisfies the function.
In the same way, you can try taking different points and checking whether they satisfy the function. Each and every point on the line (in general called "curve") satisfies the function. Drawing such curves representing the functions is known as graphing functions.
Graphing Basic Functions
Graphing basic functions like linear functions and quadratic functions is easy. The basic idea of graphing functions is
- Identifying the shape if possible. For example, if it is a linear function of the form f(x) = ax + b, then its graph would be a line; if it is a quadratic function of the form f(x) = ax2 + bx + c, then its a parabola.
- finding some points on it, by substituting some random values of x and finding the corresponding values of y by substituting each value into the function.
Here are some examples.
Graphing Linear Functions
- Let us graph the same linear function as mentioned in the previous section (f(x) = -x + 2). For this, we create a table of values by taking some random numbers for x say x = 0 and x = 1. Then substitute each of these in y = -x + 2 to compute y-values.
- Thus, two points on the line are (0, 2) and (1, 1). If we plot them on a graph and join them by a straight line (extending the line on both sides), we get its graph as shown in the previous section.
Graphing Quadratic Functions
- For graphing quadratic function also, we can find some random points on it. But this may not give a perfect U-shaped curve. This is because, to get a perfect U-shaped curve, we need where the curve is turning. i.e., we have to find its vertex. After finding the vertex, we can find two or three random points on each side of the vertex and they would help in graphing the function.
Example: Graph the quadratic function f(x) = x^{2} - 2x + 5.
Comparing it with f(x) = ax^{2} + bx + c, a = 1, b = -2, and c = 5.
The x-coordinate of the vertex is, h = -b/2a = -(-2)/2(1) = 1.
Its y-coordinate is, f(1) = 12 - 2(1) + 5 = 4.
Hence, the vertex is (1, 4).
We will take two random numbers on each side of 1 (which is the x-coordinate of the vertex) and frame a table. Then we can calculate the y-coordinates using the function.
Now, we will plot the points (-1, 8), (0, 5), (1, 4), (2, 5), and (3, 8) on a graph sheet, join them, and extend the curve on both sides.
Graphing Complex Functions
Graphing functions is comparably simple if each of their domain and range is the set of all real numbers. But it is NOT the case with all types of functions. There are some complex functions for which domain, range, asymptotes, and holes have to be taken care of while graphing them. The most popular such functions are:
- Rational functions - Its parent function is of the form f(x) = 1/x (which is called the reciprocal function).
- Exponential functions - Its parent function is of the form f(x) = ax.
- Logarithmic Functions - Its parent function is of the form f(x) = log x.
Just have an idea of what the graphs of parent functions of each of these functions look like.
In each of these cases, for graphing functions, we follow the following steps:
- Find the domain and range of the function and keep it in mind while drawing the curve.
- Find x-intercept(s) and y-intercept(s), and plot them.
- Identify the holes if any.
- Find the asymptotes (vertical, horizontal, and slant) and draw them by dotted lines so that we can break the graph along those lines and make sure that the graph doesn't touch them.
- Construct a table of values by taking some random numbers for x (on both sides of x-intercept and/or on both sides of the vertical asymptote), calculate the corresponding values of y.
- Plot the points from the table, and join them by taking care of asymptotes, domain, and range.
Let us see how to graph a function in different cases using the above steps.
Graphing Rational Functions
Let us graph a rational function f(x) = (x + 1) / (x - 2). We follow the above steps and graph this function.
- Domain = {x ∈ R | x ≠ 2} ; Range = {y ∈ R | y ≠ 1}. To understand how to find the domain and range of a rational function, click here.
- Its x-intercept is (-1, 0) and y-intercept is (0, -0.5).
- There are no holes.
- Vertical asymptote (VA) is x = 2 and horizontal asymptote (VA) is y = 1.
- Let us take some random values on both sides of the vertical asymptote x = 2 and calculate the respective y-values.
- Let us plot all these points along with VA and HA.
Graphing Exponential Functions
Consider an exponential function f(x) = 2-x + 2. We will graph it using the same steps as mentioned above.
- Its domain is the set of all real numbers (R) and its range is y > 2. To know how to find these, click here.
- It has no vertical asymptotes. But it has a horizontal asymptote at y = 2.
- It has no x-intercepts. Its y-intercept is (0, 3).
- No holes.
- We do not have data about VA or x-intercept. We only have one data so far which is (0, 3). So let us take some random numbers on both sides of x = 0 and frame a table.
Let us plot all the information on the graph.
Graphing Logarithmic Functions
We will graph a logarithmic function, say f(x) = 2 log^{2} x - 2. We will graph it now by following the steps as explained earlier.
- Its domain is x > 0 and its range is the set of all real numbers (R). To understand this, click here.
- Its x-int is (2, 0) and there is no y-int.
- Its vertical asymptote is y = 0 (x-axis) and no horizontal asymptote.
- No holes.
- We have only one reference point so far which is (2, 0). We will construct a table by taking a few random numbers on either side of 0 (we cannot choose values of x less than 0 as the domain is x > 0).
Note that we have chosen such numbers for x that are easy to simplify the y-values.
We will plot the graph now.
Graphing Functions by Transformations
We can graph the functions by applying transformations on the graphs of the parent functions. Here are the parent functions of a few important types of functions.
- Linear function: f(x) = x
- Quadratic function: f(x) = x^{2}
- Cubic functions: f(x) = x^{3}
- Square root function: f(x) = √x
- Cube root function: f(x) = ∛x
- Absolute value function: f(x) = |x|
- Reciprocal function: f(x) = 1/x
- Exponential function: f(x) = ax, 0 < a < 1
- Logarithmic function: f(x) = log x
Important Notes on Graphing Functions:
- f(ax) ≠ a f(x). Both may have different values.
- The value of x used to plot any function f(x) can be a whole number, real number, or decimal number.
- The graph of a function should never touch the asymptotes.
- Do not choose the values of x in the table that are NOT there in the domain of the function.