practicecalculus
Algebraic functions

Rational Functions: Asymptotes, Holes, Derivatives and Integrals

Rational functions P(x)/Q(x): domain, vertical and horizontal asymptotes, holes, derivatives with the quotient rule and integrals by partial fractions.

Algebraic functions Updated 3 min read

At a glance

f(x) = \frac{P(x)}{Q(x)}, \quad Q(x) \ne 0
Domain
All x with Q(x) \ne 0
Derivative
\frac{P'(x)Q(x) - P(x)Q'(x)}{Q(x)^2}
Integral
\int \frac{A}{x - r}\,dx = A\ln|x - r| + C
Vertical asymptotes
Zeros of Q that do not cancel
Horizontal asymptote
Compare the degrees of P and Q
Integration method
Long division, then partial fractions
On this page
  1. Definition and formula
  2. Graph of a rational function
  3. Asymptotes and holes
  4. Derivative of a rational function
  5. Integrating rational functions
  6. Worked examples
  7. Common mistakes
  8. How it connects

A rational function is one polynomial divided by another. They are defined everywhere except where the denominator is zero, and the behavior near those points, asymptotes and holes, is what makes them central to limits, curve sketching and integration.

Definition and formula

f(x) = \frac{P(x)}{Q(x)}, \qquad Q(x) \ne 0

P and Q are polynomials and Q is not the zero polynomial. The simplest example is the reciprocal function \frac{1}{x}. Others include \frac{2x + 1}{x - 1} and \frac{x^2 - 4}{x - 2}.

Graph of a rational function

Graph of the rational function y = (2x + 1)/(x - 1) with its asymptotes
The vertical asymptote is x = 1 and the horizontal asymptote is y = 2, the ratio of the leading coefficients.

Asymptotes and holes

Factor P and Q completely first.

  • Hole. A factor (x - a) that cancels from top and bottom leaves a removable discontinuity at x = a. Example: \frac{x^2 - 4}{x - 2} = x + 2 for x \ne 2, a line with a hole at (2, 4).
  • Vertical asymptote. A zero a of the denominator that remains after cancelling. Near x = a the function heads to \pm\infty, so the one-sided limits are infinite.
  • Horizontal asymptote. From limits at infinity, with \deg P = m and \deg Q = n:
Degrees Behavior as x \to \pm\infty
m < n asymptote y = 0
m = n asymptote y = \frac{\text{leading coeff of } P}{\text{leading coeff of } Q}
m = n + 1 slant asymptote from long division
m > n + 1 no line asymptote

Derivative of a rational function

Use the quotient rule:

\frac{d}{dx}\,\frac{P(x)}{Q(x)} = \frac{P'(x)Q(x) - P(x)Q'(x)}{Q(x)^2}

The derivative is again a rational function with the same points excluded from its domain.

Integrating rational functions

There is no single formula. The standard method is:

  1. If \deg P \ge \deg Q, divide to get a polynomial plus a proper fraction.
  2. Factor Q and split the proper fraction with partial fractions.
  3. Integrate each piece. Linear factors give logarithms, \int \frac{A}{x - r}\,dx = A\ln|x - r| + C; irreducible quadratics give arctangents.

Worked examples

Example 1: asymptotes. For f(x) = \frac{2x + 1}{x - 1}, nothing cancels, so x = 1 is a vertical asymptote. Degrees are equal, so y = \frac{2}{1} = 2 is the horizontal asymptote.

Example 2: derivative. With P = 2x + 1 and Q = x - 1:

f'(x) = \frac{2(x - 1) - (2x + 1)(1)}{(x - 1)^2} = \frac{-3}{(x - 1)^2}

The derivative is always negative, so f decreases on each side of the asymptote.

Example 3: a limit with a hole. \lim_{x \to 2} \frac{x^2 - 4}{x - 2} = \lim_{x \to 2} (x + 2) = 4.

Example 4: integral by partial fractions. Since \frac{1}{x^2 - 1} = \frac{1/2}{x - 1} - \frac{1/2}{x + 1},

\int \frac{1}{x^2 - 1}\,dx = \frac{1}{2}\ln\left|\frac{x - 1}{x + 1}\right| + C

Common mistakes

  1. Declaring every denominator zero an asymptote. Cancel common factors first; cancelled factors give holes.
  2. Cancelling terms instead of factors. \frac{x + 4}{x + 2} \ne \frac{4}{2}. Only common factors cancel.
  3. Mixing up the quotient rule order. The numerator is P'Q - PQ'; reversing it flips the sign.
  4. Using partial fractions on an improper fraction. Divide first when \deg P \ge \deg Q.

How it connects

Rational functions are the standard source of \frac{0}{0} limits, the test case for L'Hôpital's rule, and the main application of partial fractions in Calculus 2. Their sketches use every tool from curve sketching.

Practice it now

The quotient rule

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

How do you find the vertical asymptotes of a rational function?

Factor and cancel any common factors, then set the remaining denominator equal to zero. Each zero that is left gives a vertical asymptote; a factor that cancelled gives a hole instead.

How do you find the horizontal asymptote of a rational function?

Compare degrees. If the denominator has higher degree, the asymptote is y = 0. If the degrees are equal, it is the ratio of leading coefficients. If the numerator has higher degree, there is no horizontal asymptote.

How do you differentiate a rational function?

Use the quotient rule: \left(\frac{P}{Q}\right)' = \frac{P'Q - PQ'}{Q^2}. For a simple denominator it can be quicker to rewrite with a negative exponent and use the chain rule.

How do you integrate a rational function?

If the numerator degree is at least the denominator degree, do polynomial long division first. Then split the proper fraction with partial fractions, which integrate to logarithms, powers and arctangents.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.