Skip to content

Rational Functions

By the end of this section, you will be able to:

  • Use arrow notation
  • Solve applied problems involving rational functions
  • Find the domains of rational functions
  • Identify vertical asymptotes
  • Identify horizontal asymptotes
  • Graph rational functions

Suppose we know that the cost of making a product is dependent on the number of items, xx, produced. This is given by the equation C(x)=15,000x0.1x2+1000C(x)=15{,}000x-0.1x^2+1000. If we want to know the average cost for producing xx items, we would divide the cost function by the number of items, xx.

The average cost function, which yields the average cost per item for xx items produced, is

f(x)=15,000x0.1x2+1000xf(x)=\tfrac{15{,}000x-0.1x^2+1000}{x}

Many other application problems require finding an average value in a similar way, giving us variables in the denominator. Written without a variable in the denominator, this function will contain a negative integer power.

In the last few sections, we have worked with polynomial functions, which are functions with non-negative integers for exponents. In this section, we explore rational functions, which have variables in the denominator.

Using arrow notation

We have seen the graphs of the basic reciprocal function and the squared reciprocal function from our study of toolkit functions. Examine these graphs, shown below, and notice some of their features.

Several things are apparent if we examine the graph of f(x)=1xf(x)=\tfrac{1}{x}.

  1. On the left branch of the graph, the curve approaches the xx-axis (y=0y=0) as xx\to-\infty.
  2. As the graph approaches x=0x=0 from the left, the curve drops, but as we approach zero from the right, the curve rises.
  3. Finally, on the right branch of the graph, the curve approaches the xx-axis (y=0y=0) as xx\to\infty.

To summarize, we use arrow notation to show that xx or f(x)f(x) is approaching a particular value. See the table below.

SymbolMeaning
xax\to a^{-}xx approaches aa from the left (x<ax<a but close to aa)
xa+x\to a^{+}xx approaches aa from the right (x>ax>a but close to aa)
xx\to\inftyxx approaches infinity (xx increases without bound)
xx\to-\inftyxx approaches negative infinity (xx decreases without bound)
f(x)f(x)\to\inftythe output approaches infinity (the output increases without bound)
f(x)f(x)\to-\inftythe output approaches negative infinity (the output decreases without bound)
f(x)af(x)\to athe output approaches aa

Local behavior of f(x)=1xf(x)=\tfrac{1}{x}

Let’s begin by looking at the reciprocal function, f(x)=1xf(x)=\tfrac{1}{x}. We cannot divide by zero, which means the function is undefined at x=0x=0; so zero is not in the domain. As the input values approach zero from the left side (becoming very small, negative values), the function values decrease without bound (in other words, they approach negative infinity). We can see this behavior in the table below.

xx0.1-0.10.01-0.010.001-0.0010.0001-0.0001
f(x)=1xf(x)=\tfrac{1}{x}10-10100-1001,000-1{,}00010,000-10{,}000

We write in arrow notation

as x0, f(x)\text{as }x\to0^{-},\ f(x)\to-\infty

As the input values approach zero from the right side (becoming very small, positive values), the function values increase without bound (approaching infinity). We can see this behavior in the table below.

xx0.10.10.010.010.0010.0010.00010.0001
f(x)=1xf(x)=\tfrac{1}{x}10101001001,0001{,}00010,00010{,}000

We write in arrow notation

as x0+, f(x)\text{as }x\to0^{+},\ f(x)\to\infty

This behavior creates a vertical asymptote, which is a vertical line that the graph approaches but never crosses. In this case, the graph is approaching the vertical line x=0x=0 as the input becomes close to zero.

Vertical asymptote. A vertical asymptote of a graph is a vertical line x=ax=a where the graph tends toward positive or negative infinity as the input approaches aa from either the left or the right. We write

as xa, f(x)±  or  xa+, f(x)±\text{as }x\to a^{-},\ f(x)\to\pm\infty\ \text{ or }\ x\to a^{+},\ f(x)\to\pm\infty

End behavior of f(x)=1xf(x)=\tfrac{1}{x}

As the values of xx approach infinity, the function values approach 0. As the values of xx approach negative infinity, the function values approach 0. Symbolically, using arrow notation

as x, f(x)0,  and as x, f(x)0\text{as }x\to\infty,\ f(x)\to0,\ \text{ and as }x\to-\infty,\ f(x)\to0

Based on this overall behavior and the graph, we can see that the function approaches 0 but never actually reaches 0; it seems to level off as the inputs become large. This behavior creates a horizontal asymptote, a horizontal line that the graph approaches as the input increases or decreases without bound. In this case, the graph is approaching the horizontal line y=0y=0.

Horizontal asymptote. A horizontal asymptote of a graph is a horizontal line y=by=b where the graph approaches the line as the inputs increase or decrease without bound. We write

as x or x, f(x)b\text{as }x\to\infty\ \text{or}\ x\to-\infty,\ f(x)\to b

Example. Use arrow notation to describe the end behavior and local behavior of the function graphed below.

Solution. Notice that the graph is showing a vertical asymptote at x=2x=2, which tells us that the function is undefined at x=2x=2.

as x2, f(x),  and as x2+, f(x)\text{as }x\to2^{-},\ f(x)\to-\infty,\ \text{ and as }x\to2^{+},\ f(x)\to\infty

And as the inputs decrease without bound, the graph appears to be leveling off at output values of 4, indicating a horizontal asymptote at y=4y=4. As the inputs increase without bound, the graph levels off at 4.

as x, f(x)4  and as x, f(x)4\text{as }x\to\infty,\ f(x)\to4\ \text{ and as }x\to-\infty,\ f(x)\to4

Use arrow notation to describe the end behavior and local behavior of the reciprocal squared functionf(x)=1x2f(x)=\tfrac{1}{x^2}.

Example. Sketch a graph of the reciprocal function shifted two units to the left and up three units. Identify the horizontal and vertical asymptotes of the graph, if any.

Solution. Shifting the graph left 2 and up 3 would result in the function

f(x)=1x+2+3f(x)=\tfrac{1}{x+2}+3

or equivalently, by giving the terms a common denominator,

f(x)=3x+7x+2f(x)=\tfrac{3x+7}{x+2}

The graph of the shifted function is displayed below.

Notice that this function is undefined at x=2x=-2, and the graph also is showing a vertical asymptote at x=2x=-2.

as x2, f(x),  and as x2+, f(x)\text{as }x\to-2^{-},\ f(x)\to-\infty,\ \text{ and as }x\to-2^{+},\ f(x)\to\infty

As the inputs increase and decrease without bound, the graph appears to be leveling off at output values of 3, indicating a horizontal asymptote at y=3y=3.

as x±, f(x)3\text{as }x\to\pm\infty,\ f(x)\to3

Analysis. Notice that horizontal and vertical asymptotes are shifted left 2 and up 3 along with the function.

The reciprocal squared function is shifted right 3 units and down 4 units. Find the vertical asymptote of the resulting graph.

Find the horizontal asymptote of that same shifted graph.

Solving applied problems involving rational functions

In the example above, we shifted a toolkit function in a way that resulted in the function f(x)=3x+7x+2f(x)=\tfrac{3x+7}{x+2}. This is an example of a rational function. A rational function is a function that can be written as the quotient of two polynomial functions. Many real-world problems require us to find the ratio of two polynomial functions. Problems involving rates and concentrations often involve rational functions.

Rational function. A rational function is a function that can be written as the quotient of two polynomial functions P(x)P(x) and Q(x)Q(x).

f(x)=P(x)Q(x)=apxp+ap1xp1++a1x+a0bqxq+bq1xq1++b1x+b0,Q(x)0f(x)=\tfrac{P(x)}{Q(x)}=\tfrac{a_px^p+a_{p-1}x^{p-1}+\ldots+a_1x+a_0}{b_qx^q+b_{q-1}x^{q-1}+\ldots+b_1x+b_0},\quad Q(x)\ne0

Example. After running out of pre-packaged supplies, a nurse in a refugee camp is preparing an intravenous sugar solution for patients in the camp hospital. A large mixing tank currently contains 100 gallons of water into which 5 pounds of sugar have been mixed. A tap will open pouring 10 gallons per minute of distilled water into the tank at the same time sugar is poured into the tank at a rate of 1 pound per minute. Find the concentration (pounds per gallon) of sugar in the tank after 12 minutes. Is that a greater concentration than at the beginning?

Solution. Let tt be the number of minutes since the tap opened. Since the water increases at 10 gallons per minute, and the sugar increases at 1 pound per minute, these are constant rates of change. This tells us the amount of water in the tank is changing linearly, as is the amount of sugar in the tank. We can write an equation independently for each:

water:W(t)=100+10t in gallonssugar:S(t)=5+1t in pounds \begin{array}{lrcl} \text{water:} & W(t) &=& 100+10t\ \text{in gallons} \\[4pt] \text{sugar:} & S(t) &=& 5+1t\ \text{in pounds} \end{array}

The concentration, CC, will be the ratio of pounds of sugar to gallons of water

C(t)=5+t100+10tC(t)=\tfrac{5+t}{100+10t}

The concentration after 12 minutes is given by evaluating C(t)C(t) at t=12t=12.

C(12)=5+12100+10(12)=17220 \begin{array}{lrcl} & C(12) &=& \tfrac{5+12}{100+10(12)} \\[4pt] & &=& \tfrac{17}{220} \end{array}

This means the concentration is 17 pounds of sugar to 220 gallons of water.

At the beginning, the concentration is

C(0)=5+0100+10(0)=120 \begin{array}{lrcl} & C(0) &=& \tfrac{5+0}{100+10(0)} \\[4pt] & &=& \tfrac{1}{20} \end{array}

Since 172200.08>120=0.05\tfrac{17}{220}\approx0.08>\tfrac{1}{20}=0.05, the concentration is greater after 12 minutes than at the beginning.

Analysis. To find the horizontal asymptote, divide the leading coefficient in the numerator by the leading coefficient in the denominator:

110=0.1\tfrac{1}{10}=0.1

Notice the horizontal asymptote is y=0.1y=0.1. This means the concentration, CC, the ratio of pounds of sugar to gallons of water, will approach 0.1 in the long term.

There are 1,200 first-year and 1,500 second-year students at a rally at noon. After 12 p.m., 20 first-year students arrive at the rally every five minutes while 15 second-year students leave the rally. Find the ratio of first-year to second-year students at 1 p.m.

Finding the domains of rational functions

A vertical asymptote represents a value at which a rational function is undefined, so that value is not in the domain of the function. A reciprocal function cannot have values in its domain that cause the denominator to equal zero. In general, to find the domain of a rational function, we need to determine which inputs would cause division by zero.

Domain of a rational function. The domain of a rational function includes all real numbers except those that cause the denominator to equal zero.

How to: given a rational function, find the domain.

  1. Set the denominator equal to zero.
  2. Solve to find the xx-values that cause the denominator to equal zero.
  3. The domain is all real numbers except those found in Step 2.

Example. Find the domain of f(x)=x+3x29f(x)=\tfrac{x+3}{x^2-9}.

Solution. Begin by setting the denominator equal to zero and solving.

x29=0x2=9x=±3 \begin{array}{lrcl} & x^2-9 &=& 0 \\[4pt] & x^2 &=& 9 \\[4pt] & x &=& \pm3 \end{array}

The denominator is equal to zero when x=±3x=\pm3. The domain of the function is all real numbers except x=±3x=\pm3.

Analysis. A graph of this function, shown below, confirms that the function is not defined when x=±3x=\pm3.

There is a vertical asymptote at x=3x=3 and a hole in the graph at x=3x=-3. We will discuss these types of holes in greater detail later in this section.

Find the domain off(x)=4x5(x1)(x5)f(x)=\tfrac{4x}{5(x-1)(x-5)}. Write the domain in interval notation.

Identifying vertical asymptotes of rational functions

By looking at the graph of a rational function, we can investigate its local behavior and easily see whether there are asymptotes. We may even be able to approximate their location. Even without the graph, however, we can still determine whether a given rational function has any asymptotes, and calculate their location.

Vertical asymptotes

The vertical asymptotes of a rational function may be found by examining the factors of the denominator that are not common to the factors in the numerator. Vertical asymptotes occur at the zeros of such factors.

How to: given a rational function, identify any vertical asymptotes of its graph.

  1. Factor the numerator and denominator.
  2. Note any restrictions in the domain of the function.
  3. Reduce the expression by canceling common factors in the numerator and the denominator.
  4. Note any values that cause the denominator to be zero in this simplified version. These are where the vertical asymptotes occur.
  5. Note any restrictions in the domain where asymptotes do not occur. These are removable discontinuities.

Example. Find the vertical asymptotes of the graph of k(x)=5+2x22xx2k(x)=\tfrac{5+2x^2}{2-x-x^2}.

Solution. First, factor the numerator and denominator.

k(x)=5+2x22xx2=5+2x2(2+x)(1x) \begin{array}{lrcl} & k(x) &=& \tfrac{5+2x^2}{2-x-x^2} \\[4pt] & &=& \tfrac{5+2x^2}{(2+x)(1-x)} \end{array}

To find the vertical asymptotes, we determine where this function will be undefined by setting the denominator equal to zero:

(2+x)(1x)=0x=2,1 \begin{array}{lrcl} & (2+x)(1-x) &=& 0 \\[4pt] & x &=& -2,1 \end{array}

Neither x=2x=-2 nor x=1x=1 are zeros of the numerator, so the two values indicate two vertical asymptotes. The graph below confirms the location of the two vertical asymptotes.

Removable discontinuities

Occasionally, a graph will contain a hole: a single point where the graph is not defined, indicated by an open circle. We call such a hole a removable discontinuity.

For example, the function f(x)=x21x22x3f(x)=\tfrac{x^2-1}{x^2-2x-3} may be re-written by factoring the numerator and the denominator.

f(x)=(x+1)(x1)(x+1)(x3)f(x)=\tfrac{(x+1)(x-1)}{(x+1)(x-3)}

Notice that x+1x+1 is a common factor to the numerator and the denominator. The zero of this factor, x=1x=-1, is the location of the removable discontinuity. Notice also that x3x-3 is not a factor in both the numerator and denominator. The zero of this factor, x=3x=3, is the vertical asymptote.

Removable discontinuities of rational functions. A removable discontinuity occurs in the graph of a rational function at x=ax=a if aa is a zero for a factor in the denominator that is common with a factor in the numerator. We factor the numerator and denominator and check for common factors. If we find any, we set the common factor equal to 0 and solve. This is the location of the removable discontinuity. This is true if the multiplicity of this factor is greater than or equal to that in the denominator. If the multiplicity of this factor is greater in the denominator, then there is still an asymptote at that value.

Example. Find the vertical asymptotes and removable discontinuities of the graph of k(x)=x2x24k(x)=\tfrac{x-2}{x^2-4}.

Solution. Factor the numerator and the denominator.

k(x)=x2(x2)(x+2)k(x)=\tfrac{x-2}{(x-2)(x+2)}

Notice that there is a common factor in the numerator and the denominator, x2x-2. The zero for this factor is x=2x=2. This is the location of the removable discontinuity.

Notice that there is a factor in the denominator that is not in the numerator, x+2x+2. The zero for this factor is x=2x=-2. The vertical asymptote is x=2x=-2.

The graph of this function will have the vertical asymptote at x=2x=-2, but at x=2x=2 the graph will have a hole.

Find the vertical asymptotes off(x)=x225x36x2+5xf(x)=\tfrac{x^2-25}{x^3-6x^2+5x}. If there is more than one, separate them with a comma.

That same function has a removable discontinuity. Give it as an ordered pair(x,y)(x,y).

Identifying horizontal asymptotes of rational functions

While vertical asymptotes describe the behavior of a graph as the output gets very large or very small, horizontal asymptotes help describe the behavior of a graph as the input gets very large or very small. Recall that a polynomial’s end behavior will mirror that of the leading term. Likewise, a rational function’s end behavior will mirror that of the ratio of the leading terms of the numerator and denominator functions.

There are three distinct outcomes when checking for horizontal asymptotes:

Case 1: If the degree of the denominator > degree of the numerator, there is a horizontal asymptote at y=0y=0.

Example: f(x)=4x+2x2+4x5f(x)=\tfrac{4x+2}{x^2+4x-5}

In this case, the end behavior is f(x)4xx2=4xf(x)\approx\tfrac{4x}{x^2}=\tfrac{4}{x}. This tells us that, as the inputs increase or decrease without bound, this function will behave similarly to the function g(x)=4xg(x)=\tfrac{4}{x}, and the outputs will approach zero, resulting in a horizontal asymptote at y=0y=0. See the graph below. Note that this graph crosses the horizontal asymptote.

Case 2: If the degree of the denominator < degree of the numerator by one, we get a slant asymptote.

Example: f(x)=3x22x+1x1f(x)=\tfrac{3x^2-2x+1}{x-1}

In this case, the end behavior is f(x)3x2x=3xf(x)\approx\tfrac{3x^2}{x}=3x. This tells us that as the inputs increase or decrease without bound, this function will behave similarly to the function g(x)=3xg(x)=3x. As the inputs grow large, the outputs will grow and not level off, so this graph has no horizontal asymptote. However, the graph of g(x)=3xg(x)=3x looks like a diagonal line, and since ff will behave similarly to gg, it will approach a line close to y=3xy=3x. This line is a slant asymptote.

To find the equation of the slant asymptote, divide 3x22x+1x1\tfrac{3x^2-2x+1}{x-1}. The quotient is 3x+13x+1, and the remainder is 2. The slant asymptote is the graph of the line g(x)=3x+1g(x)=3x+1. See the graph below.

Case 3: If the degree of the denominator = degree of the numerator, there is a horizontal asymptote at y=anbny=\tfrac{a_n}{b_n}, where ana_n and bnb_n are the leading coefficients of p(x)p(x) and q(x)q(x) for f(x)=p(x)q(x)f(x)=\tfrac{p(x)}{q(x)}, q(x)0q(x)\ne0.

Example: f(x)=3x2+2x2+4x5f(x)=\tfrac{3x^2+2}{x^2+4x-5}

In this case, the end behavior is f(x)3x2x2=3f(x)\approx\tfrac{3x^2}{x^2}=3. This tells us that as the inputs grow large, this function will behave like the function g(x)=3g(x)=3, which is a horizontal line. As x±x\to\pm\infty, f(x)3f(x)\to3, resulting in a horizontal asymptote at y=3y=3. See the graph below. Note that this graph crosses the horizontal asymptote.

Notice that, while the graph of a rational function will never cross a vertical asymptote, the graph may or may not cross a horizontal or slant asymptote. Also, although the graph of a rational function may have many vertical asymptotes, the graph will have at most one horizontal (or slant) asymptote.

It should be noted that, if the degree of the numerator is larger than the degree of the denominator by more than one, the end behavior of the graph will mimic the behavior of the reduced end behavior fraction. For instance, if we had the function

f(x)=3x5x2x+3f(x)=\tfrac{3x^5-x^2}{x+3}

with end behavior

f(x)3x5x=3x4,f(x)\approx\tfrac{3x^5}{x}=3x^4,

the end behavior of the graph would look similar to that of an even polynomial with a positive leading coefficient.

x±, f(x)x\to\pm\infty,\ f(x)\to\infty

Horizontal asymptotes of rational functions. The horizontal asymptote of a rational function can be determined by looking at the degrees of the numerator and denominator.

  • Degree of numerator is less than degree of denominator: horizontal asymptote at y=0y=0.
  • Degree of numerator is greater than degree of denominator by one: no horizontal asymptote; slant asymptote.
  • Degree of numerator is equal to degree of denominator: horizontal asymptote at ratio of leading coefficients.

Example. For the functions below, identify the horizontal or slant asymptote.

(a) g(x)=6x310x2x3+5x2g(x)=\tfrac{6x^3-10x}{2x^3+5x^2}

(b) h(x)=x24x+1x+2h(x)=\tfrac{x^2-4x+1}{x+2}

(c) k(x)=x2+4xx38k(x)=\tfrac{x^2+4x}{x^3-8}

Solution. For these solutions, we will use f(x)=p(x)q(x)f(x)=\tfrac{p(x)}{q(x)}, q(x)0q(x)\ne0.

(a) g(x)=6x310x2x3+5x2g(x)=\tfrac{6x^3-10x}{2x^3+5x^2}: The degree of p=p= degree of q=3q=3, so we can find the horizontal asymptote by taking the ratio of the leading terms. There is a horizontal asymptote at y=62y=\tfrac{6}{2} or y=3y=3.

(b) h(x)=x24x+1x+2h(x)=\tfrac{x^2-4x+1}{x+2}: The degree of p=2p=2 and degree of q=1q=1. Since p>qp>q by 1, there is a slant asymptote found at x24x+1x+2\tfrac{x^2-4x+1}{x+2}.

21412121613 \begin{array}{r|rrr} -2 & 1 & -4 & 1 \\ & & -2 & 12 \\ \hline & 1 & -6 & 13 \end{array}

The quotient is x6x-6 and the remainder is 13. There is a slant asymptote at y=x6y=x-6.

(c) k(x)=x2+4xx38k(x)=\tfrac{x^2+4x}{x^3-8}: The degree of p=2<p=2< degree of q=3q=3, so there is a horizontal asymptote y=0y=0.

Example. In the sugar concentration problem earlier, we created the equation C(t)=5+t100+10tC(t)=\tfrac{5+t}{100+10t}.

Find the horizontal asymptote and interpret it in context of the problem.

Solution. Both the numerator and denominator are linear (degree 1). Because the degrees are equal, there will be a horizontal asymptote at the ratio of the leading coefficients. In the numerator, the leading term is tt, with coefficient 1. In the denominator, the leading term is 10t10t, with coefficient 10. The horizontal asymptote will be at the ratio of these values:

t, C(t)110t\to\infty,\ C(t)\to\tfrac{1}{10}

This function will have a horizontal asymptote at y=110y=\tfrac{1}{10}.

This tells us that as the values of tt increase, the values of CC will approach 110\tfrac{1}{10}. In context, this means that, as more time goes by, the concentration of sugar in the tank will approach one-tenth of a pound of sugar per gallon of water or 110\tfrac{1}{10} pounds per gallon.

Example. Find the horizontal and vertical asymptotes of the function

f(x)=(x2)(x+3)(x1)(x+2)(x5)f(x)=\tfrac{(x-2)(x+3)}{(x-1)(x+2)(x-5)}

Solution. First, note that this function has no common factors, so there are no potential removable discontinuities.

The function will have vertical asymptotes when the denominator is zero, causing the function to be undefined. The denominator will be zero at x=1,2, and 5x=1,-2,\text{ and }5, indicating vertical asymptotes at these values.

The numerator has degree 2, while the denominator has degree 3. Since the degree of the denominator is greater than the degree of the numerator, the denominator will grow faster than the numerator, causing the outputs to tend towards zero as the inputs get large, and so as x±x\to\pm\infty, f(x)0f(x)\to0. This function will have a horizontal asymptote at y=0y=0. See the graph below.

Find the vertical asymptotes of the functionf(x)=(2x1)(2x+1)(x2)(x+3)f(x)=\tfrac{(2x-1)(2x+1)}{(x-2)(x+3)}and place them on the grid.

Find the horizontal asymptote of that same function.

Intercepts of rational functions. A rational function will have a yy-intercept when the input is zero, if the function is defined at zero. A rational function will not have a yy-intercept if the function is not defined at zero.

Likewise, a rational function will have xx-intercepts at the inputs that cause the output to be zero. Since a fraction is only equal to zero when the numerator is zero, xx-intercepts can only occur when the numerator of the rational function is equal to zero.

Example. Find the intercepts of f(x)=(x2)(x+3)(x1)(x+2)(x5)f(x)=\tfrac{(x-2)(x+3)}{(x-1)(x+2)(x-5)}.

Solution. We can find the yy-intercept by evaluating the function at zero

f(0)=(02)(0+3)(01)(0+2)(05)=610=35=0.6 \begin{array}{lrcl} & f(0) &=& \tfrac{(0-2)(0+3)}{(0-1)(0+2)(0-5)} \\[4pt] & &=& \tfrac{-6}{10} \\[4pt] & &=& -\tfrac{3}{5} \\[4pt] & &=& -0.6 \end{array}

The xx-intercepts will occur when the function is equal to zero:

0=(x2)(x+3)(x1)(x+2)(x5)This is zero when the numerator is zero.0=(x2)(x+3)x=2,3 \begin{array}{lrcl} 0=\tfrac{(x-2)(x+3)}{(x-1)(x+2)(x-5)} & \text{This is zero when the numerator is zero.} \\[4pt] 0=(x-2)(x+3) & \\[4pt] x=2,-3 & \end{array}

The yy-intercept is (0,0.6)(0,-0.6), the xx-intercepts are (2,0)(2,0) and (3,0)(-3,0). See the graph below.

Write the reciprocal squared function, shifted right 3 units and down 4 units, as a single rational functionP(x)Q(x)\tfrac{P(x)}{Q(x)}.

Find the vertical asymptote of that function.

Find the horizontal asymptote of that function.

Graphing rational functions

We saw in the example above that the numerator of a rational function reveals the xx-intercepts of the graph, whereas the denominator reveals the vertical asymptotes of the graph. As with polynomials, factors of the numerator may have integer powers greater than one. Fortunately, the effect on the shape of the graph at those intercepts is the same as we saw with polynomials.

The vertical asymptotes associated with the factors of the denominator will mirror one of the two toolkit reciprocal functions. When the degree of the factor in the denominator is odd, the distinguishing characteristic is that on one side of the vertical asymptote the graph heads towards positive infinity, and on the other side the graph heads towards negative infinity.

When the degree of the factor in the denominator is even, the distinguishing characteristic is that the graph either heads toward positive infinity on both sides of the vertical asymptote or heads toward negative infinity on both sides.

For example, the graph of f(x)=(x+1)2(x3)(x+3)2(x2)f(x)=\tfrac{(x+1)^2(x-3)}{(x+3)^2(x-2)} is shown below.

  • At the xx-intercept x=1x=-1 corresponding to the (x+1)2(x+1)^2 factor of the numerator, the graph bounces, consistent with the quadratic nature of the factor.
  • At the xx-intercept x=3x=3 corresponding to the (x3)(x-3) factor of the numerator, the graph passes through the axis as we would expect from a linear factor.
  • At the vertical asymptote x=3x=-3 corresponding to the (x+3)2(x+3)^2 factor of the denominator, the graph heads towards positive infinity on both sides of the asymptote, consistent with the behavior of the function f(x)=1x2f(x)=\tfrac{1}{x^2}.
  • At the vertical asymptote x=2x=2, corresponding to the (x2)(x-2) factor of the denominator, the graph heads towards positive infinity on the left side of the asymptote and towards negative infinity on the right side.

How to: given a rational function, sketch a graph.

  1. Evaluate the function at 0 to find the yy-intercept.
  2. Factor the numerator and denominator.
  3. For factors in the numerator not common to the denominator, determine where each factor of the numerator is zero to find the xx-intercepts.
  4. Find the multiplicities of the xx-intercepts to determine the behavior of the graph at those points.
  5. For factors in the denominator, note the multiplicities of the zeros to determine the local behavior. For those factors not common to the numerator, find the vertical asymptotes by setting those factors equal to zero and then solve.
  6. For factors in the denominator common to factors in the numerator, find the removable discontinuities by setting those factors equal to 0 and then solve.
  7. Compare the degrees of the numerator and the denominator to determine the horizontal or slant asymptotes.
  8. Sketch the graph.

Example. Sketch a graph of f(x)=(x+2)(x3)(x+1)2(x2)f(x)=\tfrac{(x+2)(x-3)}{(x+1)^2(x-2)}.

Solution. We can start by noting that the function is already factored, saving us a step.

Next, we will find the intercepts. Evaluating the function at zero gives the yy-intercept:

f(0)=(0+2)(03)(0+1)2(02)=3 \begin{array}{lrcl} & f(0) &=& \tfrac{(0+2)(0-3)}{(0+1)^2(0-2)} \\[4pt] & &=& 3 \end{array}

To find the xx-intercepts, we determine when the numerator of the function is zero. Setting each factor equal to zero, we find xx-intercepts at x=2x=-2 and x=3x=3. At each, the behavior will be linear (multiplicity 1), with the graph passing through the intercept.

We have a yy-intercept at (0,3)(0,3) and xx-intercepts at (2,0)(-2,0) and (3,0)(3,0).

To find the vertical asymptotes, we determine when the denominator is equal to zero. This occurs when x+1=0x+1=0 and when x2=0x-2=0, giving us vertical asymptotes at x=1x=-1 and x=2x=2.

There are no common factors in the numerator and denominator. This means there are no removable discontinuities.

Finally, the degree of denominator is larger than the degree of the numerator, telling us this graph has a horizontal asymptote at y=0y=0.

To sketch the graph, we might start by plotting the three intercepts. Since the graph has no xx-intercepts between the vertical asymptotes, and the yy-intercept is positive, we know the function must remain positive between the asymptotes, letting us fill in the middle portion of the graph as shown below.

The factor associated with the vertical asymptote at x=1x=-1 was squared, so we know the behavior will be the same on both sides of the asymptote. The graph heads toward positive infinity as the inputs approach the asymptote on the right, so the graph will head toward positive infinity on the left as well.

For the vertical asymptote at x=2x=2, the factor was not squared, so the graph will have opposite behavior on either side of the asymptote. After passing through the xx-intercepts, the graph will then level off toward an output of zero, as indicated by the horizontal asymptote.

Given the functionf(x)=(x+2)2(x2)2(x1)2(x3)f(x)=\tfrac{(x+2)^2(x-2)}{2(x-1)^2(x-3)}, find its vertical asymptotes. If there is more than one, separate them with a comma.

Find the horizontal asymptote of that same function.

Find theyy-intercept of that same function, as an ordered pair(x,y)(x,y).

Writing rational functions

Now that we have analyzed the equations for rational functions and how they relate to a graph of the function, we can use information given by a graph to write the function. A rational function written in factored form will have an xx-intercept where each factor of the numerator is equal to zero. (An exception occurs in the case of a removable discontinuity.) As a result, we can form a numerator of a function whose graph will pass through a set of xx-intercepts by introducing a corresponding set of factors. Likewise, because the function will have a vertical asymptote where each factor of the denominator is equal to zero, we can form a denominator that will produce the vertical asymptotes by introducing a corresponding set of factors.

Writing rational functions from intercepts and asymptotes. If a rational function has xx-intercepts at x=x1,x2,,xnx=x_1,x_2,\ldots,x_n, vertical asymptotes at x=v1,v2,,vmx=v_1,v_2,\ldots,v_m, and no xi=x_i= any vjv_j, then the function can be written in the form:

f(x)=a(xx1)p1(xx2)p2(xxn)pn(xv1)q1(xv2)q2(xvm)qmf(x)=a\tfrac{(x-x_1)^{p_1}(x-x_2)^{p_2}\cdots(x-x_n)^{p_n}}{(x-v_1)^{q_1}(x-v_2)^{q_2}\cdots(x-v_m)^{q_m}}

where the powers pip_i or qiq_i on each factor can be determined by the behavior of the graph at the corresponding intercept or asymptote, and the stretch factor aa can be determined given a value of the function other than the xx-intercept or by the horizontal asymptote if it is nonzero.

How to: given a graph of a rational function, write the function.

  1. Determine the factors of the numerator. Examine the behavior of the graph at the xx-intercepts to determine the zeroes and their multiplicities. (This is easy to do when finding the “simplest” function with small multiplicities — such as 1 or 3 — but may be difficult for larger multiplicities — such as 5 or 7, for example.)
  2. Determine the factors of the denominator. Examine the behavior on both sides of each vertical asymptote to determine the factors and their powers.
  3. Use any clear point on the graph to find the stretch factor.

Example. Write an equation for the rational function shown below.

Solution. The graph appears to have xx-intercepts at x=2x=-2 and x=3x=3. At both, the graph passes through the intercept, suggesting linear factors. The graph has two vertical asymptotes. The one at x=1x=-1 seems to exhibit the basic behavior similar to 1x\tfrac{1}{x}, with the graph heading toward positive infinity on one side and heading toward negative infinity on the other. The asymptote at x=2x=2 is exhibiting a behavior similar to 1x2\tfrac{1}{x^2}, with the graph heading toward negative infinity on both sides of the asymptote. See the annotated graph below.

We can use this information to write a function of the form

f(x)=a(x+2)(x3)(x+1)(x2)2f(x)=a\tfrac{(x+2)(x-3)}{(x+1)(x-2)^2}

To find the stretch factor, we can use another clear point on the graph, such as the yy-intercept (0,2)(0,-2).

2=a(0+2)(03)(0+1)(02)22=a64a=86=43 \begin{array}{lrcl} & -2 &=& a\tfrac{(0+2)(0-3)}{(0+1)(0-2)^2} \\[4pt] & -2 &=& a\tfrac{-6}{4} \\[4pt] & a &=& \tfrac{-8}{-6}=\tfrac{4}{3} \end{array}

This gives us a final function of f(x)=4(x+2)(x3)3(x+1)(x2)2f(x)=\tfrac{4(x+2)(x-3)}{3(x+1)(x-2)^2}.

Key equations

Rational functionf(x)=P(x)Q(x)=apxp+ap1xp1++a1x+a0bqxq+bq1xq1++b1x+b0, Q(x)0f(x)=\tfrac{P(x)}{Q(x)}=\tfrac{a_px^p+a_{p-1}x^{p-1}+\ldots+a_1x+a_0}{b_qx^q+b_{q-1}x^{q-1}+\ldots+b_1x+b_0},\ Q(x)\ne0

Key concepts

  • We can use arrow notation to describe local behavior and end behavior of the toolkit functions f(x)=1xf(x)=\tfrac{1}{x} and f(x)=1x2f(x)=\tfrac{1}{x^2}.
  • A function that levels off at a horizontal value has a horizontal asymptote. A function can have more than one vertical asymptote.
  • Application problems involving rates and concentrations often involve rational functions.
  • The domain of a rational function includes all real numbers except those that cause the denominator to equal zero.
  • The vertical asymptotes of a rational function will occur where the denominator of the function is equal to zero and the numerator is not zero.
  • A removable discontinuity might occur in the graph of a rational function if an input causes both numerator and denominator to be zero.
  • A rational function’s end behavior will mirror that of the ratio of the leading terms of the numerator and denominator functions.
  • Graph rational functions by finding the intercepts, behavior at the intercepts and asymptotes, and end behavior.
  • If a rational function has xx-intercepts at x=x1,x2,,xnx=x_1,x_2,\ldots,x_n, vertical asymptotes at x=v1,v2,,vmx=v_1,v_2,\ldots,v_m, and no xi=x_i= any vjv_j, then the function can be written in the form f(x)=a(xx1)p1(xx2)p2(xxn)pn(xv1)q1(xv2)q2(xvm)qmf(x)=a\tfrac{(x-x_1)^{p_1}(x-x_2)^{p_2}\cdots(x-x_n)^{p_n}}{(x-v_1)^{q_1}(x-v_2)^{q_2}\cdots(x-v_m)^{q_m}}.

Practice

Use arrow notation

Which statement correctly describes the end behavior off(x)=x2x+1f(x)=\tfrac{x}{2x+1}?

Which statement correctly describes the local behavior of that same function,f(x)=x2x+1f(x)=\tfrac{x}{2x+1}, near its vertical asymptote?

Which statement correctly describes the end behavior off(x)=2xx6f(x)=\tfrac{-2x}{x-6}?

Which statement correctly describes the local behavior of that same function,f(x)=2xx6f(x)=\tfrac{-2x}{x-6}, near its vertical asymptote?

Solve applied problems involving rational functions

In the refugee camp hospital, a large mixing tank currently contains 300 gallons of water, into which 8 pounds of sugar have been mixed. A tap opens, pouring 20 gallons of water per minute into the tank at the same time sugar is poured into the tank at a rate of 2 pounds per minute. Find the rational functionC(t)C(t)giving the concentration (pounds per gallon) of sugar in the tank afterttminutes.

The concentrationCCof a drug in a patient’s bloodstreamtthours after injection is given byC(t)=100t2t2+75C(t)=\tfrac{100t}{2t^2+75}. Approximate, to the nearest hundredth, the number of hours at which the concentration is highest.

Find the domains of rational functions

Find the domain off(x)=x+1x21f(x)=\tfrac{x+1}{x^2-1}. Write the domain in interval notation.

Find the domain off(x)=x2+4x3x45x2+4f(x)=\tfrac{x^2+4x-3}{x^4-5x^2+4}. Write the domain in interval notation.

Identify vertical asymptotes

Find the vertical asymptote off(x)=25x+2f(x)=\tfrac{2}{5x+2}.

Find the vertical asymptotes off(x)=xx2+5x36f(x)=\tfrac{x}{x^2+5x-36}. If there is more than one, separate them with a comma.

Identify horizontal asymptotes

Find the horizontal asymptote off(x)=3x4x316xf(x)=\tfrac{3x-4}{x^3-16x}.

Find the horizontal asymptote off(x)=42x3x1f(x)=\tfrac{4-2x}{3x-1}.

Graph rational functions

Find the vertical asymptote ofa(x)=x2+2x3x21a(x)=\tfrac{x^2+2x-3}{x^2-1}.

Find the horizontal asymptote of that same function,a(x)=x2+2x3x21a(x)=\tfrac{x^2+2x-3}{x^2-1}.

That same function,a(x)=x2+2x3x21a(x)=\tfrac{x^2+2x-3}{x^2-1}, has a removable discontinuity. Give it as an ordered pair(x,y)(x,y).

Find theyy-intercept of that same function,a(x)=x2+2x3x21a(x)=\tfrac{x^2+2x-3}{x^2-1}, as an ordered pair(x,y)(x,y).

Find the vertical asymptotes ofw(x)=(x1)(x+3)(x5)(x+2)2(x4)w(x)=\tfrac{(x-1)(x+3)(x-5)}{(x+2)^2(x-4)}. If there is more than one, separate them with a comma.

Find the horizontal asymptote of that same function,w(x)=(x1)(x+3)(x5)(x+2)2(x4)w(x)=\tfrac{(x-1)(x+3)(x-5)}{(x+2)^2(x-4)}.

Find theyy-intercept of that same function,w(x)=(x1)(x+3)(x5)(x+2)2(x4)w(x)=\tfrac{(x-1)(x+3)(x-5)}{(x+2)^2(x-4)}, as an ordered pair(x,y)(x,y).


This section is adapted from Precalculus 2e, Section 3.7: Rational Functions by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated every graph as an accessible inline SVG built from the rationals num/den primitive, matching the source’s window, asymptotes (dashed lines), marked intercepts, and open-circle holes — the toolkit pair f(x)=1xf(x)=\tfrac{1}{x} and f(x)=1x2f(x)=\tfrac{1}{x^2}; four framings of f(x)=1xf(x)=\tfrac{1}{x} itself (its local-behavior arrows, its vertical asymptote alone, its end-behavior arrows again, and both asymptotes together); f(x)=1x2+4f(x)=\tfrac{1}{x-2}+4; f(x)=3x+7x+2f(x)=\tfrac{3x+7}{x+2}; f(x)=x+3x29f(x)=\tfrac{x+3}{x^2-9} (Example 4’s Analysis figure, deliberately left without its hole marked, matching the source’s own staging); k(x)=5+2x22xx2k(x)=\tfrac{5+2x^2}{2-x-x^2}; the removable-discontinuity walkthrough f(x)=x21x22x3f(x)=\tfrac{x^2-1}{x^2-2x-3}; k(x)=x2x24k(x)=\tfrac{x-2}{x^2-4}; the three horizontal/slant-asymptote Case examples; f(x)=(x2)(x+3)(x1)(x+2)(x5)f(x)=\tfrac{(x-2)(x+3)}{(x-1)(x+2)(x-5)} plain and with its intercepts marked; the odd- and even-multiplicity toolkit pair; f(x)=(x+1)2(x3)(x+3)2(x2)f(x)=\tfrac{(x+1)^2(x-3)}{(x+3)^2(x-2)}; the middle-portion and full graphs of f(x)=(x+2)(x3)(x+1)2(x2)f(x)=\tfrac{(x+2)(x-3)}{(x+1)^2(x-2)}; and the unlabeled and annotated mystery graph of f(x)=4(x+2)(x3)3(x+1)(x2)2f(x)=\tfrac{4(x+2)(x-3)}{3(x+1)(x-2)^2}; omitted the two graphs embedded only in the print answer key (the reciprocal-squared Try It and the closing “describe its behavior and sketch” Try It), since displaying either would hand a learner the answer to its own interactive question, and converted both Try Its into fillin components about their asymptotes, intercept, and removable discontinuity instead; omitted the “Media” callout’s four external video links, which carry no transcribable mathematics; converted every retained “Try It” into interactive fillin, multiplechoice, or graphplot components, using a place-the-asymptotes graphplot for the vertical-asymptote Try It on f(x)=(2x1)(2x+1)(x2)(x+3)f(x)=\tfrac{(2x-1)(2x+1)}{(x-2)(x+3)} (its two asymptotes are lattice-reachable), multiple choice for every arrow-notation end-/local-behavior judgment (not gradable as free-response math), an ordered pair with default ordered grading for every removable-discontinuity hole, answerMode="unordered" for every multi-asymptote list, and interval-notation answers for every domain ask; trimmed the two richest Try Its (the rewritten reciprocal-squared-shift Try It and the closing “describe and sketch” Try It) to three sequential sub-questions apiece, dropping their intercept sub-asks, to respect the two-to-three-question cap on an in-page practice set; and adapted 12 selected end-of-section exercises — two local/end-behavior pairs, two applied concentration/optimization problems, two domain-in-interval-notation problems, two vertical-asymptote problems, two horizontal-asymptote problems, and two multi-fact “find the domain, asymptotes, and intercepts” problems (split into their separate facts, the way a multipart source item is expanded) — into 19 interactive components in a closing Practice block, one group per objective.