Chapter 2: Definition and Basic Derivative Rules

AP Calculus AB/BC · Updated March 2026 · 25 min read

Learning Objectives

After completing this chapter, you will be able to:

In Chapter 1 we studied limits and continuity, the foundational ideas that make calculus possible. Now we turn to the first of the two central operations of calculus: differentiation. The derivative measures how a function changes as its input changes, and it has applications throughout science, engineering, economics, and beyond. In this chapter we will define the derivative precisely, develop the rules that make computing derivatives efficient, and apply those rules to polynomial, trigonometric, exponential, and logarithmic functions.

Table of Contents

2.1 The Derivative as a Limit

Consider a function $y = f(x)$ and two points on its graph: $(x, f(x))$ and $(x+h, f(x+h))$. The slope of the straight line connecting these two points is the difference quotient:

$$\text{slope of secant} = \frac{f(x+h) - f(x)}{h}$$

This secant line gives an average rate of change of $f$ over the interval from $x$ to $x+h$. As we let $h$ shrink toward zero, the secant line rotates and approaches the tangent line to the curve at the point $(x, f(x))$. The slope of that tangent line is the instantaneous rate of change of $f$ at $x$, and this is precisely what we call the derivative.

Average Rate of Change vs. Instantaneous Rate of Change

These two ideas — slope between two points and slope at one point — are the heart of differential calculus. The table below shows how they relate and what each one is called.

Average Rate of Change Instantaneous Rate of Change
Also called Mean value · Average slope · Difference quotient Derivative · Differential coefficient · $f'(x)$
Geometric meaning Slope of the secant line through two points on the curve Slope of the tangent line at a single point on the curve
Formula $\dfrac{f(b)-f(a)}{b-a} = \dfrac{\Delta y}{\Delta x}$ $\displaystyle\lim_{h \to 0}\dfrac{f(x+h)-f(x)}{h} = f'(x)$
Notation $\dfrac{\Delta y}{\Delta x}$ $\dfrac{dy}{dx}$,   $f'(x)$,   $D_x f$
Requires Two distinct points: $(a,\, f(a))$ and $(b,\, f(b))$ One point: $(x,\, f(x))$, obtained by taking a limit
Key idea How much did $f$ change on average over an interval? How fast is $f$ changing right now at a single input?

Figure 2.1a — Average Rate of Change. The blue secant line passes through two points $A$ and $B$. Its slope $= \dfrac{\Delta y}{\Delta x}$ is the average rate of change. Move the $b$ slider to change where $B$ is.

Figure 2.1b — Instantaneous Rate of Change. As $h \to 0$, point $B$ approaches $A$ and the secant line becomes the red tangent line. That limiting slope is $f'(a)$.

Definition 2.1 — The Derivative (Three Equivalent Forms)

The derivative of a function $f$ is defined by any of the following equivalent limit expressions. All three describe the same instantaneous rate of change.

Form 1 — The $h$-form (derivative as a function of $x$):

$$f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$$

Form 2 — The $\Delta x$-form (same as Form 1, different notation):

$$f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}$$

Form 3 — The point form (derivative at a specific point $x = a$):

$$f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}$$

The limit must exist for $f$ to be differentiable at that point. Forms 1 and 2 are interchangeable; Form 3 is especially useful when evaluating $f'$ at a specific value $a$.

Equivalent notations for the derivative include $\dfrac{dy}{dx}$, $\dfrac{df}{dx}$, and $D_x[f(x)]$. Each emphasizes a slightly different perspective: Leibniz notation $\dfrac{dy}{dx}$ highlights the ratio-of-changes origin, while prime notation $f'(x)$ is compact and convenient for algebraic work.

Geometric Interpretation

Geometrically, $f'(a)$ is the slope of the line tangent to $y = f(x)$ at $x = a$. The equation of this tangent line is:

$$y - f(a) = f'(a)(x - a)$$

If $f'(a) > 0$, the function is increasing at $x = a$. If $f'(a) < 0$, the function is decreasing. If $f'(a) = 0$, the tangent line is horizontal, which often corresponds to a local maximum, local minimum, or inflection point.

Figure 2.1 — Tangent line via secant limit. Drag the slider to move the point of tangency along $f(x) = x^3 - 3x$. The dashed red line is the tangent; the dashed green curve is the derivative $f'(x)$. The slope of the tangent at any point equals the value of $f'$ there.

Computing Derivatives from the Definition

Before we develop shortcut rules, it is important to be able to compute derivatives directly from the limit definition. The standard procedure is:

  1. Write out $f(x+h)$ by substituting $(x+h)$ everywhere $x$ appears.
  2. Compute the difference $f(x+h) - f(x)$ and simplify.
  3. Divide by $h$ and cancel or simplify so that direct substitution of $h = 0$ is possible.
  4. Evaluate the limit as $h \to 0$.
Example 2.1 — Derivative of a Polynomial from the Definition

Find $f'(x)$ for $f(x) = 3x^2 - 5x + 1$ using the limit definition.

Solution. We compute:

$$f(x+h) = 3(x+h)^2 - 5(x+h) + 1 = 3x^2 + 6xh + 3h^2 - 5x - 5h + 1$$

The difference is:

$$f(x+h) - f(x) = (3x^2 + 6xh + 3h^2 - 5x - 5h + 1) - (3x^2 - 5x + 1) = 6xh + 3h^2 - 5h$$

Dividing by $h$:

$$\frac{f(x+h) - f(x)}{h} = \frac{h(6x + 3h - 5)}{h} = 6x + 3h - 5$$

Taking the limit:

$$f'(x) = \lim_{h \to 0}(6x + 3h - 5) = 6x - 5$$

Try It 2.1

Use the limit definition to find $f'(x)$ for $f(x) = 5x^2 - 2x + 3$. Hint: Follow the same four steps above; the algebra is nearly identical.

Example 2.2 — Derivative of a Square Root Function

Find $f'(x)$ for $f(x) = \sqrt{x}$ using the limit definition.

Solution. We write:

$$f'(x) = \lim_{h \to 0} \frac{\sqrt{x+h} - \sqrt{x}}{h}$$

Direct substitution gives $\frac{0}{0}$, so we rationalize the numerator by multiplying by the conjugate:

$$= \lim_{h \to 0} \frac{(\sqrt{x+h} - \sqrt{x})(\sqrt{x+h} + \sqrt{x})}{h(\sqrt{x+h} + \sqrt{x})} = \lim_{h \to 0} \frac{(x+h) - x}{h(\sqrt{x+h} + \sqrt{x})}$$ $$= \lim_{h \to 0} \frac{h}{h(\sqrt{x+h} + \sqrt{x})} = \lim_{h \to 0} \frac{1}{\sqrt{x+h} + \sqrt{x}}$$

Now substituting $h = 0$:

$$f'(x) = \frac{1}{2\sqrt{x}}, \quad x > 0$$

Note that this result is consistent with the power rule applied to $x^{1/2}$, which we develop in the next section.

Try It 2.2

Use the limit definition to find $f'(x)$ for $f(x) = \dfrac{1}{x}$. Hint: Combine the fractions $\dfrac{1}{x+h} - \dfrac{1}{x}$ over a common denominator before dividing by $h$.

When Is a Function Not Differentiable?

Not every continuous function has a derivative everywhere. There are three classic types of points where a function is continuous but fails to be differentiable.

Definition 2.2 — Types of Non-Differentiable Points A function $f$ is not differentiable at $x = a$ if the limit $\displaystyle\lim_{h \to 0} \frac{f(a+h)-f(a)}{h}$ does not exist. This occurs at:

Figure 2.2a — Corner. $f(x)=|x|$ is continuous everywhere but has no tangent at the origin.

Figure 2.2b — Cusp. $f(x)=x^{2/3}$ has a sharp point at the origin where the slope is infinite.

Figure 2.2c — Vertical tangent. $f(x)=x^{1/3}$ has a vertical tangent at the origin; the slope is undefined.

★ AP Exam Tip: On the AP exam you may be shown a graph and asked whether a function is differentiable at a specific point. Look for corners, cusps, vertical tangents, and discontinuities — all four are reasons a derivative may fail to exist. A function must be smooth (no abrupt direction changes) and continuous to be differentiable.

Differentiability and Continuity

Theorem 2.0 — Differentiability Implies Continuity If $f$ is differentiable at $x = a$, then $f$ is continuous at $x = a$.

Proof sketch. We want to show $\lim_{x \to a} f(x) = f(a)$, i.e., $\lim_{h \to 0} [f(a+h) - f(a)] = 0$. Write:

$$f(a+h) - f(a) = \frac{f(a+h) - f(a)}{h} \cdot h$$

Taking the limit as $h \to 0$:

$$\lim_{h \to 0}[f(a+h) - f(a)] = \lim_{h \to 0}\frac{f(a+h)-f(a)}{h} \cdot \lim_{h \to 0} h = f'(a) \cdot 0 = 0$$

Therefore $\lim_{h \to 0} f(a+h) = f(a)$, which is exactly continuity. $\square$

Important: The Converse Is False

A function can be continuous at a point without being differentiable there. The function $f(x) = |x|$ is continuous at $x = 0$ (it has no gaps or jumps), but it has a corner at the origin, so $f'(0)$ does not exist. Continuity is necessary but not sufficient for differentiability.

2.2 Basic Differentiation Rules

Using the limit definition for every derivative would be tedious. Fortunately, a small collection of rules allows us to differentiate most functions quickly. Each of these rules can be proved rigorously using the limit definition, but we state them as theorems and focus on their application.

Theorem 2.1 — Power Rule If $n$ is any real number, then $$\frac{d}{dx}[x^n] = nx^{n-1}$$

The power rule works not just for positive integers but for all real exponents: negative integers, fractions, and irrational numbers. For instance, $\frac{d}{dx}[x^{-3}] = -3x^{-4}$ and $\frac{d}{dx}[x^{\pi}] = \pi x^{\pi - 1}$.

Figure 2.3 — The Power Rule. Adjust the exponent $n$ with the slider. The blue curve is $f(x) = x^n$ and the dashed red curve is its derivative $f'(x) = nx^{n-1}$. Notice how the derivative of a degree-$n$ curve is a degree-$(n-1)$ curve.

Theorem 2.2 — Constant Multiple Rule If $c$ is a constant and $f$ is differentiable, then $$\frac{d}{dx}[c \cdot f(x)] = c \cdot f'(x)$$

In words: constants factor out of the derivative. This follows immediately from the limit definition, since we can factor a constant out of a limit.

Theorem 2.3 — Sum and Difference Rules If $f$ and $g$ are both differentiable, then $$\frac{d}{dx}[f(x) \pm g(x)] = f'(x) \pm g'(x)$$

The derivative of a sum (or difference) is the sum (or difference) of the derivatives. Combined with the power rule and constant multiple rule, this lets us differentiate any polynomial term by term.

Theorem 2.4 — Constant Rule If $c$ is a constant, then $\frac{d}{dx}[c] = 0$.

This makes intuitive sense: a constant function has a horizontal graph, so its slope is zero everywhere.

Example 2.3 — Differentiating a Polynomial

Find $\frac{dy}{dx}$ for $y = 4x^5 - 7x^3 + 2x - 9$.

Solution. Applying the power rule term by term:

$$\frac{dy}{dx} = 4 \cdot 5x^4 - 7 \cdot 3x^2 + 2 \cdot 1 - 0 = 20x^4 - 21x^2 + 2$$

Try It 2.3

Differentiate $y = 3x^6 - 8x^4 + x^2 - 5$. Hint: Apply the power rule to each term independently, then subtract zero for the constant.

Example 2.4 — Rewriting Before Differentiating

Find $f'(x)$ for $f(x) = \dfrac{3}{x^2} - \dfrac{5}{\sqrt{x}} + 8$.

Solution. First rewrite using negative and fractional exponents:

$$f(x) = 3x^{-2} - 5x^{-1/2} + 8$$

Now apply the power rule to each term:

$$f'(x) = 3(-2)x^{-3} - 5\!\left(-\tfrac{1}{2}\right)x^{-3/2} + 0 = -6x^{-3} + \frac{5}{2}x^{-3/2}$$

Rewriting in radical form:

$$f'(x) = -\frac{6}{x^3} + \frac{5}{2x\sqrt{x}}$$

Try It 2.4

Find $f'(x)$ for $f(x) = \dfrac{4}{x^3} + 6\sqrt[4]{x} - 2$. Hint: Rewrite as $4x^{-3} + 6x^{1/4} - 2$ first.

Example 2.5 — Finding a Tangent Line

Find the equation of the tangent line to $y = x^3 - 4x + 2$ at the point where $x = 1$.

Solution. First, find the $y$-coordinate: $y(1) = 1 - 4 + 2 = -1$. So the point is $(1, -1)$.

Next, compute the derivative: $y' = 3x^2 - 4$. At $x = 1$:

$$y'(1) = 3(1)^2 - 4 = -1$$

Using point-slope form:

$$y - (-1) = -1(x - 1) \implies y = -x$$

The tangent line is $y = -x$.

Try It 2.5

Find the equation of the tangent line to $y = 2x^2 - 3x + 1$ at $x = 2$. Hint: Compute $y(2)$ for the point, $y'(x)$ for the slope formula, then evaluate $y'(2)$.

Higher-Order Derivatives

Since the derivative $f'(x)$ is itself a function, we can differentiate it again. The derivative of $f'$ is called the second derivative of $f$, denoted $f''(x)$ or $\dfrac{d^2y}{dx^2}$. We can continue this process to obtain derivatives of any order.

Order Prime notation Leibniz notation Read as
First$f'(x)$$\dfrac{dy}{dx}$"$f$ prime of $x$"
Second$f''(x)$$\dfrac{d^2y}{dx^2}$"$f$ double prime of $x$"
Third$f'''(x)$$\dfrac{d^3y}{dx^3}$"$f$ triple prime of $x$"
$n$-th$f^{(n)}(x)$$\dfrac{d^ny}{dx^n}$"$f$ to the $n$-th"
Example 2.5b — All Derivatives of a Polynomial

Find all nonzero derivatives of $f(x) = 4x^3 - 2x^2 + 5x - 1$.

Solution.

$$f'(x) = 12x^2 - 4x + 5$$ $$f''(x) = 24x - 4$$ $$f'''(x) = 24$$ $$f^{(4)}(x) = 0$$

All derivatives of order 4 and higher are identically zero. This always happens for polynomials: once we differentiate enough times, the degree reaches zero and the next derivative is the zero function.

Try It 2.5b

Find $f''(x)$ for $f(x) = 3x^4 - x^3 + 7x$. Then evaluate $f''(2)$. Hint: Differentiate $f'(x)$ a second time, then substitute $x = 2$.

Physical meaning. In mechanics, if $s(t)$ represents the position of an object at time $t$, then:

For example, if $s(t) = 4t^3 - 6t^2 + 2t$, then $v(t) = 12t^2 - 12t + 2$ and $a(t) = 24t - 12$.

★ AP Exam Tip: Second derivatives appear on the AP exam in concavity questions. When $f''(x) > 0$, the graph of $f$ is concave up (like a cup); when $f''(x) < 0$, it is concave down (like a cap). You will use this in Chapter 5 when analyzing curve behavior. Start recognizing $f''$ as a measure of "how fast the slope is changing."

2.3 Derivatives of Trigonometric Functions

The six trigonometric functions arise constantly in calculus, so knowing their derivatives is essential. We start by deriving the most fundamental one from the limit definition, then list all six.

Derivation of $\frac{d}{dx}[\sin x]$

Using the limit definition:

$$\frac{d}{dx}[\sin x] = \lim_{h \to 0} \frac{\sin(x+h) - \sin x}{h}$$

Apply the angle addition formula $\sin(x+h) = \sin x \cos h + \cos x \sin h$:

$$= \lim_{h \to 0} \frac{\sin x \cos h + \cos x \sin h - \sin x}{h}$$ $$= \lim_{h \to 0} \left[\sin x \cdot \frac{\cos h - 1}{h} + \cos x \cdot \frac{\sin h}{h}\right]$$

We use two special limits that were established in Chapter 1:

$$\lim_{h \to 0} \frac{\sin h}{h} = 1, \qquad \lim_{h \to 0} \frac{\cos h - 1}{h} = 0$$

Therefore:

$$\frac{d}{dx}[\sin x] = \sin x \cdot 0 + \cos x \cdot 1 = \cos x$$

All Six Trigonometric Derivatives

A similar analysis for the remaining five functions yields the complete list:

$f(x)$ $f'(x)$
$\sin x$$\cos x$
$\cos x$$-\sin x$
$\tan x$$\sec^2 x$
$\cot x$$-\csc^2 x$
$\sec x$$\sec x \tan x$
$\csc x$$-\csc x \cot x$

★ AP Exam Tip: The derivatives of the "co-" functions (cosine, cotangent, cosecant) always carry a negative sign. This is the single most reliable pattern for memorizing the trig derivative table. On a free-response question, a missing negative sign is a very common error.

Figure 2.4 — $\sin x$ and its derivative $\cos x$. The blue curve is $y = \sin x$ and the red curve is $y = \cos x = \frac{d}{dx}[\sin x]$. Observe that $\cos x = 0$ exactly where $\sin x$ has a horizontal tangent (peaks and troughs), confirming the derivative relationship geometrically.

Example 2.6 — Combining Trig and Power Rules

Differentiate $g(x) = 5\sin x - 2\cos x + 3x^2$.

Solution. Using the sum rule, constant multiple rule, and trig derivatives:

$$g'(x) = 5\cos x - 2(-\sin x) + 6x = 5\cos x + 2\sin x + 6x$$

Try It 2.6

Differentiate $h(x) = 4\cos x + 3\tan x - 2x^3$. Hint: Each term differentiates independently. Remember the derivative of $\tan x$ is $\sec^2 x$.

Example 2.7 — Tangent Line to a Trig Function

Find the slope of the tangent line to $y = \tan x$ at $x = \frac{\pi}{4}$.

Solution. Since $\frac{d}{dx}[\tan x] = \sec^2 x$:

$$y'\!\left(\frac{\pi}{4}\right) = \sec^2\!\left(\frac{\pi}{4}\right) = \left(\frac{1}{\cos(\pi/4)}\right)^2 = \left(\frac{1}{{\sqrt{2}}/{2}}\right)^2 = (\sqrt{2})^2 = 2$$

The slope of the tangent line at $x = \frac{\pi}{4}$ is $2$.

Try It 2.7

Find the slope of the tangent line to $y = \sin x$ at $x = \dfrac{\pi}{6}$. Then write the equation of the tangent line. Hint: Compute $y'(\pi/6)$ and $y(\pi/6)$, then use point-slope form.

2.4 Derivatives of Exponential and Logarithmic Functions

Exponential and logarithmic functions play a central role in modeling growth and decay. Their derivative formulas are among the most elegant in all of calculus.

Theorem 2.5 — Derivative of the Natural Exponential $$\frac{d}{dx}[e^x] = e^x$$

The function $e^x$ is its own derivative. This remarkable property is, in fact, one way to define the number $e \approx 2.71828$: it is the unique base $a$ for which $\lim_{h \to 0} \frac{a^h - 1}{h} = 1$, which forces $\frac{d}{dx}[a^x]\big|_{x=0} = 1$.

Figure 2.5 — $e^x$ is its own derivative. The blue curve $y = e^x$ and the dashed red tangent line at any point share the same slope value as the $y$-coordinate at that point. Drag the slider to move the point and observe that the slope always equals the function value.

Theorem 2.6 — Derivative of the Natural Logarithm $$\frac{d}{dx}[\ln x] = \frac{1}{x}, \quad x > 0$$

This can be proved using implicit differentiation. If $y = \ln x$, then $e^y = x$. Differentiating both sides with respect to $x$ gives $e^y \frac{dy}{dx} = 1$, so $\frac{dy}{dx} = \frac{1}{e^y} = \frac{1}{x}$.

Theorem 2.7 — General Exponential and Logarithmic Derivatives For any constant $a > 0$, $a \neq 1$: $$\frac{d}{dx}[a^x] = a^x \ln a, \qquad \frac{d}{dx}[\log_a x] = \frac{1}{x \ln a}$$

The general exponential formula follows by writing $a^x = e^{x \ln a}$ and applying the chain rule (covered in Chapter 3). The logarithmic formula follows from the change-of-base identity $\log_a x = \frac{\ln x}{\ln a}$.

Example 2.8 — Differentiating Exponential Expressions

Find $\frac{dy}{dx}$ for $y = 3e^x + 7 \cdot 2^x - 4x^3$.

Solution. Applying the rules term by term:

$$\frac{dy}{dx} = 3e^x + 7 \cdot 2^x \ln 2 - 12x^2$$

Try It 2.8

Find $\dfrac{dy}{dx}$ for $y = 5e^x - 4 \cdot 3^x + 2x^2$. Hint: The general exponential rule gives $\dfrac{d}{dx}[3^x] = 3^x \ln 3$.

Example 2.9 — Differentiating Logarithmic Expressions

Find $f'(x)$ for $f(x) = 4\ln x - \log_3 x + x^2$.

Solution.

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

We can combine the first two terms over a common denominator if desired:

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

Try It 2.9

Find $f'(x)$ for $f(x) = 6\ln x + \log_5 x - 3x$. Hint: Apply Theorem 2.7 to the $\log_5$ term with $a = 5$.

★ AP Exam Tip: On the AP exam, $e^x$ and $\ln x$ appear far more often than general bases. Master these two cold. A common mistake is writing $\dfrac{d}{dx}[e^x] = xe^{x-1}$ (incorrectly applying the power rule). The number $e$ is the base, not the exponent, so the power rule does not apply here.

2.5 Product and Quotient Rules

When a function is formed as a product or quotient of two simpler functions, we need dedicated rules. A common misconception is that the derivative of a product is the product of the derivatives — this is false. The correct rules are given below.

Theorem 2.8 — Product Rule If $f$ and $g$ are both differentiable, then $$\frac{d}{dx}[f(x)g(x)] = f'(x)g(x) + f(x)g'(x)$$

Proof Sketch (Product Rule)

Start with the limit definition:

$$\frac{d}{dx}[f(x)g(x)] = \lim_{h \to 0}\frac{f(x+h)g(x+h) - f(x)g(x)}{h}$$

We use the algebraic trick of adding and subtracting $f(x+h)g(x)$ in the numerator:

$$= \lim_{h \to 0}\frac{f(x+h)g(x+h) - f(x+h)g(x) + f(x+h)g(x) - f(x)g(x)}{h}$$ $$= \lim_{h \to 0}\left[f(x+h)\cdot\frac{g(x+h)-g(x)}{h} + g(x)\cdot\frac{f(x+h)-f(x)}{h}\right]$$

Since $f$ is differentiable (hence continuous), $\lim_{h\to 0} f(x+h) = f(x)$. The two difference quotients tend to $g'(x)$ and $f'(x)$ respectively, giving the result. $\square$

Theorem 2.9 — Quotient Rule If $f$ and $g$ are both differentiable and $g(x) \neq 0$, then $$\frac{d}{dx}\!\left[\frac{f(x)}{g(x)}\right] = \frac{f'(x)g(x) - f(x)g'(x)}{[g(x)]^2}$$

Proof Sketch (Quotient Rule)

One elegant approach is to write $\frac{f}{g} = f \cdot g^{-1}$ and apply the product rule together with the chain rule (Chapter 3). Alternatively, starting from the limit definition:

$$\frac{d}{dx}\!\left[\frac{f(x)}{g(x)}\right] = \lim_{h \to 0}\frac{\frac{f(x+h)}{g(x+h)} - \frac{f(x)}{g(x)}}{h} = \lim_{h \to 0}\frac{f(x+h)g(x) - f(x)g(x+h)}{h \cdot g(x+h) \cdot g(x)}$$

Adding and subtracting $f(x)g(x)$ in the numerator and using similar limit arguments as in the product rule proof yields the formula. $\square$

A popular mnemonic for the quotient rule is "lo d-hi minus hi d-lo, over lo squared", where "hi" means the numerator $f$ and "lo" means the denominator $g$.

★ AP Exam Tip: The order of subtraction in the quotient rule matters: it is $f'g - fg'$, not $fg' - f'g$. The mnemonic "lo d-hi minus hi d-lo, over lo-lo" (where "lo-lo" means $g^2$) is a reliable way to remember the correct order. Write it out carefully on free-response problems.

Example 2.10 — Product Rule Application

Differentiate $y = x^2 \sin x$.

Solution. Let $f(x) = x^2$ and $g(x) = \sin x$. Then $f'(x) = 2x$ and $g'(x) = \cos x$.

$$y' = f'g + fg' = 2x \sin x + x^2 \cos x$$

Try It 2.10

Differentiate $y = x^3 \cos x$. Hint: Identify $f = x^3$ and $g = \cos x$, then apply the product rule $f'g + fg'$.

Example 2.11 — Quotient Rule Application

Differentiate $y = \dfrac{e^x}{x^2 + 1}$.

Solution. Let $f(x) = e^x$ and $g(x) = x^2 + 1$. Then $f'(x) = e^x$ and $g'(x) = 2x$.

$$y' = \frac{f'g - fg'}{g^2} = \frac{e^x(x^2+1) - e^x(2x)}{(x^2+1)^2} = \frac{e^x(x^2 - 2x + 1)}{(x^2+1)^2} = \frac{e^x(x-1)^2}{(x^2+1)^2}$$

Try It 2.11

Differentiate $y = \dfrac{\ln x}{x^2}$. Hint: Let $f = \ln x$ and $g = x^2$, so $f' = 1/x$ and $g' = 2x$. Apply the quotient rule and simplify.

Example 2.12 — Product Rule with Three Factors

Differentiate $y = x^2 e^x \cos x$.

Solution. For a product of three functions $u \cdot v \cdot w$, the product rule extends to:

$$\frac{d}{dx}[uvw] = u'vw + uv'w + uvw'$$

With $u = x^2$, $v = e^x$, $w = \cos x$:

$$y' = 2x \cdot e^x \cdot \cos x + x^2 \cdot e^x \cdot \cos x + x^2 \cdot e^x \cdot (-\sin x)$$ $$= x \, e^x \big(2\cos x + x\cos x - x\sin x\big)$$

Try It 2.12

Differentiate $y = x \cdot e^x \cdot \sin x$. Hint: Use the three-factor product rule $u'vw + uv'w + uvw'$ with $u = x$, $v = e^x$, $w = \sin x$.

2.6 Practice Problems

Test your understanding of the differentiation rules covered in this chapter. Each problem has a hidden solution — try to work through the problem yourself before revealing the answer.

Problem 1. Use the limit definition to find $f'(x)$ for $f(x) = 2x^2 + 3x$.
Show Solution

Compute $f(x+h) = 2(x+h)^2 + 3(x+h) = 2x^2 + 4xh + 2h^2 + 3x + 3h$.

$f(x+h) - f(x) = 4xh + 2h^2 + 3h = h(4x + 2h + 3)$.

$\dfrac{f(x+h) - f(x)}{h} = 4x + 2h + 3$.

$f'(x) = \displaystyle\lim_{h \to 0}(4x + 2h + 3) = 4x + 3$.

Problem 2. Differentiate $y = 6x^4 - \dfrac{2}{x^3} + 5\sqrt{x} - 7$.
Show Solution

Rewrite: $y = 6x^4 - 2x^{-3} + 5x^{1/2} - 7$.

Apply the power rule term by term:

$y' = 24x^3 - 2(-3)x^{-4} + 5 \cdot \frac{1}{2}x^{-1/2} - 0 = 24x^3 + \dfrac{6}{x^4} + \dfrac{5}{2\sqrt{x}}$.

Problem 3. Find the derivative of $g(t) = 3\sin t + t^2 \cos t$.
Show Solution

The first term is straightforward: $\frac{d}{dt}[3\sin t] = 3\cos t$.

For the second term, use the product rule with $u = t^2$ and $v = \cos t$:

$\frac{d}{dt}[t^2 \cos t] = 2t \cos t + t^2(-\sin t) = 2t\cos t - t^2 \sin t$.

Combining: $g'(t) = 3\cos t + 2t\cos t - t^2 \sin t$.

Problem 4. Differentiate $f(x) = \dfrac{x^2 - 1}{x^2 + 1}$.
Show Solution

Apply the quotient rule with numerator $u = x^2 - 1$ and denominator $v = x^2 + 1$:

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

Problem 5. Find $\frac{dy}{dx}$ for $y = 5e^x - 3 \cdot 4^x + \ln x$.
Show Solution

$\dfrac{dy}{dx} = 5e^x - 3 \cdot 4^x \ln 4 + \dfrac{1}{x}$.

Problem 6. Find the equation of the tangent line to $y = e^x \sin x$ at $x = 0$.
Show Solution

At $x = 0$: $y(0) = e^0 \sin 0 = 0$. The point is $(0, 0)$.

Use the product rule: $y' = e^x \sin x + e^x \cos x = e^x(\sin x + \cos x)$.

At $x = 0$: $y'(0) = e^0(\sin 0 + \cos 0) = 1(0 + 1) = 1$.

Tangent line: $y - 0 = 1(x - 0)$, so $y = x$.

Problem 7. Differentiate $h(x) = \dfrac{\sin x}{e^x}$.
Show Solution

Apply the quotient rule with $f = \sin x$, $g = e^x$:

$h'(x) = \dfrac{\cos x \cdot e^x - \sin x \cdot e^x}{(e^x)^2} = \dfrac{e^x(\cos x - \sin x)}{e^{2x}} = \dfrac{\cos x - \sin x}{e^x}$.

Problem 8. Let $f(x) = x^3 - 12x + 5$. Find all values of $x$ where the tangent line is horizontal.
Show Solution

A horizontal tangent occurs when $f'(x) = 0$.

$f'(x) = 3x^2 - 12 = 0 \implies x^2 = 4 \implies x = \pm 2$.

The tangent line is horizontal at $x = -2$ and $x = 2$.

Problem 9. Differentiate $y = x \ln x - x$.
Show Solution

For $x \ln x$, use the product rule: $\frac{d}{dx}[x \ln x] = 1 \cdot \ln x + x \cdot \frac{1}{x} = \ln x + 1$.

$y' = (\ln x + 1) - 1 = \ln x$.

Problem 10. Find $f'(x)$ for $f(x) = \sec x \cdot \tan x$ and evaluate $f'\!\left(\frac{\pi}{3}\right)$.
Show Solution

Product rule with $u = \sec x$, $v = \tan x$:

$f'(x) = \sec x \tan x \cdot \tan x + \sec x \cdot \sec^2 x = \sec x \tan^2 x + \sec^3 x$.

Factor: $f'(x) = \sec x(\tan^2 x + \sec^2 x)$.

At $x = \frac{\pi}{3}$: $\sec\frac{\pi}{3} = 2$, $\tan\frac{\pi}{3} = \sqrt{3}$.

$f'\!\left(\frac{\pi}{3}\right) = 2(3 + 4) = 14$.

Problem 11. Find $f''(x)$ for $f(x) = 5x^4 - 3x^3 + x^2 - 7x + 2$.
Show Solution

First derivative: $f'(x) = 20x^3 - 9x^2 + 2x - 7$.

Second derivative: $f''(x) = 60x^2 - 18x + 2$.

Problem 12. Find the fourth derivative $f^{(4)}(x)$ for $f(x) = x^5 - 3x^4 + 2x^3$.
Show Solution

$f'(x) = 5x^4 - 12x^3 + 6x^2$.

$f''(x) = 20x^3 - 36x^2 + 12x$.

$f'''(x) = 60x^2 - 72x + 12$.

$f^{(4)}(x) = 120x - 72$.

Problem 13. Consider the piecewise function $$f(x) = \begin{cases} x^2 & x \leq 1 \\ 2x - 1 & x > 1 \end{cases}$$ Is $f$ differentiable at $x = 1$? Justify your answer.
Show Solution

First check continuity: $\lim_{x \to 1^-} f(x) = 1^2 = 1$ and $\lim_{x \to 1^+} f(x) = 2(1) - 1 = 1$. Since both one-sided limits equal $f(1) = 1$, the function is continuous at $x = 1$.

Now check differentiability. The left-hand derivative: $\lim_{h \to 0^-} \frac{(1+h)^2 - 1}{h} = \lim_{h \to 0^-}(2 + h) = 2$.

The right-hand derivative: $\lim_{h \to 0^+} \frac{[2(1+h)-1] - 1}{h} = \lim_{h \to 0^+} \frac{2h}{h} = 2$.

Since both one-sided derivatives equal 2, $f'(1) = 2$ and $f$ is differentiable at $x = 1$.

Problem 14. Differentiate $f(x) = x^2 \sin x \cdot \ln x$ using the three-factor product rule.
Show Solution

With $u = x^2$, $v = \sin x$, $w = \ln x$: $u' = 2x$, $v' = \cos x$, $w' = \frac{1}{x}$.

$f'(x) = 2x \cdot \sin x \cdot \ln x + x^2 \cdot \cos x \cdot \ln x + x^2 \cdot \sin x \cdot \dfrac{1}{x}$

$= 2x \sin x \ln x + x^2 \cos x \ln x + x \sin x$.

Problem 15. Differentiate $y = \dfrac{\tan x}{x^2 + 1}$.
Show Solution

Quotient rule with $f = \tan x$, $g = x^2 + 1$; $f' = \sec^2 x$, $g' = 2x$:

$y' = \dfrac{\sec^2 x \cdot (x^2+1) - \tan x \cdot 2x}{(x^2+1)^2} = \dfrac{(x^2+1)\sec^2 x - 2x\tan x}{(x^2+1)^2}$.

Problem 16. Find all $x$-values where $y = x^2 e^x$ has a horizontal tangent line.
Show Solution

Product rule: $y' = 2x e^x + x^2 e^x = xe^x(2 + x)$.

Set $y' = 0$: $xe^x(2+x) = 0$. Since $e^x > 0$ always, we need $x = 0$ or $x = -2$.

Horizontal tangent lines occur at $x = 0$ and $x = -2$.

Problem 17. Find the equation of the normal line (perpendicular to the tangent) to $y = x^2 - 3x$ at $x = 2$.
Show Solution

At $x = 2$: $y(2) = 4 - 6 = -2$. Point: $(2, -2)$.

$y' = 2x - 3$, so $y'(2) = 1$. The tangent slope is $m_T = 1$.

The normal line is perpendicular, so its slope is $m_N = -\dfrac{1}{m_T} = -1$.

Normal line: $y - (-2) = -1(x - 2) \Rightarrow y = -x$.

Problem 18. The function $f(x) = |x|$ is continuous at $x = 0$ but not differentiable there. Verify both claims directly using limits.
Show Solution

Continuity: $\lim_{x \to 0^-}|x| = \lim_{x \to 0^-}(-x) = 0$ and $\lim_{x \to 0^+}|x| = 0$. Both one-sided limits equal $f(0) = 0$, so $f$ is continuous at $x=0$.

Non-differentiability: Left-hand difference quotient: $\lim_{h \to 0^-}\frac{|0+h|-0}{h} = \lim_{h \to 0^-}\frac{-h}{h} = -1$.

Right-hand difference quotient: $\lim_{h \to 0^+}\frac{|h|}{h} = \lim_{h \to 0^+}\frac{h}{h} = 1$.

Since the left and right limits are $-1$ and $1$ (unequal), $f'(0)$ does not exist.

Problem 19. A particle moves along a straight line with position $s(t) = t^3 - 6t^2 + 9t + 2$ (in meters, $t$ in seconds). Find (a) the velocity at $t = 2$, (b) the acceleration at $t = 2$, and (c) when the particle is at rest.
Show Solution

(a) $v(t) = s'(t) = 3t^2 - 12t + 9$. At $t=2$: $v(2) = 12 - 24 + 9 = -3$ m/s.

(b) $a(t) = v'(t) = 6t - 12$. At $t=2$: $a(2) = 12 - 12 = 0$ m/s².

(c) The particle is at rest when $v(t) = 0$: $3t^2 - 12t + 9 = 3(t^2-4t+3) = 3(t-1)(t-3) = 0$. The particle is at rest at $t = 1$ s and $t = 3$ s.

Problem 20. A company's cost function is $C(x) = 0.01x^3 - 0.6x^2 + 15x + 100$ (dollars, $x$ = units produced). Find the marginal cost $C'(x)$ and interpret $C'(20)$.
Show Solution

$C'(x) = 0.03x^2 - 1.2x + 15$.

$C'(20) = 0.03(400) - 1.2(20) + 15 = 12 - 24 + 15 = 3$.

Interpretation: When 20 units are being produced, the cost increases by approximately $\$3$ for each additional unit produced. This is the marginal cost at $x = 20$.

Problem 21. Find $f''(x)$ for $f(x) = \dfrac{x^2}{x - 1}$ (for $x \neq 1$).
Show Solution

First derivative (quotient rule, $u = x^2$, $v = x-1$):

$f'(x) = \dfrac{2x(x-1) - x^2(1)}{(x-1)^2} = \dfrac{2x^2 - 2x - x^2}{(x-1)^2} = \dfrac{x^2 - 2x}{(x-1)^2} = \dfrac{x(x-2)}{(x-1)^2}$.

Second derivative (quotient rule on $f'$, with $p = x^2-2x$ and $q = (x-1)^2$):

$p' = 2x - 2$, $q' = 2(x-1)$.

$f''(x) = \dfrac{(2x-2)(x-1)^2 - (x^2-2x) \cdot 2(x-1)}{(x-1)^4}$.

Factor out $(x-1)$ from the numerator:

$= \dfrac{(x-1)[(2x-2)(x-1) - 2(x^2-2x)]}{(x-1)^4} = \dfrac{(2x-2)(x-1) - 2x(x-2)}{(x-1)^3}$.

Expand: $(2x-2)(x-1) = 2x^2 - 4x + 2$ and $2x(x-2) = 2x^2 - 4x$.

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

Problem 22. Prove the product rule for three factors: if $u$, $v$, $w$ are all differentiable, then $(uvw)' = u'vw + uv'w + uvw'$. Hint: Write $uvw = (uv)w$ and apply the two-factor product rule twice.
Show Solution

Let $F = uv$, so $uvw = Fw$. By the two-factor product rule:

$(Fw)' = F'w + Fw'$.

Now $F' = (uv)' = u'v + uv'$ by the standard product rule.

Substituting: $(uvw)' = (u'v + uv')w + (uv)w' = u'vw + uv'w + uvw'$. $\square$

Problem 23. Show that $\dfrac{d}{dx}[\sec x] = \sec x \tan x$ by writing $\sec x = \dfrac{1}{\cos x}$ and applying the quotient rule.
Show Solution

Write $\sec x = \dfrac{1}{\cos x}$. Using the quotient rule with $f = 1$, $g = \cos x$:

$\dfrac{d}{dx}[\sec x] = \dfrac{0 \cdot \cos x - 1 \cdot (-\sin x)}{\cos^2 x} = \dfrac{\sin x}{\cos^2 x} = \dfrac{1}{\cos x} \cdot \dfrac{\sin x}{\cos x} = \sec x \tan x$. $\square$

Problem 24. Find all $x$ where $f''(x) = 0$ for $f(x) = x^4 - 6x^2$.
Show Solution

$f'(x) = 4x^3 - 12x$.

$f''(x) = 12x^2 - 12 = 12(x^2 - 1)$.

Set $f''(x) = 0$: $x^2 - 1 = 0 \Rightarrow x = \pm 1$.

These are potential inflection points (where concavity may change). For $|x| > 1$, $f'' > 0$ (concave up); for $|x| < 1$, $f'' < 0$ (concave down). So $x = \pm 1$ are indeed inflection points.

Problem 25 (AP-Style Multi-Part). Let $f(x) = \dfrac{x^2 e^x}{\cos x}$.

(a) Find $f'(x)$. You do not need to simplify fully.
(b) Find the $x$-coordinates of all critical points of $f$ in $(-\pi/2, \pi/2)$ where $f'(x) = 0$. Justify that both $x = 0$ and $x = -2$ produce $f'(x) = 0$.
(c) Find $f''(0)$.
Show Solution

(a) Write $f = \dfrac{(x^2 e^x)}{\cos x}$. Let the numerator $N = x^2 e^x$ and denominator $D = \cos x$.

$N' = 2xe^x + x^2 e^x = xe^x(2+x)$ (product rule).

$D' = -\sin x$.

$f'(x) = \dfrac{xe^x(2+x)\cos x - x^2 e^x(-\sin x)}{\cos^2 x} = \dfrac{xe^x[(2+x)\cos x + x\sin x]}{\cos^2 x}$.

(b) $f'(x) = 0$ when $xe^x[(2+x)\cos x + x\sin x] = 0$. Since $e^x > 0$, we need $x = 0$ or $(2+x)\cos x + x\sin x = 0$. At $x = 0$: $(2)(1) + 0 = 2 \neq 0$, so $x = 0$ is a zero of the $x$ factor. For the second factor, testing $x = -2$: $(0)\cos(-2) + (-2)\sin(-2) = 2\sin 2 \neq 0$ in general. In $(-\pi/2, \pi/2)$, the only critical point with $f'(x) = 0$ is $x = 0$.

(c) At $x = 0$: $f(0) = \dfrac{0 \cdot 1}{1} = 0$. Use the quotient rule result from (a).

$f'(x) = \dfrac{xe^x[(2+x)\cos x + x\sin x]}{\cos^2 x}$. At $x = 0$: $f'(0) = 0$.

To find $f''(0)$, apply L'Hopital or directly differentiate $f'$. Using the product/quotient structure at $x = 0$:

Let $g(x) = xe^x[(2+x)\cos x + x\sin x]$ and $h(x) = \cos^2 x$. Then $g(0) = 0$, $h(0) = 1$, and $g'(0) = [(e^x + xe^x)((2+x)\cos x + x\sin x) + xe^x(-\cos x + (2+x)(-\sin x) + \sin x + x\cos x)]_{x=0}$. At $x=0$: $g'(0) = (1)(2) + 0 = 2$. And $h'(0) = -2\cos 0 \sin 0 = 0$.

By the quotient rule: $f''(0) = \dfrac{g'(0)h(0) - g(0)h'(0)}{h(0)^2} = \dfrac{2 \cdot 1 - 0 \cdot 0}{1} = 2$.

← Chapter 1: Limits and Continuity Chapter 3: The Chain Rule →