Tutorials › AP Calculus › Differentiating Rational Functions

Power, Polynomial, and Rational Rules · Tutorial 131 of 999

Differentiating Rational Functions

Apply the quotient rule to polynomial ratios and keep track of the values excluded from the original function’s domain.

Intermediate 8 min read

What You'll Learn

  • Identify the domain of a rational function from its original denominator
  • Apply the quotient rule when the numerator and denominator are polynomials
  • Calculate and organize each part of the derivative formula
  • State where the derivative formula applies
  • Check derivative calculations at selected points
  • Recognize common sign and denominator errors

Why Rational Functions Need Careful Differentiation

A rational function is a quotient of polynomials. Its derivative involves the derivatives of both polynomials, but the function is not defined wherever its denominator is zero. Those restrictions matter throughout the calculation: the quotient rule applies only at inputs where the original denominator is nonzero.

For a function written as a quotient, the order of the terms in the quotient rule matters. Reversing the subtraction or forgetting to square the denominator changes the answer. A reliable method is to identify the numerator and denominator first, find their derivatives, and then substitute each part into the rule.

Definition: A rational function is a function of the form \(f(x)=\frac{p(x)}{q(x)}\), where \(p\) and \(q\) are polynomials and \(q\) is not the zero polynomial. In this quotient form, the original function is defined exactly at the real inputs \(x\) for which \(q(x)\ne 0\).

The Quotient Rule for Polynomial Ratios

If \(p\) and \(q\) are differentiable at \(x\), and \(q(x)\ne 0\), the quotient rule gives the derivative of their quotient. For rational functions, polynomials are differentiable for every real input, so the condition to check is that the denominator is nonzero.

Quotient Rule: If \(f(x)=\frac{p(x)}{q(x)}\), then at every input where \(q(x)\ne 0\), $$ f'(x)=\frac{p'(x)q(x)-p(x)q'(x)}{[q(x)]^2}. $$

The numerator of the derivative has a specific order: derivative of the top times the bottom, minus the top times derivative of the bottom. The denominator is the original denominator squared. Keeping these parts in order is especially important when the numerator and denominator both depend on \(x\).

Why the Rule Applies Throughout the Domain

Let \(p\) and \(q\) be polynomials, with \(q\) not the zero polynomial, and define \(f(x)=\frac{p(x)}{q(x)}\) wherever \(q(x)\ne 0\). At any real number \(a\) in this domain, both \(p\) and \(q\) are differentiable at \(a\), because polynomials are differentiable on the real numbers. Also \(q(a)\ne 0\), by the definition of the domain. Thus all the conditions of the quotient rule hold at \(a\), and

$$ f'(a)=\frac{p'(a)q(a)-p(a)q'(a)}{[q(a)]^2}. $$

Since this reasoning works for every \(a\) in the domain, the rational function is differentiable at every point of its domain, and the displayed formula gives its derivative there. It does not give a value at a point where \(q(a)=0\): the original function itself is undefined there.

This also explains why it is useful to write the domain before differentiating. The derivative formula inherits the restriction that the original denominator must be nonzero. Even if later algebra changes the appearance of the derivative expression, it does not change where the original function was defined.

A Reliable Calculation Process

Use the following sequence to keep the differentiation and domain information together:

1
Find the original domain.
Set the denominator unequal to zero and identify the real inputs that must be excluded.
2
Name the numerator and denominator.
Write \(p(x)\) for the top and \(q(x)\) for the bottom.
3
Differentiate each polynomial.
Find \(p'(x)\) and \(q'(x)\) before assembling the quotient rule.
4
Substitute in the correct order.
Form \(p'q-pq'\), and divide by \(q^2\).
5
State where the result applies.
The derivative is defined at the inputs in the original function’s domain.

Worked Examples

Worked Example: A Linear Denominator

Differentiate \(f(x)=\frac{x^2+3x+1}{x-2}\), and state the domain of the original function.

Step 1: Find the domain. The denominator is \(x-2\), so it must not equal zero:

$$x-2\ne 0 \quad\Longrightarrow\quad x\ne 2.$$

Thus \(f\) is defined for all real \(x\) except \(2\).

Step 2: Identify the polynomials and their derivatives.

$$p(x)=x^2+3x+1,\qquad p'(x)=2x+3,$$
$$q(x)=x-2,\qquad q'(x)=1.$$

Step 3: Apply the quotient rule.

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

Expand the first product: \((2x+3)(x-2)=2x^2-4x+3x-6=2x^2-x-6\). Then subtract the second polynomial:

$$2x^2-x-6-(x^2+3x+1)=2x^2-x-6-x^2-3x-1=x^2-4x-7.$$

Therefore, for \(x\ne 2\),

$$f'(x)=\frac{x^2-4x-7}{(x-2)^2}.$$

Check at \(x=0\). The formula gives \(f'(0)=\frac{-7}{4}\). From the derivative definition, \(f(0)=-\frac12\), and for nonzero \(h\) near zero,

$$\frac{f(h)-f(0)}{h}=\frac{\frac{h^2+3h+1}{h-2}+\frac12}{h}=\frac{2h^2+7h}{2h(h-2)}=\frac{2h+7}{2(h-2)}.$$

Taking the limit as \(h\) approaches zero gives \(\frac{7}{-4}=-\frac74\), matching the quotient-rule result.

Worked Example: A Quadratic Denominator with No Real Zeros

Differentiate \(g(x)=\frac{3x^2-2x+4}{x^2+1}\).

Step 1: Find the domain. For every real \(x\), \(x^2\ge 0\), so \(x^2+1\ge 1>0\). The denominator never vanishes, and the domain is all real numbers.

Step 2: Differentiate the numerator and denominator.

$$p(x)=3x^2-2x+4,\qquad p'(x)=6x-2,$$
$$q(x)=x^2+1,\qquad q'(x)=2x.$$

Step 3: Substitute into the quotient rule and expand.

$$g'(x)=\frac{(6x-2)(x^2+1)-(3x^2-2x+4)(2x)}{(x^2+1)^2}.$$

The first product is \((6x-2)(x^2+1)=6x^3-2x^2+6x-2\). The second is \((3x^2-2x+4)(2x)=6x^3-4x^2+8x\). Subtracting gives

$$6x^3-2x^2+6x-2-(6x^3-4x^2+8x)=2x^2-2x-2.$$

Hence \(g'(x)=\frac{2x^2-2x-2}{(x^2+1)^2}\), for every real \(x\).

Check at \(x=1\). Here \(p(1)=5\), \(p'(1)=4\), \(q(1)=2\), and \(q'(1)=2\). The quotient-rule numerator is \(4\cdot 2-5\cdot 2=8-10=-2\), and the denominator is \(2^2=4\). Thus \(g'(1)=-\frac12\). Substituting \(x=1\) in the expanded answer also gives \(\frac{2-2-2}{4}=-\frac12\).

Worked Example: Two Excluded Inputs

Differentiate \(h(x)=\frac{x^3+2x+1}{x^2-1}\), stating its domain and the domain of its derivative.

Step 1: Determine where the original denominator is nonzero.

$$x^2-1=(x-1)(x+1)\ne 0 \quad\Longrightarrow\quad x\ne 1\text{ and }x\ne -1.$$

The original function is defined for all real \(x\) except \(1\) and \(-1\).

Step 2: Differentiate the polynomials.

$$p(x)=x^3+2x+1,\qquad p'(x)=3x^2+2,$$
$$q(x)=x^2-1,\qquad q'(x)=2x.$$

Step 3: Apply the quotient rule.

$$h'(x)=\frac{(3x^2+2)(x^2-1)-(x^3+2x+1)(2x)}{(x^2-1)^2}.$$

Expand the first product: \((3x^2+2)(x^2-1)=3x^4-x^2-2\). Expand the second: \((x^3+2x+1)(2x)=2x^4+4x^2+2x\). Subtracting yields

$$3x^4-x^2-2-(2x^4+4x^2+2x)=x^4-5x^2-2x-2.$$

Therefore,

$$h'(x)=\frac{x^4-5x^2-2x-2}{(x^2-1)^2},\qquad x\ne -1,1.$$

Check at \(x=0\). The derivative formula gives \(-2\). Also \(h(0)=-1\), and

$$\frac{h(h_0)-h(0)}{h_0}$$

is not the appropriate expression because \(h_0\) has not been defined as an input. Instead let the increment be \(t\). For nonzero \(t\) near zero,

$$\frac{h(t)-h(0)}{t}=\frac{\frac{t^3+2t+1}{t^2-1}+1}{t}=\frac{t^3+t^2+2t}{t(t^2-1)}=\frac{t^2+t+2}{t^2-1}.$$

As \(t\) approaches zero, this tends to \(\frac{2}{-1}=-2\), confirming the result. The derivative, like the original function, is defined only when \(x\ne -1,1\).

Common Mistake: Reversing the Subtraction

For \(r(x)=\frac{x}{x+1}\), the domain is \(x\ne -1\). Since \(p=x\), \(p'=1\), \(q=x+1\), and \(q'=1\), the quotient rule gives

$$r'(x)=\frac{1(x+1)-x(1)}{(x+1)^2}=\frac{1}{(x+1)^2},\qquad x\ne -1.$$

A common incorrect calculation reverses the two numerator terms and writes \(x(1)-1(x+1)\). That produces \(-1\) in the numerator and the wrong derivative, \(-\frac{1}{(x+1)^2}\). The correction is to preserve the rule’s order: \(p'q-pq'\), not \(pq'-p'q\). Another error is to divide by \(q\) rather than \(q^2\); the quotient rule requires the square of the original denominator.

Keep the Original Domain in View

For each rational function, the denominator determines which inputs are excluded from the original function. The quotient rule gives the derivative only at inputs where that denominator is nonzero. A formula obtained during differentiation should therefore be accompanied by the original domain restriction, especially when the derivative expression’s appearance might obscure it.

When checking your work, confirm three things: the subtraction order is \(p'q-pq'\); the entire denominator is squared; and the stated inputs avoid every zero of the original denominator. These checks address both the algebra and the conditions under which the derivative exists.

Check Your Understanding

For each question, keep the domain of the original function in view as you work.

  1. For \(f(x)=\frac{x^2+1}{x+3}\), identify the domain and write the quotient-rule setup for \(f'(x)\).
  2. For \(g(x)=\frac{2x+1}{x^2+4}\), explain why its domain is all real numbers, then calculate \(g'(x)\).
  3. For \(h(x)=\frac{x^2-4}{x^2-5x+6}\), which two inputs are excluded from the original function?
  4. State the quotient rule, identifying the order of its numerator terms and its denominator.
  5. A student writes \(\frac{pq'-p'q}{q^2}\) for the derivative of \(\frac{p}{q}\). What is the error?

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon
Clinical Biostats