Rational Functions Advanced. This lesson goes beyond core Algebra I. You can skip it.

Learning goals

  • Exclude the zeros of the denominator from the domain
  • Graph 1x\tfrac{1}{x} as a hyperbola with two branches
  • Tell a vertical asymptote from a hole by whether the factor cancels
  • Compare degrees to find the horizontal asymptote
  • Read asymptotes x=hx = h and y=ky = k from the shifted form
  • Clear denominators, then discard extraneous candidates

What a rational function is

A rational function is a ratio of two polynomials,

f(x)=p(x)q(x),f(x) = \frac{p(x)}{q(x)},

where q(x)q(x) is not the zero polynomial (the polynomial that equals zero at every input). The word rational comes from ratio: just as a rational number is one integer over another, a rational function is one polynomial over another. Every polynomial you have already studied is a rational function in disguise, since you can write it over the denominator 11. But the new behavior shows up when the denominator contains the variable.

Our starting example is the reciprocal function

f(x)=1x.f(x) = \frac{1}{x}.

It sends 22 to 12\tfrac12, sends 12\tfrac12 to 22, and sends −4-4 to −14-\tfrac14, turning each input into its reciprocal. A few more examples show the range of shapes the definition allows:

x+1x−3,2xx2−9,x2−x−6x2−9.\frac{x + 1}{x - 3}, \qquad \frac{2x}{x^2 - 9}, \qquad \frac{x^2 - x - 6}{x^2 - 9}.

A variable denominator can exclude inputs and create lines that the graph approaches, called asymptotes. Neither feature is required. For example, (x+1)/(x2+4)(x+1)/(x^2+4) excludes no real input, though it has a horizontal asymptote. A polynomial such as x2=x2/1x^2=x^2/1 has no excluded inputs and no straight-line asymptotes.

Finding the domain

A polynomial accepts every real number, but a rational function is choosier. Wherever the denominator q(x)q(x) equals zero, the rule asks you to divide by zero, and that has no answer. So the domain of a rational function is every real number except the values that make the denominator zero. To find those forbidden inputs, set the denominator equal to zero and solve.

Why dividing by zero has no value#

The quotient 6/2=36/2=3 means 3⋅2=63\cdot2=6. In general, a/b=ca/b=c means c⋅b=ac\cdot b=a. What happens if the divisor is zero?

For 6/06/0, we would need c⋅0=6c\cdot0=6. Every number times zero is zero, so no number works. The same problem occurs for any nonzero aa:

c⋅0=0≠a.c\cdot0=0\ne a.

For 0/00/0, the requirement is c⋅0=0c\cdot0=0. Now every number works, including 11 and 22, so there is no unique quotient. Thus division by zero fails in both cases: a nonzero numerator gives no answer, and a zero numerator gives no single answer. This is why every zero of the denominator is excluded.

Worked example 1 Find the domain of three rational functions

For each one, set only the denominator to zero, since the numerator never restricts the domain.

For f(x)=x+5x−3f(x) = \dfrac{x + 5}{x - 3}, the denominator is zero when x−3=0x - 3 = 0, that is x=3x = 3. The domain is every real number except 33.

For g(x)=2x−1x2−x−6g(x) = \dfrac{2x - 1}{x^2 - x - 6}, factor the denominator to find its zeros:

x2−x−6=(x−3)(x+2)=0⟹x=3  or  x=−2.x^2 - x - 6 = (x - 3)(x + 2) = 0 \quad \Longrightarrow \quad x = 3 \ \text{ or } \ x = -2.

The domain is every real number except 33 and −2-2.

For h(x)=x+1x2+4h(x) = \dfrac{x + 1}{x^2 + 4}, set x2+4=0x^2 + 4 = 0, which gives x2=−4x^2 = -4. No real number has a negative square, so the denominator is never zero, and the domain is all real numbers with nothing to exclude.

Check your understanding

What is the domain of f(x)=x+2x2−x−12f(x) = \dfrac{x + 2}{x^2 - x - 12}?

Answer choices

The reciprocal function and its hyperbola

To see what a rational graph looks like, plot the reciprocal f(x)=1xf(x) = \frac{1}{x} point by point, keeping in mind that x=0x = 0 is barred from the domain:

xx−2-2−1-1−12-\tfrac1212\tfrac121122
y=1xy = \tfrac{1}{x}−12-\tfrac12−1-1−2-2221112\tfrac12

The points fall into two separate pieces, called branches. For positive inputs both coordinates are positive, so that branch lives in the upper-right quadrant. For negative inputs both coordinates are negative, so the other branch sits in the lower-left. The two branches never join, because to pass from one to the other the curve would have to cross x=0x = 0, and there is no point there. This two-branch curve is a hyperbola.

Look at what happens at the edges. As xx grows very large in size, say x=100x = 100 or x=1000x = 1000, the reciprocal 1x\frac{1}{x} becomes very small, 0.010.01 then 0.0010.001, creeping toward zero without ever equaling it. So far out to the left and right the curve snuggles down against the x-axis. The horizontal line the graph approaches this way is a horizontal asymptote, and here it is the line y=0y = 0.

Now let xx get very close to 00, say x=0.01x = 0.01. Then 1x=100\frac{1}{x} = 100, and at x=0.001x = 0.001 it is 10001000: the closer xx gets to zero, the larger 1x\frac{1}{x} becomes (or the more negative, for small negative xx). The curve rises along the y-axis without bound, hugging it ever more tightly but never landing on it, since x=0x = 0 is not allowed. The vertical line the graph runs along like this is a vertical asymptote, and here it is the line x=0x = 0.

The hyperbola y equals 1 over x with the axes as its asymptotesTwo branches of y equals 1 over x, in the first and third quadrants, each approaching the x-axis and the y-axis without meeting them.xy-3-2-112331-1-3(1, 1)(-1, -1)y = 1/xx = 0y = 0
The graph of y equals 1 over x is a hyperbola with two branches. For large x in either direction the curve flattens toward the x-axis, so y equals 0 is a horizontal asymptote; as x approaches 0 the curve shoots up or down along the y-axis, so x equals 0 is a vertical asymptote. The curve approaches both axes but never touches them, because x equals 0 is barred and 1 over x is never 0.

An asymptote is a straight line that describes the graph’s behavior far out along a branch. A horizontal asymptote describes a height approached as xx runs far to the left or right; one direction is enough for the definition. For rational functions, a horizontal asymptote describes both ends. A vertical asymptote describes unbounded outputs as xx approaches a fixed value. The line is a guide; a graph can cross a horizontal asymptote at an ordinary input, even though this reciprocal graph does not.

Check your understanding

The graph of y=−1xy = -\dfrac{1}{x} is a hyperbola with two branches. In which two quadrants do those branches lie?

Answer choices

Vertical asymptotes and holes

Compare 1/(x−2)1/(x-2) with (x2−4)/(x−2)(x^2-4)/(x-2). Both exclude x=2x=2, but their nearby values differ:

xx2.12.12.012.012.0012.001
1/(x−2)1/(x-2)101010010010001000
(x2−4)/(x−2)(x^2-4)/(x-2)4.14.14.014.014.0014.001

The first denominator shrinks while its numerator stays 11, so the outputs grow without bound. The second fraction simplifies to x+2x+2 for x≠2x\ne2. Its outputs approach 44, but (2,4)(2,4) is still missing.

Factor and cancel completely before deciding:

Canceling just one copy is not enough if another remains. For example, x−2(x−2)2=1x−2\dfrac{x-2}{(x-2)^2}=\dfrac1{x-2} for x≠2x\ne2, so it still has a vertical asymptote.

The signs can differ even when both graphs have a vertical asymptote. At x=1.9x=1.9 and x=2.1x=2.1, 1/(x−2)1/(x-2) gives −10-10 and 1010, while 1/(x−2)21/(x-2)^2 gives 100100 on both sides. An odd number of remaining copies of x−ax-a changes sign across aa; an even number does not. Either case still gives unbounded output size. For instance, x=2.000001x=2.000001 makes 1/(x−2)=1,000,0001/(x-2)=1{,}000{,}000.

In general, a leftover denominator factor shrinks toward zero while the reduced numerator stays near a nonzero value; complete cancellation instead leaves a formula with a finite value at the excluded input. A full proof of these general statements belongs in calculus, using limits and continuity.

Worked example 2 Find the vertical asymptotes of f(x)=x+4(x−1)(x+2)f(x) = \dfrac{x + 4}{(x - 1)(x + 2)}

The denominator is zero at x=1x = 1 and x=−2x = -2. Check whether either factor also cancels with the numerator x+4x + 4.

At x=1x = 1 the numerator is 1+4=51 + 4 = 5, and at x=−2x = -2 it is −2+4=2-2 + 4 = 2. Neither is zero, so neither factor cancels, and both survive in the denominator.

x=1andx=−2x = 1 \quad \text{and} \quad x = -2

are therefore vertical asymptotes. Near x=1x = 1, for instance, the numerator stays close to 55 while the denominator shrinks toward zero. So the fraction grows without bound, and the curve shoots off along the line x=1x = 1.

Worked example 3 Locate the hole and the asymptote of f(x)=x2−x−6x2−9f(x) = \dfrac{x^2 - x - 6}{x^2 - 9}

Factor the top and bottom completely and see what cancels:

f(x)=x2−x−6x2−9=(x−3)(x+2)(x−3)(x+3).f(x) = \frac{x^2 - x - 6}{x^2 - 9} = \frac{(x - 3)(x + 2)}{(x - 3)(x + 3)}.

The factor x−3x - 3 appears on both the top and the bottom, so it cancels, leaving

f(x)=x+2x+3(x≠3, x≠−3).f(x) = \frac{x + 2}{x + 3} \qquad (x \neq 3,\ x\neq-3).

Because x−3x - 3 canceled completely, x=3x = 3 gives a hole, not an asymptote. Its height is the value of the reduced form there,

3+23+3=56,\frac{3 + 2}{3 + 3} = \frac{5}{6},

so the hole sits at (3,56)\left(3, \tfrac{5}{6}\right). The other factor, x+3x + 3, does not cancel, so x=−3x = -3 is a genuine vertical asymptote. Both 33 and −3-3 are still excluded from the domain, but the graph looks different at each. The hole at x=3x = 3 is a single missing point, and the asymptote at x=−3x = -3 is a line the curve runs along.

The graph of (x squared minus 4) over (x minus 2) is the line y equals x plus 2 with a hole at 2 comma 4A straight line of slope 1 passing where y equals x plus 2, drawn solid except for an open circle at the point 2 comma 4 that marks the removed point.xy-2224hole (2, 4)y = x + 2
A hole, not an asymptote. Since (x squared minus 4) over (x minus 2) factors as (x minus 2)(x plus 2) over (x minus 2), the factor x minus 2 cancels and the graph is just the line y equals x plus 2, but with the single point at x equals 2 removed. The open circle at (2, 4) marks that hole. The graph does not blow up near x equals 2, because the shrinking denominator is canceled by a shrinking numerator.

Check your understanding

The graph of f(x)=x−4x2−16f(x) = \dfrac{x - 4}{x^2 - 16} has a hole at which point?

Answer choices

Horizontal asymptotes and end behavior

Vertical asymptotes describe what the graph does near a forbidden input. The horizontal asymptote describes the opposite edge: what height the graph settles toward as xx runs far out to the left and right. For large input sizes, a nonzero polynomial is dominated by its highest-power term.

Take x=1000x = 1000 in x2+5xx^2 + 5x. The square term is x2=1,000,000x^2 = 1{,}000{,}000, while 5x=5,0005x = 5{,}000 is 200200 times smaller and barely nudges the total. The larger xx becomes, the more completely the top-power term dwarfs everything else. So for the purpose of the far-out behavior, you may compare a rational function’s top and bottom by their leading terms alone. Assume both polynomials are nonzero. Let nn be the numerator degree and mm the denominator degree. Three cases result. (If the numerator is identically zero, every allowed output is simply zero.)

If n<mn < m, the denominator’s top power outgrows the numerator’s, so you are dividing a slower-growing quantity by a faster-growing one, and the ratio is squeezed toward zero. The horizontal asymptote is

y=0.y = 0.

If n=mn = m, the top and bottom grow at the same rate, and each is dominated by its leading term. Writing the leading coefficients as aa (top) and bb (bottom), the ratio settles toward

y=ab.y = \frac{a}{b}.

If n>mn > m, the numerator grows faster than the denominator, so the fraction grows without bound in size and never levels off. There is no horizontal asymptote. In the special case where the numerator is exactly one degree higher, the graph instead lines up far out with a slanted line called a slant asymptote. To see the idea without a new division method, expand (x−1)(x+1)+2=x2+1(x-1)(x+1)+2=x^2+1. It follows that

x2+1x−1=x+1+2x−1(x≠1).\frac{x^2+1}{x-1}=x+1+\frac2{x-1} \qquad (x\ne1).

The last term approaches zero for large positive or negative xx, so the graph approaches y=x+1y=x+1. The main degree rule remains: a higher numerator degree gives no horizontal asymptote.

Worked example 4 Find the horizontal asymptote in each degree case

Compare the degree of the top with the degree of the bottom.

For f(x)=3x+2x2−1f(x) = \dfrac{3x + 2}{x^2 - 1}, the top has degree 11 and the bottom degree 22, so n<mn < m. The bottom wins for large xx, dragging the ratio toward zero:

y=0.y = 0.

For g(x)=4x2−x2x2+7g(x) = \dfrac{4x^2 - x}{2x^2 + 7}, the degrees are equal at 22, so compare the leading terms. The leading coefficients are 44 on top and 22 on the bottom:

y=42=2.y = \frac{4}{2} = 2.

You can sanity-check this by plugging in x=100x = 100: the top is about 4(10000)=400004(10000) = 40000 and the bottom about 2(10000)=200002(10000) = 20000, a ratio near 22, exactly as predicted.

For h(x)=x3+1x2−5h(x) = \dfrac{x^3 + 1}{x^2 - 5}, the top has the higher degree, 33 against 22, so n>mn > m. The fraction grows without bound and there is no horizontal asymptote.

Check your understanding

What is the horizontal asymptote of f(x)=6x2+13x2−xf(x) = \dfrac{6x^2 + 1}{3x^2 - x}?

Answer choices

x-intercepts and shifting the hyperbola

A fraction equals zero only when its numerator equals zero (and its denominator does not). So to find where a rational graph crosses the x-axis, set the numerator to zero and solve. Then discard any solution that also makes the denominator zero, since that input is not even in the domain. For f(x)=x−3x+1f(x) = \dfrac{x - 3}{x + 1} the numerator is zero at x=3x = 3, and since the denominator there is 3+1=4≠03 + 1 = 4 \neq 0, the x-intercept is (3,0)(3, 0).

Reading a transformed reciprocal is just as direct. Every function of the form

f(x)=ax−h+k,a≠0,f(x) = \frac{a}{x - h} + k, \qquad a \neq 0,

is the basic hyperbola 1x\frac{1}{x} shifted and scaled, using the same moves you applied to other graphs. The x−hx - h in the denominator shifts the graph right by hh, which drags the vertical asymptote from x=0x = 0 over to x=hx = h. The +k+k on the outside lifts the whole graph up by kk, carrying the horizontal asymptote from y=0y = 0 up to y=ky = k. The factor aa scales the branches. Changing aa to its negative reflects them across the horizontal asymptote y=ky=k. So the two asymptotes cross at the point (h,k)(h, k), the new center of the hyperbola. The domain and range shift the same way: xx can be anything but hh, since that is where the fraction ax−h\frac{a}{x - h} has no value, and yy can be anything but kk, since adding kk to a fraction that never equals zero can never land exactly on kk.

The shifted hyperbola y equals 1 over (x minus 2) plus 1 with asymptotes x equals 2 and y equals 1A hyperbola centered at 2 comma 1, its two branches approaching the dashed vertical line x equals 2 and the dashed horizontal line y equals 1 without touching them.xy134-123(2, 1)x = 2y = 1y = 1/(x-2) + 1
Shifting the hyperbola. The rule y equals 1 over (x minus 2), plus 1 takes the reciprocal graph and slides it right 2 and up 1. The vertical asymptote moves from x equals 0 to the dashed line x equals 2, and the horizontal asymptote moves from y equals 0 to the dashed line y equals 1. The two asymptotes cross at the new center (2, 1), and the two branches hug them just as before.

Worked example 5 Analyze f(x)=2x+1−3f(x) = \dfrac{2}{x + 1} - 3

Match the rule to the form f(x)=ax−h+kf(x) = \dfrac{a}{x - h} + k. Writing x+1x + 1 as x−(−1)x - (-1) gives h=−1h = -1, and the constant is k=−3k = -3, with a=2a = 2.

The vertical asymptote sits where the denominator is zero, at x=−1x = -1, and the horizontal asymptote is the added constant, y=−3y = -3. The center of the hyperbola is where they cross, (−1,−3)(-1, -3).

Now read off the intercepts. The y-intercept comes from x=0x = 0:

f(0)=20+1−3=2−3=−1,f(0) = \frac{2}{0 + 1} - 3 = 2 - 3 = -1,

so the graph crosses the y-axis at (0,−1)(0, -1). The x-intercept comes from setting f(x)=0f(x) = 0:

2x+1=3⟹2=3(x+1)⟹x=−13,\frac{2}{x + 1} = 3 \quad \Longrightarrow \quad 2 = 3(x + 1) \quad \Longrightarrow \quad x = -\frac{1}{3},

so the graph crosses the x-axis at (−13,0)\left(-\tfrac{1}{3}, 0\right). With the two asymptotes and these two crossings, you have enough information to sketch this shifted reciprocal.

Check your understanding

What are the vertical asymptote, horizontal asymptote, and center of f(x)=3x+2−4f(x) = \dfrac{3}{x + 2} - 4?

Answer choices

Rebuild worked example 5 in the interactive graph: set a=2a=2, h=−1h=-1, and k=−3k=-3. The dashed asymptotes become x=−1x=-1 and y=−3y=-3.

Now change one control at a time. Moving hh shifts the vertical asymptote; at h=−1h=-1, the denominator reads x+1x+1, and the graph shifts left by 11. Moving kk shifts the horizontal asymptote. Changing aa from positive to negative reflects the branches across that horizontal line.

At a=0a=0, the rule gives y=ky=k at every allowed input. The graph is a horizontal line with its point at x=hx=h missing, because 0/00/0 is still undefined. There is no vertical asymptote in this special case. The interactive graph still shows the dashed vertical guide at x=hx=h; when a=0a=0, that guide marks the excluded input, not an asymptote.

Slide the hyperbola y=ax−h+ky = \frac{a}{x - h} + k

y = 1/x. Its center sits at (0, 0), not shifted at all. One branch lies above and to the right of it and the other below and to the left. It never reaches x = 0 or y = 0: those are its asymptotes. A coordinate plane with the graph of 1/x drawn on it, with its center marked. Two dashed lines mark the values the curve never reaches. Use the controls below the figure to stretch it, or to shift it across or up and down. -6 -4 -2 2 4 6 -6 -4 -2 2 4 6
Stretch a Inside h Outside k

y = 1/x. Its center sits at (0, 0), not shifted at all. One branch lies above and to the right of it and the other below and to the left. It never reaches x = 0 or y = 0: those are its asymptotes.

For a nonzero coefficient, a hyperbola approaches the two dashed asymptotes without meeting them. The inside shift carries the vertical one sideways, the outside shift carries the horizontal one up and down, and the coefficient stretches the two branches or flips them over.

Solving a rational equation

To solve an equation that has variables in a denominator, clear the fractions by multiplying every term by a common denominator. Then solve the polynomial equation that remains, and finally throw out any candidate that makes an original denominator zero. Do not skip that last step. Multiplying by an expression that could be zero can introduce a false solution, an extraneous one, exactly as squaring did for radical equations.

Worked example 6 Solve two rational equations, one of which has an extraneous solution

First solve 3x+1=2x−4\dfrac{3}{x + 1} = \dfrac{2}{x - 4}. The restrictions are x≠−1x\ne-1 and x≠4x\ne4. On those allowed inputs, multiply both sides by (x+1)(x−4)(x+1)(x-4) to clear the denominators:

3(x−4)=2(x+1)⟹3x−12=2x+2⟹x=14.3(x - 4) = 2(x + 1) \quad \Longrightarrow \quad 3x - 12 = 2x + 2 \quad \Longrightarrow \quad x = 14.

The candidate 1414 is allowed. Substitution gives 3/15=2/10=1/53/15=2/10=1/5, so the only solution is x=14x=14.

Now solve xx−2=2x−2+3\dfrac{x}{x - 2} = \dfrac{2}{x - 2} + 3, where x≠2x\ne2. Multiply every term by x−2x-2:

x=2+3(x−2)⟹x=3x−4⟹x=2.x = 2 + 3(x - 2) \quad \Longrightarrow \quad x = 3x - 4 \quad \Longrightarrow \quad x = 2.

Before celebrating, check the candidate against the original denominators. Here x=2x = 2 makes x−2=0x - 2 = 0, so it was never in the domain. The candidate is extraneous, and the equation has no solution.

Check your understanding

Solve xx−3=3x−3+2\dfrac{x}{x-3} = \dfrac{3}{x-3} + 2 for xx, and state whether the result is a genuine solution.

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

Consider the area between the positive branch of y=1/xy=1/x and the x-axis, starting at x=1x=1 and ending at a number b>1b>1. How does that area grow as bb increases?

In work published in 1647, the Flemish mathematician Grégoire de Saint-Vincent studied areas under a hyperbola. In today’s coordinates, the slabs under y=1/xy=1/x from 11 to 22, from 22 to 44, and from 44 to 88 have equal areas. Each slab is wider but lower than the one before. More generally, multiplying a positive endpoint by the same factor adds the same area. (Saint-Vincent’s area result)

His pupil Alphonse Antonio de Sarasa connected this behavior to logarithms: multiplying inputs adds logarithms. The area from 11 to b>1b>1 under 1/x1/x is what we now call the natural logarithm of bb.

Your progress

See all your progress →