Skip to main content
Mathematics LibreTexts

5.4: Rational Functions

  • Page ID
    89308
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The average rate of change of a function on an interval always involves a ratio. Indeed, for a given function \(f\) that interests us near \(t = 2\text{,}\) we can investigate its average rate of change on intervals near this value by considering

    \begin{equation*} AV_{[2,2+h]} = \frac{f(2+h)-f(2)}{h}\text{.} \end{equation*}

    Suppose, for instance, that \(f\) meausures the height of a falling ball at time \(t\) and is given by \(f(t) = -16t^2 + 32t + 48\text{,}\) which happens to be a polynomial function of degree \(2\text{.}\) For this particular function, its average rate of change on \([1,1+h]\) is

    \begin{align*} AV_{[2,2+h]} &= \frac{f(2+h)-f(2)}{h}\\ &= \frac{-16(2+h)^2 + 32(2+h) + 48 - (-16 \cdot 4 + 32 \cdot 2 + 48)}{h}\\ &= \frac{-64 - 64h - 16h^2 + 64 + 32h + 48 - (48)}{h}\\ &= \frac{-64h - 16h^2}{h}\text{.} \end{align*}

    Structurally, we observe that \(AV_{[2,2+h]}\) is a ratio of the two functions \(-64h - 16h^2\) and \(h\text{.}\) Moreover, both the numerator and the denominator of the expression are themselves polynomial functions of the variable \(h\text{.}\) Note that we may be especially interested in what occurs as \(h \to 0\text{,}\) as these values will tell us the average velocity of the moving ball on shorter and shorter time intervals starting at \(t = 2\text{.}\) At the same time, \(AV_{[2,2+h]}\) is not defined for \(h = 0\text{.}\)

    Ratios of polynomial functions arise in several different important circumstances. Sometimes we are interested in what happens when the denominator approaches \(0\text{,}\) which makes the overall ratio undefined. In other situations, we may want to know what happens in the long term and thus consider what happens when the input variable increases without bound.

    Preview Activity \(\PageIndex{1}\)

    A drug company 1  estimates that to produce a new drug, it will cost $5 million in startup resources, and that once they reach production, each gram of the drug will cost $2500 to make.

    1. Determine a formula for a function \(C(q)\) that models the cost of producing \(q\) grams of the drug. What familiar kind of function is \(C\text{?}\)
    2. The drug company needs to sell the drug at a price of more than $2500 per gram in order to at least break even. To investigate how they might set prices, they first consider what their average cost per gram is. What is the total cost of producing \(1000\) grams? What is the average cost per gram to produce \(1000\) grams?
    3. What is the total cost of producing \(10000\) grams? What is the average cost per gram to produce \(10000\) grams?
    4. Our computations in (b) and (c) naturally lead us to define the “average cost per gram” function, \(A(q)\text{,}\) whose output is the average cost of producing \(q\) grams of the drug. What is a formula for \(A(q)\text{?}\)
    5. Explain why another formula for \(A\) is \(A(q) = 2500 + \frac{5000000}{q}\text{.}\)
    6. What can you say about the long-range behavior of \(A\text{?}\) What does this behavior mean in the context of the problem?

    Long-range behavior of rational functions

    The functions \(AV_{[2,2+h]} = \frac{-64h - 16h^2}{h}\) and \(A(q) = \frac{5000000 + 2500q}{q}\) are both examples of rational functions, since each is a ratio of polynomial functions. Formally, we have the following definition.

    Definition \(\PageIndex{1}\)

    A function \(r\) is rational provided that it is possible to write \(r\) as the ratio of two polynomials, \(p\) and \(q\text{.}\) That is, \(r\) is rational provided that for some polynomial functions \(p\) and \(q\text{,}\) we have

    \begin{equation*} r(x) = \frac{p(x)}{q(x)}\text{.} \end{equation*}

    Like with polynomial functions, we are interested in such natural questions as

    • What is the long range behavior of a given rational function?
    • What is the domain of a given rational function?
    • How can we determine where a given rational function's value is \(0\text{?}\)

    We begin by focusing on the long-range behavior of rational functions. It's important first to recall our earlier work with power functions of the form \(p(x) = x^{-n}\) where \(n = 1, 2, \ldots\text{.}\) For such functions, we know that \(p(x) = \frac{1}{x^n}\) where \(n \gt 0\) and that

    \begin{equation*} \lim_{x \to \infty} \frac{1}{x^n} = 0 \end{equation*}

    since \(x^n\) increases without bound as \(x \to \infty\text{.}\) The same is true when \(x \to -\infty\text{:}\) \(\lim_{x \to -\infty} \frac{1}{x^n} = 0\text{.}\) Thus, any time we encounter a quantity such as \(\frac{1}{x^3}\text{,}\) this quantity will approach \(0\) as \(x\) increases without bound, and this will also occur for any constant numerator. For instance,

    \begin{equation*} \lim_{x \to \infty} \frac{2500}{x^2} = 0 \end{equation*}

    since \(2500\) times a quantity approaching \(0\) will still approach \(0\) as \(x\) increases.

    Activity \(\PageIndex{2}\)

    Consider the rational function \(r(x) = \frac{3x^2 - 5x + 1}{7x^2 + 2x - 11}\text{.}\)

    Observe that the largest power of \(x\) that's present in \(r(x)\) is \(x^2\text{.}\) In addition, because of the dominant terms of \(3x^2\) in the numerator and \(7x^2\) in the denominator, both the numerator and denominator of \(r\) increase without bound as \(x\) increases without bound. In order to understand the long-range behavior of \(r\text{,}\) we choose to write the function in a different algebraic form.

    1. Note that we can multiply the formula for \(r\) by the form of \(1\) given by \(1 = \frac{\frac{1}{x^2}}{\frac{1}{x^2}}\text{.}\) Do so, and distribute and simplify as much as possible in both the numerator and denominator to write \(r\) in a different algebraic form.
    2. Having rewritten \(r\text{,}\) we are in a better position to evaluate \(\lim_{x \to \infty} r(x)\text{.}\) Using our work from (a), we have
      \begin{equation*} \lim_{x \to \infty} r(x) = \lim_{x \to \infty} \frac{3 - \frac{5}{x} + \frac{1}{x^2}}{7 + \frac{2}{x} - \frac{11}{x^2}}\text{.} \end{equation*}

      What is the exact value of this limit and why?

    3. Next, determine
      \begin{equation*} \lim_{x \to -\infty} r(x) = \lim_{x \to -\infty} \frac{3 - \frac{5}{x} + \frac{1}{x^2}}{7 + \frac{2}{x} - \frac{11}{x^2}}\text{.} \end{equation*}
    4. Use Desmos to plot \(r\) on the interval \([-10,10]\text{.}\) In addition, plot the horizontal line \(y = \frac{3}{7}\text{.}\) What is the meaning of the limits you found in (b) and (c)?
    Activity \(\PageIndex{3}\)

    Let \(s(x) = \frac{3x - 5}{7x^2 + 2x - 11}\) and \(u(x) = \frac{3x^2 - 5x + 1}{7x + 2}\text{.}\) Note that both the numerator and denominator of each of these rational functions increases without bound as \(x \to \infty\text{,}\) and in addition that \(x^2\) is the highest order term present in each of \(s\) and \(u\text{.}\)

    1. Using a similar algebraic approach to our work in Activity 5.4.2, multiply \(s(x)\) by \(1 = \frac{\frac{1}{x^2}}{\frac{1}{x^2}}\) and hence evaluate
      \begin{equation*} \lim_{x \to \infty} \frac{3x - 5}{7x^2 + 2x - 11}\text{.} \end{equation*}

      What value do you find?

    2. Plot the function \(y = s(x)\) on the interval \([-10,10]\text{.}\) What is the graphical meaning of the limit you found in (a)?
    3. Next, use appropriate algebraic work to consider \(u(x)\) and evaluate
      \begin{equation*} \lim_{x \to \infty} \frac{3x^2 - 5x + 1}{7x + 2}\text{.} \end{equation*}

      What do you find?

    4. Plot the function \(y = u(x)\) on the interval \([-10,10]\text{.}\) What is the graphical meaning of the limit you computed in (c)?

    We summarize and generalize the results of Activity \(\PageIndex{2}\) and Activity \(\PageIndex{3}\) as follows.

    The long-term behavior of a rational function.

    Let \(p\) and \(q\) be polynomial functions so that \(r(x) = \frac{p(x)}{q(x)}\) is a rational function. Suppose that \(p\) has degree \(n\) with leading term \(a_n x^n\) and \(q\) has degree \(m\) with leading term \(b_m x^m\) for some nonzero constants \(a_n\) and \(b_m\text{.}\) There are three possibilities (\(n \lt m\text{,}\) \(n = m\text{,}\) and \(n \gt m\)) that result in three different behaviors of \(r\text{:}\)

    1. if \(n \lt m\text{,}\) then the degree of the numerator is less than the degree of the denominator, and thus
      \begin{equation*} \lim_{n \to \infty} r(x) = \lim_{n \to \infty} \frac{a_n x^n + \cdots + a_0}{b_m x^m + \cdots + b_0} = 0\text{,} \end{equation*}

      which tells us that \(y = 0\) is a horizontal asymptote of \(r\text{;}\)

    2. if \(n = m\text{,}\) then the degree of the numerator equals the degree of the denominator, and thus
      \begin{equation*} \lim_{n \to \infty} r(x) = \lim_{n \to \infty} \frac{a_n x^n + \cdots + a_0}{b_n x^n + \cdots + b_0} = \frac{a_n}{b_n}\text{,} \end{equation*}

      which tells us that \(y = \frac{a_n}{b_n}\) (the ratio of the coefficients of the highest order terms in \(p\) and \(q\)) is a horizontal asymptote of \(r\text{;}\)

    3. if \(n \gt m\text{,}\) then the degree of the numerator is greater than the degree of the denominator, and thus
      \begin{equation*} \lim_{n \to \infty} r(x) = \lim_{n \to \infty} \frac{a_n x^n + \cdots + a_0}{b_m x^m + \cdots + b_0} = \pm \infty\text{,} \end{equation*}

      (where the sign of the limit depends on the signs of \(a_n\) and \(b_m\)) which tells us that \(r\) is does not have a horizontal asymptote.

    In both situations (a) and (b), the value of \(\lim_{x \to -\infty} r(x)\) is identical to \(\lim_{x \to \infty} r(x)\text{.}\)

    The domain of a rational function

    Because a rational function can be written in the form \(r(x) = \frac{p(x)}{q(x)}\) for some polynomial functions \(p\) and \(q\text{,}\) we have to be concerned about the possibility that a rational function's denominator is zero. Since polynomial functions always have their domain as the set of all real numbers, it follows that any rational function is only undefined at points where its denominator is zero.

    The domain of a rational function.

    Let \(p\) and \(q\) be polynomial functions so that \(r(x) = \frac{p(x)}{q(x)}\) is a rational function. The domain of \(r\) is the set of all real numbers except those for which \(q(x) = 0\text{.}\)

    Example \(\PageIndex{2}\)

    Determine the domain of the function \(r(x) = \frac{5x^3 + 17x^2 - 9x + 4}{2x^3 - 6x^2 - 8x}\text{.}\)

    Solution

    To find the domain of any rational function, we need to determine where the denominator is zero. The best way to find these values exactly is to factor the denominator. Thus, we observe that

    \begin{equation*} 2x^3 - 6x^2 - 8x = 2x(x^2 - 3x - 4) = 2x(x+1)(x-4)\text{.} \end{equation*}
    By the Zero Product Property, it follows that the denominator of \(r\) is zero at \(x = 0\text{,}\) \(x = -1\text{,}\) and \(x = 4\text{.}\) Hence, the domain of \(r\) is the set of all real numbers except \(-1\text{,}\) \(0\text{,}\) and \(4\text{.}\)

    We note that when it comes to determining the domain of a rational function, the numerator is irrelevant: all that matters is where the denominator is \(0\text{.}\)

    Activity \(\PageIndex{4}\)

    Determine the domain of each of the following functions. In each case, write a sentence to accurately describe the domain.

    1. \(\displaystyle \displaystyle f(x) = \frac{x^2-1}{x^2 + 1}\)
    2. \(\displaystyle \displaystyle g(x) = \frac{x^2 - 1}{x^2 + 3x - 4}\)
    3. \(\displaystyle \displaystyle h(x) = \frac{1}{x} + \frac{1}{x-1} + \frac{1}{x-2}\)
    4. \(\displaystyle \displaystyle j(x) = \frac{(x+5)(x-3)(x+1)(x-4)}{(x+1)(x+3)(x-5)}\)
    5. \(\displaystyle \displaystyle k(x) = \frac{2x^2 + 7}{3x^3 - 12x}\)
    6. \(\displaystyle \displaystyle m(x) = \frac{5x^2 - 45}{7(x-2)(x-3)^2(x^2 + 9)(x+1)}\)

    Applications of rational functions

    Rational functions arise naturally in the study of the average rate of change of a polynomial function, leading to expressions such as

    \begin{equation*} AV_{[2,2+h]} = \frac{-64h - 16h^2}{h}\text{.} \end{equation*}

    We will study several subtle issues that correspond to such functions further in Section 5.5. For now, we will focus on a different setting in which rational functions play a key role.

    In Section 5.3, we encountered a class of problems where a key quantity was modeled by a polynomial function. We found that if we considered a container such as a cylinder with fixed surface area, then the volume of the container could be written as a polynomial of a single variable. For instance, if we consider a circular cylinder with surface area \(10\) square feet, then we know that

    \begin{equation*} S = 10 = 2\pi r^2 + 2\pi r h \end{equation*}

    and therefore \(h = \frac{10 - 2\pi r^2}{2 \pi r}\text{.}\) Since the cylinder's volume is \(V = \pi r^2 h\text{,}\) it follows that

    \begin{equation*} V = \pi r^2 h = \pi r^2 \left( \frac{10 - 2\pi r^2}{2 \pi r} \right) = r(5 - \pi r^2)\text{,} \end{equation*}

    which is a polynomial function of \(r\text{.}\)

    What happens if we instead fix the volume of the container and ask about how surface area can be written as a function of a single variable?

    Example \(\PageIndex{3}\)

    Suppose we want to construct a circular cylinder that holds \(20\) cubic feet of volume. How much material does it take to build the container? How can we state the amount of material as a function of a single variable?

    Answer

    Neglecting any scrap, the amount of material it takes to construct the container is its surface area, which we know to be

    \begin{equation*} S = 2\pi r^2 + 2\pi r h\text{.} \end{equation*}

    Because we want the volume to be fixed, this results in a constraint equation that enables us to relate \(r\) and \(h\text{.}\) In particular, since

    \begin{equation*} V = 20 = \pi r^2 h\text{,} \end{equation*}

    it follows that we can solve for \(h\) and get \(h = \frac{20}{\pi r^2}\text{.}\) Substituting this expression for \(h\) in the equation for surface area, we find that

    \begin{equation*} S = 2\pi r^2 + 2\pi r \cdot \frac{20}{\pi r^2} = 2 \pi r^2 + \frac{40}{r}\text{.} \end{equation*}

    Getting a common denominator, we can also write \(S\) in the form

    \begin{equation*} S(r) = \frac{2 \pi r^3 + 40}{r} \end{equation*}

    and thus we see that \(S\) is a rational function of \(r\text{.}\) Because of the physical context of the problem and the fact that the denominator of \(S\) is \(r\text{,}\) the domain of \(S\) is the set of all positive real numbers.

    Activity \(\PageIndex{5}\)

    Suppose that we want to build an open rectangular box (that is, without a top) that holds \(15\) cubic feet of volume. If we want one side of the base to be twice as long as the other, how does the amount of material required depend on the shorter side of the base? We investigate this question through the following sequence of prompts.

    1. Draw a labeled picture of the box. Let \(x\) represent the shorter side of the base and \(h\) the height of the box. What is the length of the longer side of the base in terms of \(x\text{?}\)
    2. Use the given volume constraint to write an equation that relates \(x\) and \(h\text{,}\) and solve the equation for \(h\) in terms of \(x\text{.}\)
    3. Determine a formula for the surface area, \(S\text{,}\) of the box in terms of \(x\) and \(h\text{.}\)
    4. Using the constraint equation from (b) together with your work in (c), write surface area, \(S\text{,}\) as a function of the single variable \(x\text{.}\)
    5. What type of function is \(S\text{?}\) What is its domain?
    6. Plot the function \(S\) using Desmos. What appears to be the least amount of material that can be used to construct the desired box that holds \(15\) cubic feet of volume?

    Summary

    • A rational function is a function whose formula can be written as the ratio of two polynomial functions. For instance, \(r(x) = \frac{7x^3 - 5x + 16}{-4x^4 + 2x^3 - 11x + 3}\) is a rational function.
    • Two aspects of rational functions are straightforward to determine for any rational function. Given \(r(x) = \frac{p(x)}{q(x)}\) where \(p\) and \(q\) are polynomials, the domain of \(r\) is the set of all real numbers except any values of \(x\) for which \(q(x) = 0\text{.}\) In addition, we can determine the long-range behavior of \(r\) by examining the highest order terms in \(p\) and \(q\text{:}\)
      • if the degree of \(p\) is less than the degree of \(q\text{,}\) then \(r\) has a horizontal asymptote at \(y = 0\text{;}\)
      • if the degree of \(p\) equals the degree of \(q\text{,}\) then \(r\) has a horizontal asymptote at \(y = \frac{a_n}{b_n}\text{,}\) where \(a_n\) and \(b_n\) are the leading coefficients of \(p\) and \(q\) respectively;
      • and if the degree of \(p\) is greater than the degree of \(q\text{,}\) then \(r\) does not have a horizontal asymptote.
    • Two reasons that rational functions are important are that they arise naturally when we consider the average rate of change on an interval whose length varies and when we consider problems that relate the volume and surface area of three-dimensional containers when one of those two quantities is constrained.

    Exercises

    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.

    For each rational function below, determine the function's domain as well as the exact value of any horizontal asymptote.

    1. \(\displaystyle \displaystyle f(x) = \frac{17x^2 + 34}{19x^2 - 76}\)
    2. \(\displaystyle \displaystyle g(x) = \frac{29}{53} + \frac{1}{x-2}\)
    3. \(\displaystyle \displaystyle h(x) = \frac{4-31x}{11x - 7}\)
    4. \(\displaystyle \displaystyle r(x) = \frac{151(x-4)(x+5)^2(x-2)}{537(x+5)(x+1)(x^2+1)(x-15)}\)
    10.

    A rectangular box is being constructed so that its base is \(1.5\) times as long as it is wide. In addition, suppose that material for the base and top of the box costs $\(3.75\) per square foot, while material for the sides costs $\(2.50\) per square foot. Finally, we want the box to hold \(8\) cubic feet of volume.

    1. Draw a labeled picture of the box with \(x\) as the length of the shorter side of the box's base and \(h\) as its height.
    2. Determine a formula involving \(x\) and \(h\) for the total surface area, \(S\text{,}\) of the box.
    3. Use your work from (b) along with the given information about cost to determine a formula for the total cost, \(C\text{,}\) oif the box in terms of \(x\) and \(h\text{.}\)
    4. Use the volume constraint given in the problem to write an equation that relates \(x\) and \(h\text{,}\) and solve that equation for \(h\) in terms of \(x\text{.}\)
    5. Combine your work in (c) and (d) to write the cost, \(C\text{,}\) of the box as a function solely of \(x\text{.}\)
    6. What is the domain of the cost function? How does a graph of the cost function appear? What does this suggest about the ideal box for the given constraints?
    11.

    A cylindrical can is being constructed so that its volume is \(16\) cubic inches. Suppose that material for the lids (the top and bottom) cost $\(0.11\) per square inch and material for the “side” of the can costs $\(0.07\) per square inch. Determine a formula for the total cost of the can as a function of the can's radius. What is the domain of the function and why?

    Hint

    You may find it helpful to ask yourself a sequence of questions like those stated in Exercise 10).

    <1> This activity is based on p. 457ff in Functions Modeling Change, by Connally et al.


    This page titled 5.4: Rational Functions is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Matthew Boelkins, David Austin & Steven Schlicker (ScholarWorks @Grand Valley State University) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.