Graphing Function (original) (raw)

Last Updated : 27 Apr, 2026

Graphing a function means plotting values on a coordinate plane to show the relationship between input and output. Simple functions like linear and quadratic are easy to plot, while complex ones like rational and logarithmic are harder to graph.

A graph represents a function only if every point on the curve satisfies the function’s equation and every x-value corresponds to exactly one y-value (vertical line test).

For instance, the graph of the linear function is shown below. It is represented as f(x) = -x + 2.

c

Suppose we move from the start of this line to another point, such as (-1, 3). Let us replace (-1, 3) with (x, y) (i.e., x = -1 and y = 3) and then, in f(x) = -x + 2:

Similarly, plot similar points and check if they satisfy the equation. This process of plotting the points that satisfy the equation is called graphing a function.

Graphing Basic Functions

Graphing simple functions like linear and quadratic functions is straightforward.

Graphing Linear Functions

Graphing a linear function means plotting points to show the relation between x and y. For f(x) = −x+2:

X Y
0 -0 + 2 = 2
1 -1 + 2 = 1

Graphing Quadratic Functions

For graphing quadratic functions also, we can find some arbitrary 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 to find the turning point (vertex) of the curve. After finding the vertex, we can find two or three arbitrary points on each side of the vertex, and they would help in graphing the function.

**Example: Graph the quadratic function f(x) = x² - 2x + 5.

**Solution:

Hence, the vertex is (1, 4).

We'll take two arbitrary values on each side of 1 (which is the x-coordinate of the vertex) and frame a table. Also, we can calculate the y-coordinate using the function.

X Y
-1 (-1)2 - 2(-1) + 5 = 8
0 02 - 2(0) + 5 = 5
Vertex: 1 4
2 22 - 2(2) + 5 = 5
3 32 - 2(3) + 5 = 8

Now, we will plot the points (-1, 8), (0, 5), (1, 4), (2, 5), and (3, 8) on a coordinate plane, join them, and extend the curve on both sides.

b

Graphing Complex Functions

Functions are easier to understand when their domain and range both consist of all real numbers. However, some functions require analysis of domain, range, asymptotes, and holes before graphing. The most popular such functions are the following:

rational_function

In each of these cases, for graphing functions, we follow the following steps:

Graphing Rational Functions

For example, draw a rational function f(x) = \frac{x + 1}{x - 2}. Subsequently, we apply the above procedure to graph the rational function.

X Y
-1 (-1+1)/(-1-2) = 0 (x-int)
0 (0+1)/(0-2) = -0.5 (y-int)
2 VA
3 (3+1)/(3-2) = 4
4 (4+1)/(4-2) = 2.5

a

Graphing Exponential Functions

Imagine we have a function f(x) = 2 - x + 2, which has exponential form. Let us graph it using the same steps as before.

X Y
-2 2-(-2) + 2 = 6
-1 2-(-1) + 2 = 4
0 3 (y-int)
1 2-1 + 2 = 2.5
2 2-2 + 2 = 2.25

3

Graphing Logarithmic Functions

To graph a logarithmic curve, choose the function, for example, f(x) = 2log₂x - 2. We can now draw this graph by following the steps demonstrated before.

We've only one point so far, which is (2, 0). We'll construct a table by taking many arbitrary values of x > 0 (we cannot choose values of x lower than 0, as the domain is x> 0).

X Y
1 2 log2 1 - 2 = -2
2 0 (x-int)
4 2 log₂ 4 - 2 = 2

Note that we've chosen similar figures for x that make it easy to simplify the y-values.

2

Graphing Functions by Transformations

We can graph the functions by applying transformations on the graphs of the parent functions.

We need to have an idea about what the graph of each of these parent functions looks like (by clicking on the separate links). also, we can apply the following transformations to graph the given function.

X Y
f(x) + c It shifts the graph by c units upward.
f(x) - c It shifts the graph by c units downward.
f(x + c) It shifts the graph c units to the left.
f(x - c) It shifts the graph c units to the right.
-f(x) It reflects the graph on the x-axis (upside down).
f(-x) It reflects the graph in the y-axis (i.e., the top and bottom sides are swapped).
f(ax) Horizontal dilation by a factor of 1/a.

Solved Examples

**Example 1: Determine which of the following points lie on the graph of function f(x) = 2x3 - 2.

(a) (1, 1)

(b) (1, 0)

(c) (2, 6)

**Solution:

We'll substitute each point in the given function to see which of them satisfies the function.

a)( 1, 1) = ( x, f( x))

1 = 2( 1) 3- 2

1 = 2- 2

1 = 0, not satisfied

So( 1, 1) is NOT on the graph of the function.

b)( 1, 0) = ( x, f( x))

0 = 2( 1) 3- 2

0 = 2- 2

0 = 0, satisfied

So( 1, 0) is on the graph of the function.

c)( 2, 6) = ( x, f( x))

6 = 2( 2) 3- 2

6 = 16- 2

6 = 14, not satisfied

So( 2, 6) is NOT on the graph of the function.

**Answer: Only( b) lies on the given function.

**Example 2: Does the graph given in illustration 1 have any asymptotes? Explain. How many branches does it have?

**Solution:

The given function is f( x) = 2x3- 2, which is a polynomial function and hence it has no asymptotes.

When there are no asymptotes, we will get only one curve( as the curve does not break anywhere) while graphing functions.

**Answer: No asymptotes and only one curve.

**Example 3: Draw the graph of the function given in Example 1 along with the point(s) you set up from its result.

**Solution:

In illustration 1, we have already found that( 1, 0) lies on the function f( x) = 2x3- 2. For graphing functions, we need further points. Let us construct a table for the same.

X Y
-1 2(-1)3 - 2 = -4
0 2(0)3 - 2 = -2

Let us plot these points along with (1, 0) and plot it.

1

**Answer: The graph is drawn.

Practice Questions

1. Draw the graph of the following functions:

2. Graph the cosine function y = cos(x) for 0 ≤ x ≤ 2π

3. Plot the tangent function y = tan(x) over the interval −π/2 ≤ x ≤ π/2