Blog

Second-Order Differentiation: Avoid the Chain-Rule Trap

Learn second-order derivatives with worked chain-rule, implicit and parametric examples, common mistakes, practice questions and clear answers.

  • 12th
  • Study Advice
Two linked brass tracing arms follow a teal ribbon and trace a golden curve above it

You differentiate a function, get the first derivative right, and then lose a factor in the very next line. If that sounds familiar, second-order differentiation probably feels more unpredictable than it really is.

The difficulty is usually not a new formula. It is a change in the shape of the expression. A composite function may become a product after one differentiation. On the second round, that product needs attention too.

To find a second-order derivative, differentiate the whole first derivative with respect to the same variable. Recheck its structure before choosing a rule.

We will build that habit with worked examples, including the two places where it matters most: implicit functions and parametric equations.

What does a second-order derivative mean?

If y = f(x), the first derivative is written as y’, f’(x), or dy/dx. It measures how y changes with x.

The second derivative is the derivative of that first derivative:

y” = f”(x) = d²y/dx² = d/dx(dy/dx)

It measures how the slope changes with x. The superscript 2 tells you that differentiation has been performed twice. It does not mean that you square the first derivative.

For y = x³:

  • y’ = 3x²
  • y” = 6x
  • (y’)² = 9x⁴, which is a different expression.

Imagine a road rising uphill. The road can keep rising while becoming less steep. Its slope is positive, but its slope is decreasing. In the same way, y’ can be positive while y” is negative.

The two-term formula behind the chain-rule trap

Suppose y = f(u), where u = g(x), and both functions have the required derivatives. The first derivative is:

y’ = f’(u)u’

This is a product of two factors. Differentiating it gives:

y” = f”(u)(u’)² + f’(u)u”

Here, f’ and f” mean derivatives of the outer function with respect to its input u. Meanwhile, u’ and u” are derivatives with respect to x.

You can rebuild the formula instead of memorising it:

  1. Differentiate f’(u). The chain rule gives f”(u)u’. Multiply by the original u’ to obtain f”(u)(u’)².
  2. Keep f’(u) unchanged and differentiate u’. This contributes f’(u)u”.
  3. Add the two contributions because you are differentiating a product.

OpenStax’s chain-rule chapter explains how composition combines with product and quotient rules. The calculations below apply that reasoning twice.

Why linear inner functions can hide the mistake

For y = (4x + 1)⁵, the inner function is u = 4x + 1. Then u’ = 4 and u” = 0.

So:

  • y’ = 20(4x + 1)⁴
  • y” = 320(4x + 1)³

The second term of the composite formula is zero. This makes the calculation look as though you only need to apply the chain rule again.

But when u = x² + 1, we have u” = 2. Ignoring that second term now changes the answer. A shortcut that happens to work for a linear inner function is not a general rule.

Example 1: A power with a changing inner derivative

Find y” when y = (x² + 2)⁴.

First differentiate the outer power, then multiply by the derivative of x² + 2:

y’ = 4(x² + 2)³ × 2x = 8x(x² + 2)³

Pause here. The first derivative is a product: 8x multiplied by (x² + 2)³.

Apply the product rule:

y” = 8(x² + 2)³ + 8x × 3(x² + 2)² × 2x

Therefore:

y” = 8(x² + 2)³ + 48x²(x² + 2)²

Factor out 8(x² + 2)²:

y” = 8(x² + 2)²(7x² + 2)

The first term came from differentiating 8x. The second came from differentiating the bracketed factor. Both are necessary.

A useful check is x = 0. Our answer gives y”(0) = 64. If you had retained only the term containing x², you would have obtained zero. Expanding the original expression gives an x² term of 32x², whose second derivative at zero is indeed 64.

Example 2: Sine with a quadratic angle

Find y” for y = sin(3x²).

The first derivative is:

y’ = 6x cos(3x²)

Now differentiate both factors:

y” = 6 cos(3x²) + 6x[-sin(3x²) × 6x]

Hence:

y” = 6 cos(3x²) - 36x² sin(3x²)

There are two separate traps here. Forgetting to differentiate 6x loses the cosine term. Forgetting the inner derivative when differentiating cos(3x²) loses a factor of 6x in the sine term.

The negative sign is also meaningful: the derivative of cosine is negative sine. Do not carry over the positive sign from the first differentiation just because the original function was sine.

For comparison, y = sin(3x) gives y” = -9 sin(3x). The inner derivative is constant in that simpler case, so there is no additional cosine term.

Example 3: Exponential and logarithmic functions

An exponential example

Let y = e^(x² - x).

First:

y’ = (2x - 1)e^(x² - x)

Then:

y” = 2e^(x² - x) + (2x - 1)²e^(x² - x)

So:

y” = [(2x - 1)² + 2]e^(x² - x)

Notice that this second derivative is positive for every real x: the squared quantity plus 2 is positive, and the exponential is positive. That is a helpful sign check after the algebra.

A logarithmic example

Let y = ln(x² + 4). The function is defined for every real x because x² + 4 is always positive.

First:

y’ = 2x/(x² + 4)

Use the quotient rule on this new expression:

y” = [2(x² + 4) - 2x(2x)]/(x² + 4)²

Therefore:

y” = (8 - 2x²)/(x² + 4)²

You could also write y’ = 2x(x² + 4)^(-1) and use the product rule. Both methods give the same answer. Choose the form you can differentiate most reliably.

A compact reference for composite functions

In this table, u is a twice-differentiable function of x. Use each formula only where the original function and the derivatives are defined.

Original functionFirst derivativeSecond derivative
y = uⁿn u^(n-1)u’n(n-1)u^(n-2)(u’)² + n u^(n-1)u”
y = sin ucos u × u’-sin u × (u’)² + cos u × u”
y = cos u-sin u × u’-cos u × (u’)² - sin u × u”
y = e^ue^u × u’e^u[(u’)² + u”]
y = ln u, u > 0u’/u[u u” - (u’)²]/u²

For a general real power n, u > 0 is a safe working domain for the power formula. Integer powers can allow a wider domain. If a displayed form introduces a negative power at u = 0, simplify appropriately or differentiate the original expression directly before deciding whether the derivative exists there.

Use the table to check your working, not to skip identifying u. Writing u, u’ and u” in a small margin column is often enough to prevent the missing-term error.

Example 4: Implicit differentiation needs the product rule too

Suppose x² + 2y² = 18. Find y” where y is a differentiable function of x and y ≠ 0.

Differentiate once:

2x + 4y y’ = 0

Thus:

y’ = -x/(2y)

For the second round, it is convenient to return to the unsolved equation 2x + 4y y’ = 0. Differentiate it again:

2 + 4[(y’)² + y y”] = 0

Why does (y’)² appear? Because differentiating the first factor y in y y’ gives y’, and the untouched second factor is another y’. Differentiating the second factor instead gives y y”.

Rearrange:

y” = -[1 + 2(y’)²]/(2y)

Substitute y’ = -x/(2y):

y” = -(2y² + x²)/(4y³)

The original equation tells us x² + 2y² = 18. Therefore:

y” = -9/(2y³)

At the point (4, 1), the first derivative is -2 and the second derivative is -9/2. You can check the second result directly in 2 + 4[(y’)² + y y”] = 0:

2 + 4[4 - 9/2] = 0

The exclusion y ≠ 0 matters. At the two points where y = 0, the formula divides by zero, and the ellipse has vertical tangents rather than finite dy/dx values.

The principle that y changes with x is explained in OpenStax’s implicit differentiation chapter.

Example 5: Parametric equations require division twice

When x and y are both functions of a parameter t:

dy/dx = (dy/dt)/(dx/dt)

But differentiating this slope with respect to t is not yet the second derivative with respect to x. You must divide by dx/dt again:

d²y/dx² = [d/dt(dy/dx)]/(dx/dt)

This formula applies where the required derivatives exist and dx/dt ≠ 0. See OpenStax’s treatment of parametric derivatives for the underlying chain-rule reasoning.

Take x = t² + 1 and y = t³ - 3t, with t ≠ 0.

First compute:

  • dx/dt = 2t
  • dy/dt = 3t² - 3

Then:

dy/dx = (3t² - 3)/(2t) = (3/2)(t - 1/t)

Differentiate that slope with respect to t:

d/dt(dy/dx) = (3/2)(1 + 1/t²)

Finally, divide by 2t:

d²y/dx² = 3(t² + 1)/(4t³)

At t = 1, the point is (2, -2). The first derivative is zero, but the second derivative is 3/2. A horizontal tangent does not mean that the slope stops changing.

At t = 0, dx/dt is zero and dy/dt is -3. Our division formula cannot give a finite slope there. More generally, if both parameter derivatives vanish, investigate the curve or a limit separately; do not assume that every zero denominator represents the same geometric situation.

Example 6: Simplifying before differentiating can save work

Find the second derivative of y = (x² + 1)/x, for x ≠ 0.

Using the quotient rule twice is possible, but division gives a friendlier expression:

y = x + 1/x

Therefore:

y’ = 1 - 1/x²

y” = 2/x³

The domain remains x ≠ 0. Algebraic simplification does not give permission to include an input that the original function excludes.

This is a useful contrast with Example 1. Expanding a high power creates unnecessary work, while splitting a simple rational expression removes it. Simplify when it reduces the number of moving parts.

What the second derivative can tell a commerce student

Consider an illustrative total-cost function:

C(q) = 800 + 30q + 0.2q², for q ≥ 0.

Here q represents output and cost is measured in rupees. Treat output as continuous for this model.

Then:

C’(q) = 30 + 0.4q

C”(q) = 0.4

C’ is marginal cost in rupees per unit. C” tells us that marginal cost rises at a rate of 0.4 rupees per unit of output for each additional unit of q. At q = 10, the marginal cost is Rs 34 per unit.

The second derivative is not the cost of the second item. Nor is marginal cost automatically the exact cost of one additional whole item. In this example, C(11) - C(10) = Rs 34.20, whereas C’(10) = 34. Differentiation describes an instantaneous rate; a finite increase compares two actual output levels.

A mistake checklist before you submit

Warning signWhat to check
Your second derivative has only one termDid the first derivative contain two variable factors?
A trigonometric answer has an unexpected signRecheck the derivative of cosine and any existing minus sign.
You wrote y y” but no (y’)²Apply the product rule to y y’.
Your parametric answer is d/dt of the slopeDivide by dx/dt once more.
You substituted a point before differentiatingKeep the variable expression until the required derivative is found.
Your answer is (dy/dx)²Second differentiation and squaring are different operations.

The substitution warning is especially easy to miss. If y’ = 8x(x² + 2)³ and you need y”(0), differentiating the number y’(0) = 0 cannot answer the question. First find the function y”, then evaluate it at zero.

If you need a refresher on the first round, work through our guide to chain, implicit, parametric and logarithmic differentiation before attempting the mixed practice below.

Try these eight questions

Find y” unless another instruction is given. Keep all expressions within their real domains.

  1. y = (2x - 3)⁴.
  2. y = (x² + 1)³.
  3. y = cos(2x²).
  4. y = e^(3x²).
  5. y = ln(2x + 5).
  6. x² + 3y² = 12, where y ≠ 0.
  7. x = 3t + 2 and y = t⁴. Find d²y/dx².
  8. For y = (x² + 2)⁴, find y”(1).

Answers with a check on the tricky step

  1. 48(2x - 3)². The inner factor 2 appears in both rounds.
  2. 6(x² + 1)(5x² + 1). Differentiate y’ = 6x(x² + 1)² as a product.
  3. -4 sin(2x²) - 16x² cos(2x²). Start from y’ = -4x sin(2x²).
  4. (6 + 36x²)e^(3x²). Both factors of y’ = 6x e^(3x²) change.
  5. -4/(2x + 5)², for x > -5/2. Differentiate 2(2x + 5)^(-1), including the inner factor 2.
  6. -4/(3y³). From 2x + 6y y’ = 0, obtain 2 + 6[(y’)² + y y”] = 0, then substitute and use the original equation.
  7. 4t²/3. The slope is 4t³/3. Its t-derivative is 4t², which must still be divided by dx/dt = 3.
  8. 648. Substitute x = 1 into 8(x² + 2)²(7x² + 2), after differentiating twice.

Frequently asked questions

1. What is the difference between the first and second derivative?

The first derivative measures the rate of change of the original function. The second measures the rate of change of that first derivative. For a graph, these correspond to slope and the way slope changes.

2. Is d²y/dx² the same as (dy/dx)²?

No. The first means differentiate twice; the second means square the first derivative. For y = x², they give 2 and 4x² respectively.

3. Why does the inner derivative get squared?

In y’ = f’(u)u’, differentiating f’(u) produces another u’ through the chain rule. Multiplying by the original u’ gives (u’)². The product rule also contributes the separate term f’(u)u”.

4. When can I omit the term involving u”?

When that term is actually zero. A common case is u = ax + b, because u” = 0. Do not assume it vanishes when the inner function is quadratic, trigonometric or otherwise nonlinear.

5. Why does implicit second differentiation produce (y’)²?

Because the first derivative often contains y y’. Differentiating the first factor produces y’, which multiplies the existing y’. Differentiating the second factor contributes y y”.

6. Can I divide d²y/dt² by d²x/dt² for a parametric curve?

No. First calculate dy/dx, differentiate that entire expression with respect to t, and divide by dx/dt. The ratio of the two second parameter derivatives is not the general formula.

7. Does y” greater than zero mean the function is increasing?

It means the slope is increasing on an interval where y” is positive. The function itself may still be decreasing there. For y = x² on x < 0, y’ = 2x is negative while y” = 2 is positive.

8. Does y” = 0 guarantee a point of inflection?

No. You need a change in concavity across the point. For y = x⁴, y”(0) = 0, but y” = 12x² is positive on both sides, so zero is not an inflection point.

9. Can a first derivative exist when a second derivative does not?

Yes. For y = x|x|, the first derivative is 2|x|, including a value of zero at x = 0. That first derivative has unequal one-sided derivatives at zero, so y”(0) does not exist.

10. What is the quickest reliable way to avoid mistakes?

Write the complete first derivative, identify its structure again, and then differentiate. Keep inner factors visible, apply the product rule wherever both factors change, and substitute numerical values only after finding the required derivative.

Looking for commerce tuitions?

Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.

Start classes