# Rational Functions

Rational functions and the properties of their graphs such as domain , vertical, horizontal and slant asymptotes, x and y intercepts are discussed using examples. Once you finish with the present study, you may want to go through another tutorial on rational functions to further explore the properties of these functions. Links to interactive tutorials, with html5 apps, are also included if needed.

## Definition and Domain of Rational Functions

A rational function is defined as the quotient of two polynomial functions. $f(x) = \dfrac{P(x)}{Q(x)}$
The graph below is that of the function $f(x) = \dfrac{x^2-1}{(x+2)(x-3)}$. Because the denominator of $f$ given by the expression $(x+2)(x-3)$ is equal to zero for $x = -2$ and $x = 3$, the graph of $f$ is undefined at these two values of $x$; as we can see that the graph is discontinuous at these values of $x$. The broken red vertical lines $x = - 2$ and $x = 3$ are not part of the graph, they are included to highlight the behaviour of the graph close to $x = -2$ and $x = 3$ which will be discussed in more details when we study the vertical asymptotes.

Being the ratio of two functions, the domain of a ratioanl function is found by excluding all values of the variable that make the denominator equal to zero because division by zero is not allowed in mathematics.

Example 1 Find domain
Find the domain of each rational function given below.

1. $f(x) = \dfrac{x+2}{x}$
2. $g(x) = \dfrac{x-1}{x-2}$
3. $h(x) = \dfrac{x}{(x - 1)(x + 5)}$
4. $k(x) = \dfrac{x^2 - 1}{x^2 - 9}$
5. $l(x) = \dfrac{x^2 - 1}{x^2 + 1}$

Solution to Example 1

1. For function $f$ to be defined, the denominator x must be different from zero. Hence the domain of $f$ is given by the interval:
$(-\infty , 0) \cup (0,+\infty)$.

2. For function $g$ to be defined, the denominator $x - 2$ must be different from zero. We first find the values of $x$ that make the denominator equal to zero.
$x - 2 = 0$
Solve the above equation to find the solution $x = 2$
We now exclude $x = 2$ which give the domain of $g$ as
$(-\infty , 2) \cup (2,+\infty)$

3. Set the denominator of function $h$ equal to zero
$(x - 1)(x + 5) = 0$
Solve the above equation to find the solutions: $x = 1$ and $x = -5$
Exclude $x = 1$ and $x = -5$ and write the domain in interval form
$(-\infty , -5) \cup (-5 , 1 ) \cup (1,+\infty)$

4. Set the denominator of function $k$ equal to zero
$x^2 - 9 = 0$
Solve the above equation to find the solutions: $x = -3$ and $x = 3$
Exclude $x = -3$ and $x = 3$ and write the domain in interval form
$(-\infty , -3) \cup (-3 , 3 ) \cup (3,+\infty)$

5. The denominator of function $l$ is $x^2+1$ and there is no value of $x$ that will make it equal to zero. Hence the domain of $l$ is the set of all real numbers written in interval form as:
$(-\infty , +\infty)$

## Interactive Tutorial on Rational Functions

Explore rational functions interactively using the links below.

An app to Rational Functions and Their Asymptotes
There is also another app to explore Rational Functions and Their Transforms.

## Holes in the Graphs of Rational Functions

What if the zeros of the numerator and the denominator of the rational function are equal?

Example 2 Holes
Let $f$ be a rational function given by $f(x) = \dfrac{2x + 2}{x+1}$.
Factor $2$ out in the numerator.
$f(x) = \dfrac{2(x+1)}{x+1}$
$= 2$ , for $x \ne -1$.
The graph of function f is a horizontal line with a hole (function not defined) at x = -1 as shown below.

## Vertical Asymptotes of Rational Functions

Let $f(x) = \dfrac{1}{x}$.
$f(x)$ is not defined at $x = 0$ (division by zero is not allowed). However what is the behavior of the graph "close" to zero?
In the tables below are values of function $f$ as x approaches zero from the right ( $x \gt 0$).

 $x$ 1 0.1 0.01 0.001 1e-06 $f(x)$ 1 10 100 1000 1e+06
We note that as x approaches zero from the right, $f(x)$ takes larger values. Is there a limit to the values of $f(x)$? No, $f(x)$ increases without bound.

In the tables below, $x$ approaches zero from the left ( $x \lt 0$).
 $x$ - 1 - 0.1 - 0.01 -0.001 -1e-06 $f(x)$ -1 -10 -100 -1000 -1e+06

We also note that as $x$ approaches zero from the left, $f(x)$ takes smaller values. Is there a limit to the values of $f(x)$? No, $f(x)$ decreases without bound.
The vertical line $x = 0$ is called the vertical asymptote and it is given by the zero of the denominator.
Using the concept of limits, the behaviour of the graph close to zero is written as follows:
$\lim_{x \to 0^{+}} f(x) = + \infty$ ; as $x$ approaches zero from the right, $f(x)$ increases without bound.
$\lim_{x \to 0^{-}} f(x) = - \infty$ ; as $x$ approaches zero from the left, $f(x)$ decreases without bound.
The vertical asymptotes of a rational function are given by the zeros of the denominator as long they are are not equal to any of the zeros of the numerator.

Example 3 Vertical Asymptotes
Find the vertical asymptotes of the functions
1. $f(x) = \dfrac{1}{x - 2}$
2. $g(x) = \dfrac{x - 1}{x^2 - 1}$
3. $h(x) = \dfrac{6}{x^2+2}$

Solution to Example 3

4. $f(x) = \dfrac{1}{x - 2}$
Find zeros of the denominator: $x - 2 = 0$ , zero: $x = 2$. Since the numerator has no zeros, $x = 2$ is a vertical asymptote of the graph of $f$.
5. $g(x) = \dfrac{x - 1}{x^2 - 1}$
Find the zeros of the denominator: $x^2 - 1 = 0$, two zeros: $x = 1$ and $x = -1$
Find the zeros of the numerator: $x - 1 = 0$ , one zero: $x = 1$
The numerator and the denominator have one common zero and the function may be written as
$g(x) = \dfrac{x - 1}{x^2 - 1} = \dfrac{x - 1}{(x - 1)(x+1)} = \dfrac{1}{x+1}$
Function $g$ has a hole at common zero $x = 1$ and a vertical asymptote at $x = - 1$
6. $h(x) = \dfrac{6}{x^2+2}$
The denominator of $h$ has no zeros and therefore the graph of $h$ has no vertical asymptote.
The graphs of the three functions are shown below.

## Horizontal Asymptotes of Rational Functions

Let $f(x) = \dfrac{1}{x}$. What is the behavior of the graph of f as |x| becomes very large?
The tables below show values of $f$ when $x$ becomes very large, and when $x$ becomes very small.

 $x$ 1 10 100 1000 1e+06 $f(x)$ 1 0.1 0.01 0.001 1e-06

 $x$ - 1 -10 -100 -1000 -1000000 $f(x)$ - 1 - 0.1 - 0.01 - 0.001 - 0.000001
As x takes smaller values or as $x$ takes larger values, f(x) takes values close to zero and the graph approaches the line horizontal line $y = 0$. This line is called the horizontal asymptote.
Using the concept of limits, the behaviour of the graph as $x$ increases without bound or decreases without bound is written as follows:
$\lim_{x \to +\infty} f(x) = 0$ ; as $x$ increases without bound, $f(x)$ approaches 0.
$\lim_{x \to -\infty} f(x) = 0$ ; as $x$ decreases without bound, $f(x)$ approaches 0.

## Rules to Find Horizontal Asymptotes of Rational Functions

Let $f(x) = \dfrac{P(x)}{Q(x)}$ be a rational function.
Let $m$ be the degree of polynomial $P(x)$ and $n$ be the degree of polynomial $Q(x)$
We consider three cases
1) If $m \lt n$ , the graph of $f$ has a horizontal asymptote given by $y = 0$
2) If $m = n$ , the graph of $f$ has a horizontal asymptote given by: $y = \dfrac{ \text{leading coefficient of } P(x) }{\text{leading coefficient of } Q(x)}$
3) If $m \gt n$ , the graph of $f$ has a no horizontal asymptote

Example 4 Horizontal Asymptotes
Find the horizontal asymptote, if any, of each of the functions below.

1. $f(x) = \dfrac{1}{x - 2}$
2. $g(x) = \dfrac{2 x^2 - 1}{x^2 - 2}$
3. $h(x) = \dfrac{x^2}{2x-2}$

Solution to Example 4

4. $f(x) = \dfrac{1}{x - 2}$
The degree of the numerator is $m = 0$ and the degree of the denominator is $n = 1$. $m \lt n$ therefore the graph of $f$ has a horizontal asymptote $y = 0$.
Graph of $f$ is shown below.

5. $g(x) = \dfrac{2 x^2 - 1}{x^2 - 2}$
The degree of the numerator is $m = 2$ and the degree of the denominator is $n = 2$. $m = n$ therefore the graph of $f$ has a horizontal asymptote
$y = \dfrac{ \text{leading coefficient of } P(x) }{\text{leading coefficient of } Q(x)} = \dfrac{2}{1} = 2$
Graph of $g$ is shown below.

6. $h(x) = \dfrac{x^2}{2x-2}$
The degree of the numerator is $m = 2$ and the degree of the denominator is $n = 1$. $m \gt n$ therefore the graph of $f$ has no horizontal asymptote.

## Slant Asymptotes of Rational Functions

Let $f(x) = \dfrac{P(x)}{Q(x)}$ be a rational function.
Let $m$ be the degree of polynomial $P(x)$ and $n$ be the degree of polynomial $Q(x)$
If $m = n + 1$ , the graph of $f$ has a slant asymptote which is a line with slope not equal to 0.

Example 5 Slant Asymptotes
Find the slant asymptotes of the functions

1. $h(x) = \dfrac{x^2}{2x-2}$

Solution to Example 5

2. $h(x) = \dfrac{x^2}{2x-2}$
The degree of the numerator is $m = 2$ and the degree of the denominator is $n = 1$, hence $m = n + 1$ therefore the graph of $f$ has a slant asymptote.
To find the slant asymptote, use division of polynomials to divide the numerator by the denominator of function $h$ and the quotient of the division is the slant asymptote. Hence for function $h$, we have
$\dfrac{x^2}{2x - 2} = \dfrac{x}{2} + \dfrac{1}{2} + \dfrac{1}{2x-2}$
The divison of the numerator by the denominator of $h$ has a quotient equal to $\dfrac{x}{2} + \dfrac{1}{2}$ and a remainder equal to $1$. The slant asymptote is given by the quotient $\dfrac{x}{2} + \dfrac{1}{2}$ and is given by
$y = \dfrac{x}{2} + \dfrac{1}{2}$
The graph of function $h$ is shown below along with its slant asymptote.