topic badge

4.06 Graphing rational functions

Lesson

Concept summary

A rational function is a function which can be expressed as a quotient of two polynomials, with a non-zero denominator.

f\left(x\right)=\dfrac{g\left(x\right)}{h\left(x\right)},\quad h\left(x\right) \neq 0

Examples: f\left(x\right) = \dfrac{1}{x}, f\left(x\right) = \dfrac{x + 1}{x^2}, and f\left(x\right) = -\dfrac{2x^4 - x}{x^3 + 3}

Non-examples: f\left(x\right) = \dfrac{x}{0}, f\left(x\right) = \dfrac{\sqrt{x}}{x+1}, and f\left(x\right) = -\dfrac{\left|2x-4\right|}{6}

Key features of rational functions can include horizontal and vertical asymptotes, but not necessarily. Rational functions can also have certain other key features.

Oblique asymptote

An asymptote along a line that is neither horizontal nor vertical; that is, an asymptote along a line of the form y=mx+b, where \\m \neq 0

A rational function with two branches drawn in a coordinate plane. Each branch approaches the dashed diagonal line y = 2x/3 - 1/2 on one side but does not reach it

Horizontal and oblique asymptotes are directly related to the end behavior of a rational function. We can tell which type a function has algebraically by looking at the degrees of the numerator and denominator:

  • Horizontal asymptotes occur when the degree of the numerator is less than or equal to the degree of the denominator
  • Oblique asymptotes occur when the degree of the numerator is exactly 1 more than the degree of the denominator

Examples:

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Horizontal asymptote of y = 0
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Oblique asymptote of y = x

As well as oblique asymptotes, rational functions can also have a key feature known as a removable point of discontinuity:

Removable point of discontinuity

A point at which a function is not defined, but the graph of the function approaches that point from both sides. Sometimes called a "hole".

Vertical asymptotes and removable points of discontinuity occur at values of x where the function is undefined. Algebraically, these are related to the zeros of the polynomial in the denominator of the function:

  • A vertical asymptote will occur at x=a if x=a is a zero of the denominator, but is not a zero or is a zero of lower multiplicity in the numerator
  • A removable point of discontinuity will occur at x=a if x=a is a zero of the denominator, and is a zero of the same or higher multiplicity in the numerator

Examples:

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Vertical asymptote at x = 1
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Removable point of discontinuity at x = 1

Worked examples

Example 1

Consider the function y = \dfrac{1}{\left(x - 3\right)^2}

x122.53.545
f\left(x\right)
a

Copy and complete the table of values.

Solution

Evaluating the expression \dfrac{1}{\left(x - 3\right)^2} at each value of x we get:

x122.53.545
f\left(x\right)\dfrac{1}{4}1441\dfrac{1}{4}
b

Sketch a graph of the function.

Approach

We can plot the points from the table of values and use this to help draw the curve.

Solution

-2
-1
1
2
3
4
5
6
x
-1
1
2
3
4
5
6
y

The table of values indicates there is a vertical asymptote between x = 2.5 and x = 3.5.

x = 3 is a vertical asymptote because it is a zero of the denominator but not a zero of the numerator.

The table of values also suggests a horizontal asymptote of y = 0, as the values further from x = 3 become small but non-negative.

We can confirm this by using the function definition: y = \dfrac{1}{\left(x - 3\right)^2} can never be equal to 0 as the numerator will never be equal to 0.

c

State the transformation of the parent function y = \dfrac{1}{x^2}.

Approach

Here is a graph of the parent function y = \dfrac{1}{x^2} on the same coordinate plane:

-2
-1
1
2
3
4
5
6
x
-2
-1
1
2
3
4
5
6
y

Solution

Looking at the graph, and in particular the location of the vertical asymptote, we can see that the function has been translated 3 units to the right.

Example 2

Consider the function y = \dfrac{x^2 - 5x + 4}{x + 1}

a

Determine the coordinates of the intercepts of the function.

Approach

The y-intercept of a function occurs where x = 0. We can substitute this into the function to find the y-coordinate.

Similarly, the x-intercept(s) of a function occur where y = 0. In particular, for a rational function, this occurs at values of x which make the numerator equal to 0 (and not the denominator).

Solution

For the y-intercept, we have:

\displaystyle y\displaystyle =\displaystyle \dfrac{0^2 - 5\left(0\right) + 4}{0 + 1}Substitute x = 0 into the function
\displaystyle =\displaystyle \dfrac{4}{1}Simplify numerator and denominator
\displaystyle =\displaystyle 4Evaluate the division

So the y-intercept occurs at \left(0, 4\right).

For the x-intercepts, we have:

\displaystyle \dfrac{x^2 - 5x + 4}{x + 1}\displaystyle =\displaystyle 0Set y = 0
\displaystyle \dfrac{\left(x - 4\right)\left(x - 1\right)}{x + 1}\displaystyle =\displaystyle 0Factor the quadratic in the numerator
\displaystyle \left(x - 4\right)\left(x - 1\right)\displaystyle =\displaystyle 0Multiply both sides by x + 1
\displaystyle x - 4 = 0,\quad x - 1\displaystyle =\displaystyle 0Set each factor equal to 0
\displaystyle x = 4,\quad x\displaystyle =\displaystyle 1Solve each equation for x

The function is undefined at x = -1 (the value which makes the denominator 0). This is neither of the values we just solved for, and so we have x-intercepts at both \left(1, 0\right) and \left(4, 0\right).

Reflection

It is important to consider values of x which make the denominator equal to 0, as the function cannot have an intercept if it is undefined at that value of x.

Note that the step of work "multiply both sides by x + 1" fails if x = -1. This is why we factored the numerator first, so that we could see that there was no corresponding factor of x + 1 in the numerator.

b

Determine the equation(s) of the vertical asymptote(s) of the function.

Solution

As part of determining the x-intercepts, we determined that the function is undefined at x = -1 and that this is not a zero of the numerator.

So the function has a single vertical asymptote, which is the line x = -1.

c

Determine whether the function has a horizontal or an oblique asymptote.

Approach

A rational function has a horizontal asymptote if the degree of the numerator is less than or equal to the degree of the denominator, and an oblique asymptote if the degree is exactly 1 larger.

Solution

In this case the function is y = \dfrac{x^2 - 5x + 4}{x + 1}, which has a numerator of degree 2 and a denominator of degree 1.

So the degree of the numerator is exactly 1 larger than the degree of the denominator, and therefore the function has an oblique asymptote.

d

Determine the equation of the horizontal or oblique asymptote.

Approach

For a rational function y = \dfrac{P\left(x\right)}{Q\left(x\right)}, we can determine the equation of a horizontal or oblique asymptote by using polynomial division or other techniques to rewrite the function in the formy = A\left(x\right) + \dfrac{B\left(x\right)}{Q\left(x\right)}where the degree of B\left(x\right) is smaller than the degree of Q\left(x\right). The equation of the asymptote will then be y = A\left(x\right).

Solution

We can use polynomial long division for the function y = \dfrac{x^2 - 5x + 4}{x + 1}:

A figure showing the polynomial long division for x squared minus 5 x plus 4 divided by x plus 1. Speak to your teacher for more information.

This tells us that we can rewrite the function in the form y = x - 6 + \frac{10}{x + 1}So the equation of the oblique asymptote is y = x - 6.

Reflection

The oblique or horizontal asymptote of a rational function is related to its end behavior.

For a function such as y = x - 6 + \dfrac{10}{x + 1}, as the value of x tends towards \pm \infty, the value of the rational part \dfrac{10}{x + 1} will become very small. So the overall function values will be very close to the line y = x - 6, which is why this is the equation of the oblique asymptote.

e

Sketch a graph of the function.

Approach

In parts (a) to (d) we determined the x- and y-intercepts, the equation of the vertical asymptote, and the equation of the oblique asymptote.

If we draw all of these key features to a coordinate plane, we should be able to make an approximate sketch of the function. We can also evaluate the function at a few extra points if needed.

Solution

Drawing the key features on a coordinate plane, we have:

-8
-6
-4
-2
2
4
x
-20
-16
-12
-8
-4
4
8
y

We can sketch the top-right section of the graph using the intercepts. Since the bottom-left section doesn't contain any key features, we can just approximately draw it so that it approaches the asymptotes:

-10
-8
-6
-4
-2
2
4
6
x
-20
-16
-12
-8
-4
4
8
y

Example 3

The table of values shown represents a series of transformations of y = \dfrac{1}{x^2}:

x-10\dfrac{1}{2}1\dfrac{3}{2}23
y\dfrac{7}{4}1-2\text{undefined}-21\dfrac{7}{4}
a

Describe the transformations.

Approach

To identify the transformations involved, we will first aim to locate the horizontal and vertical asymptotes. This will directly tell us about any horizontal or vertical translations, and will also help to determine if there has been a reflection or stretch/compression.

Solution

Looking at the table of values, we can immediately see that the function is undefined at x = 1. So the vertical asymptote of the function is at x = 1, and this means there has been a translation of 1 unit to the right.

Looking at the function values on either side, we can see that they go above 1, but the rate of change is rapidly decreasing as the function values approach 2. So it seems likely that the horizontal asymptote will be the line y = 2, indicating a translation of 2 units upwards.

With this in mind, we can also see that all of the function values lie below the horizontal asymptote, and so there has been a reflection across the x-axis.

Finally, we can see that when x = 0, the function value is 1, which is 1 unit below the horizontal asymptote. Similarly, when x = 2 the function value is also 1. This is what we would expect for a reflection across the x-axis without a vertical stretch or compression.

To summarize, the transformations are:

  • Reflection across the x-axis
  • Vertical translation of 2 units upwards
  • Horizontal translation of 1 unit to the right
b

Sketch a graph of the function.

Approach

We can use the points in the graph, as well as the asymptotes which we identified in part (a), to sketch a graph of the function.

Solution

-4
-3
-2
-1
1
2
3
4
x
-3
-2
-1
1
2
3
4
5
y

Reflection

We can also use this graph to confirm the transformations that we found in part (a). The function has been reflected across the x-axis, and has been translated both vertically by 2 units upwards and horizontally by 1 unit to the right.

c

State the domain and range of the function, using interval notation.

Approach

We can use the graph to see which values of x and y correspond to points on the graph, and which ones do not.

Note that although the function approaches the two asymptotes, it never quite reaches those values.

Solution

We can see that all values of x except for the value of the vertical asymptote, x = 1, correspond to points on the graph. So the domain will be "all real values of x except for x = 1".

We can also see that the function takes all values below the horizontal asymptote, y = 2, but no values on or above it. So the range will be "all real values of y that are less than 2".

We can express the domain and range using interval notation as follows:

  • Domain: \left(-\infty, 1\right) \cup \left(1, \infty\right)
  • Range: \left(-\infty, 2\right)

Example 4

Consider the function f \left( x \right) = \dfrac{x^2 - 9}{x^2 + 7x + 12}

a

State the domain of the function.

Approach

As a rational function, the domain will be all real values of x except for those which make the denominator equal to 0. So we will set the denominator to be equal to 0 and solve for x.

Solution

\displaystyle x^2 + 7x + 12\displaystyle =\displaystyle 0Set denominator equal to 0
\displaystyle \left(x + 3\right)\left(x + 4\right)\displaystyle =\displaystyle 0Factor the quadratic
\displaystyle x + 3 = 0,\quad x + 4\displaystyle =\displaystyle 0Set each factor equal to 0
\displaystyle x = -3,\quad x\displaystyle =\displaystyle -4Solve each equation for x

So the domain of the function will be \left(-\infty, -4\right) \cup \left(-4, -3\right) \cup \left(-3, \infty\right).

b

For each value of x not in the domain, determine whether there is a vertical asymptote or a removable point of discontinuity at that value.

Approach

If a factor in the denominator is not in the numerator, or is in the numerator but with a lower multiplicity, then there will be a vertical asymptote at the corresponding value of x.

If a factor is in the denominator and the numerator with the same or higher multiplicity, there will be a removable point of discontinuity instead.

So we also want to factor the numerator, then compare the factors.

Solution

\displaystyle f\left(x\right)\displaystyle =\displaystyle \dfrac{x^2 - 9}{x^2 + 7x + 12}State the function
\displaystyle =\displaystyle \dfrac{x^2 - 9}{\left(x + 3\right)\left(x + 4\right)}Previous factoring of the denominator
\displaystyle =\displaystyle \dfrac{\left(x - 3\right)\left(x + 3\right)}{\left(x + 3\right)\left(x + 4\right)}Factor the numerator as a difference of two squares

We can see that the factor \left(x + 3\right) appears in both the numerator and denominator, while the factor \left(x + 4\right) only appears in the denominator.

As such, x = -3 will correspond to a removable point of discontinuity, while x = -4 will be the equation of a vertical asymptote.

Outcomes

MA.912.AR.8.2

Given a table, equation or written description of a rational function, graph that function and determine its key features.

MA.912.AR.8.3

Solve and graph mathematical and real-world problems that are modeled with rational functions. Interpret key features and determine constraints in terms of the context.

MA.912.F.1.7

Compare key features of two functions each represented algebraically, graphically, in tables or written descriptions.

MA.912.F.2.2

Identify the effect on the graph of a given function of two or more transformations defined by adding a real number to the x- or y- values or multiplying the x- or y- values by a real number.

MA.912.F.2.3

Given the graph or table of f(x) and the graph or table of f(x)+k,kf(x), f(kx) and f(x+k), state the type of transformation and find the value of the real number k.

MA.912.F.2.5

Given a table, equation or graph that represents a function, create a corresponding table, equation or graph of the transformed function defined by adding a real number to the x- or y-values or multiplying the x- or y-values by a real number.

What is Mathspace

About Mathspace