Tutorials › AP Calculus › Domain Checks for Composite Derivatives

Chain Rule and Nested Functions · Tutorial 179 of 999

Domain Checks for Composite Derivatives

Learn to check a composite function’s original domain before applying derivative formulas, and to distinguish formula restrictions from actual differentiability.

Intermediate 10 min read

What You'll Learn

  • Determine the domain restrictions introduced by logarithms, square roots, and denominators.
  • Find where the usual chain-rule derivative formulas are valid.
  • Distinguish a function’s domain from the domain of a displayed derivative formula.
  • Check boundary points where a square-root derivative formula is undefined.
  • Recognize when a composite can be differentiable even though the chain rule does not apply at a point.

Why Domain Checks Come Before Differentiation

A chain-rule calculation can produce a plausible-looking formula even at an input where the original function is not defined. It can also leave out points where the composite itself is differentiable, because an outer derivative formula may fail even though the composite has a derivative there.

The reliable order is to identify where the original function exists, then apply the derivative rules where their hypotheses hold. Logarithms, square roots, and denominators each impose different restrictions, so the expression and its derivative need not have identical domains.

Key principle: First determine the domain of the original composite function. Then determine where the derivative formula applies. A formula’s denominator or square root can restrict the formula, but it does not by itself settle differentiability at every point excluded from that formula.

Three Restrictions to Check

For real-valued functions, the outer functions in these common compositions have the following domains:

  • \(\ln(u)\) is defined only when \(u>0\).
  • \(\sqrt{u}\) is defined when \(u\geq 0\).
  • \(\frac{1}{u}\) is defined only when \(u\neq 0\).

Here \(u\) stands for the inner expression, which may depend on \(x\). For a nested expression, each condition must hold at the same input. For example, the argument of a logarithm must be positive even if that argument contains a square root, and any denominator must also be nonzero.

The standard derivative formulas add their own conditions. If \(g\) is differentiable, then the chain rule gives

$$ \frac{d}{dx}\ln(g(x))=\frac{g'(x)}{g(x)} \qquad\text{where }g(x)>0, $$

and

$$ \frac{d}{dx}\sqrt{g(x)} = \frac{g'(x)}{2\sqrt{g(x)}} \qquad\text{where }g(x)>0. $$

For a reciprocal,

$$ \frac{d}{dx}\left(\frac{1}{g(x)}\right) = -\frac{g'(x)}{[g(x)]^2} \qquad\text{where }g(x)\neq 0. $$

These conditions are essential. In particular, the square-root function is defined at zero, but its usual derivative formula has \(\sqrt{g(x)}\) in the denominator and is therefore not available when \(g(x)=0\).

Why the Logarithm Condition Matters

The logarithm rule follows from the chain rule only at inputs where the outer function \(\ln(u)\) is defined and differentiable. The real logarithm has domain \(u>0\), and its derivative \(1/u\) is valid on that domain. Thus, if \(f(x)=\ln(g(x))\), an input with \(g(x)\leq 0\) is not merely a point where the derivative formula fails: it is outside the original function’s real domain.

At any input where \(g(x)>0\) and \(g\) is differentiable, the chain rule gives the formula. Indeed, the derivative of the outer function at \(u=g(x)\) is \(1/g(x)\), so multiplying by the inner derivative \(g'(x)\) gives \(g'(x)/g(x)\). This explains both the formula and its required condition.

Worked Example: A Logarithm of a Linear Expression

Find the domain and derivative of \(f(x)=\ln(5-2x)\).

Step 1: Find the original domain. The logarithm’s argument must be positive:

$$ 5-2x>0 \quad\Longrightarrow\quad -2x>-5 \quad\Longrightarrow\quad x<\frac{5}{2}. $$

Thus the domain of \(f\) is \((-\infty,\frac{5}{2})\).

Step 2: Differentiate where the condition holds. Let \(g(x)=5-2x\), so \(g'(x)=-2\). For every \(x<\frac{5}{2}\), \(g(x)>0\), and therefore

$$ f'(x)=\frac{g'(x)}{g(x)} =\frac{-2}{5-2x}, \qquad x<\frac{5}{2}. $$

Check: At \(x=1\), the original argument is \(5-2(1)=3>0\). The chain-rule calculation gives \(f'(1)=-2/3\), matching \(g'(1)/g(1)=-2/3\). At \(x=5/2\), the original argument is zero, so neither \(f(5/2)\) nor its derivative exists as a real-valued logarithmic composite.

Square Roots: The Function Domain and Formula Domain Differ

If \(f(x)=\sqrt{g(x)}\), its real domain requires \(g(x)\geq 0\). The usual chain-rule formula, however, requires \(g(x)>0\). This distinction matters at boundary inputs where \(g(x)=0\): the function may be defined there, although the formula cannot be used there.

At an endpoint of the function’s domain, the ordinary two-sided derivative is not defined unless the function also exists on an open interval around that input. Even when the domain contains points on both sides, a zero radicand still requires a separate differentiability check; the chain-rule formula alone does not decide the issue.

Worked Example: A Square Root with Finite Domain Endpoints

Find the domain and derivative of \(f(x)=\sqrt{9-x^2}\), and check what happens at its endpoints.

Step 1: Find the original domain. The radicand must be nonnegative:

$$ 9-x^2\geq 0 \quad\Longleftrightarrow\quad x^2\leq 9 \quad\Longleftrightarrow\quad -3\leq x\leq 3. $$

The function’s domain is \([-3,3]\).

Step 2: Apply the square-root formula where its condition holds. In the interior \(-3<x<3\), the radicand is positive. With \(g(x)=9-x^2\) and \(g'(x)=-2x\),

$$ f'(x) = \frac{-2x}{2\sqrt{9-x^2}} = -\frac{x}{\sqrt{9-x^2}}, \qquad -3<x<3. $$

Step 3: Check an endpoint. The function is defined at \(x=3\), with \(f(3)=0\). For inputs from the domain approaching 3, write \(x=3-h\), where \(h>0\). Then

$$ \frac{f(3-h)-f(3)}{(3-h)-3} = \frac{\sqrt{9-(3-h)^2}}{-h} = \frac{\sqrt{6h-h^2}}{-h}. $$

For \(0<h<6\), the numerator is at least \(\sqrt{5h}\) when \(0<h\leq 1\), so the quotient is at most \(-\sqrt{5}/\sqrt{h}\), which decreases without bound as \(h\) approaches zero. There is no finite left-hand derivative at \(3\). The ordinary two-sided derivative is also unavailable because the function is not defined to the right of \(3\).

Check: At \(x=0\), the radicand is \(9>0\), and the formula gives \(f'(0)=0\), consistent with the outer derivative \(1/(2\sqrt{9})\) multiplied by the inner derivative \(-2(0)=0\). The endpoints belong to the function domain but not to the domain of the displayed derivative formula.

Denominators: Exclude Zeros Before Using the Quotient

If a composite contains \(1/g(x)\), its original domain excludes every input where \(g(x)=0\). The reciprocal derivative formula has a squared \(g(x)\) in its denominator, so it is valid at precisely the inputs where \(g(x)\neq 0\), assuming \(g\) is differentiable there.

Worked Example: A Reciprocal of a Quadratic

Find the domain and derivative of \(f(x)=\frac{1}{x^2-4}\).

Step 1: Exclude zeros of the denominator.

$$ x^2-4\neq 0 \quad\Longleftrightarrow\quad (x-2)(x+2)\neq 0 \quad\Longleftrightarrow\quad x\neq 2,\;x\neq -2. $$

The domain is \(\mathbb{R}\setminus\{-2,2\}\).

Step 2: Differentiate on that domain. Put \(g(x)=x^2-4\), so \(g'(x)=2x\). Then

$$ f'(x) = -\frac{g'(x)}{[g(x)]^2} = -\frac{2x}{(x^2-4)^2}, \qquad x\neq -2,\;x\neq 2. $$

Check: At \(x=3\), \(g(3)=9-4=5\) and \(g'(3)=6\), so the reciprocal rule gives \(f'(3)=-6/25\). Substituting into the derivative formula also gives \(-2(3)/(9-4)^2=-6/25\). At \(x=2\) and \(x=-2\), the original function is undefined, so the derivative does not exist there.

Nested Restrictions Must Hold Together

When one restricted function is inside another, combine all the conditions instead of checking only the outermost operation. The logarithm condition is strict: its entire argument must be positive. A square root inside that argument may be defined when its radicand is zero, but the resulting logarithm still requires a positive value.

Worked Example: A Logarithm Containing a Quotient and a Square Root

Find the domain and derivative of

$$ f(x)=\ln\left(\frac{\sqrt{x-1}}{x-3}\right). $$

Step 1: Combine the original-function restrictions. The square root requires \(x-1\geq 0\), so \(x\geq 1\). The denominator requires \(x\neq 3\). The logarithm requires the quotient to be positive. Since \(\sqrt{x-1}=0\) at \(x=1\), the logarithm’s argument is not positive there. For \(x>1\), the square root is positive, so the quotient is positive exactly when \(x-3>0\). Combining the conditions gives \(x>3\). Thus the domain is \((3,\infty)\).

Step 2: Differentiate on the domain. For \(x>3\), the logarithm argument is positive, and logarithm rules allow

$$ f(x)=\frac{1}{2}\ln(x-1)-\ln(x-3). $$

Therefore,

$$ f'(x)=\frac{1}{2(x-1)}-\frac{1}{x-3}, \qquad x>3. $$

Check: At \(x=4\), the original logarithm argument is \(\sqrt{3}/1=\sqrt{3}>0\). The derivative formula gives \(1/(2\cdot3)-1/1=1/6-1=-5/6\). Differentiating the two logarithmic terms gives the same values \(1/6\) and \(1\), hence the same derivative, \(-5/6\). The domain condition \(4>3\) is satisfied.

When the Formula Fails but the Composite Has a Derivative

The square-root formula requires a positive radicand. If the radicand is zero, this formula gives no conclusion about differentiability of the composite. The chain rule requires the outer function to be differentiable at the inner function’s value; the square-root function is not differentiable at zero in the ordinary two-sided sense. The composite must instead be examined directly.

Worked Example: A Differentiable Composite at a Zero Radicand

Consider \(f(x)=\sqrt{x^4}\). Determine its derivative, including at \(x=0\).

Step 1: Check the domain. Since \(x^4\geq 0\) for every real \(x\), the original function is defined for all \(x\in\mathbb{R}\).

Step 2: Simplify the composite. Because \(x^2\geq 0\), \(\sqrt{x^4}=\sqrt{(x^2)^2}=x^2\). Therefore \(f(x)=x^2\) for every real \(x\), and \(f'(x)=2x\).

Step 3: Check the exceptional input directly. At \(x=0\), the derivative definition gives

$$ f'(0) = \lim_{h\to 0}\frac{f(h)-f(0)}{h} = \lim_{h\to 0}\frac{\sqrt{h^4}-0}{h} = \lim_{h\to 0}\frac{h^2}{h} = \lim_{h\to 0}h = 0. $$

Check: The simplified function \(x^2\) has derivative \(2x\), which gives \(f'(0)=0\), agreeing with the difference-quotient calculation. The direct chain-rule expression would be \(4x^3/(2\sqrt{x^4})\), which is undefined at \(x=0\). That failure means the formula cannot be used there; it does not mean the composite lacks a derivative.

A Common Mistake: Confusing the Formula with the Function

For \(f(x)=\ln(x^2-4)\), it is incorrect to say that the domain is all real numbers except \(\pm2\), just because those values make the derivative denominator zero. That checks only whether the derivative expression is defined. The original logarithm imposes a stronger condition:

$$ x^2-4>0 \quad\Longleftrightarrow\quad (x-2)(x+2)>0 \quad\Longleftrightarrow\quad x<-2\ \text{or}\ x>2. $$

Thus the function and its derivative are defined on \((-\infty,-2)\cup(2,\infty)\), not on the intervals between \(-2\) and \(2\). The mistaken approach checks for a nonzero logarithm argument, but a logarithm needs a positive argument. The correction is to apply the original function’s domain condition first, before differentiating.

A Reliable Domain-Check Routine

1
Inspect the original expression.
Mark every logarithm argument, square-root radicand, and denominator.
2
Write each original-domain condition.
Require logarithm arguments to be positive, radicands to be nonnegative, and denominators to be nonzero.
3
Intersect the conditions.
An input is allowed only if every restriction is satisfied at once.
4
Differentiate where the rules apply.
Check the hypotheses of the relevant derivative formula, especially at zero radicands.
5
Investigate excluded formula points when needed.
If the original function exists there, the formula alone does not determine whether the composite is differentiable.

These checks matter because a derivative is a limit of function values near an input. If the original function is not defined at an input, there is no derivative there. If the function is defined but a formula is unavailable, further reasoning may be needed. Keeping those two questions separate prevents both invalid derivatives and missed differentiability.

Check Your Understanding

For each question, first identify the original function’s domain, then decide where the stated derivative formula applies.

  1. Find the domain and derivative of \(f(x)=\ln(7-x)\).
  2. For \(g(x)=\sqrt{x+4}\), compare the function domain with the domain of the usual chain-rule derivative formula.
  3. Find the domain and derivative of \(h(x)=\frac{1}{x^2-9}\).
  4. Why does an undefined square-root chain-rule formula at a zero radicand not automatically prove that the composite is not differentiable there?
  5. For \(p(x)=\ln\left(\frac{\sqrt{x}}{x-2}\right)\), determine the domain by combining the restrictions.

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