Differentiation Rules

Complicated functions are simple ones stacked together, and each rule undoes one kind of stacking.

Here's a tempting shortcut for the slope of a product: find each factor's slope and multiply. Try it on x⋅xx \cdot x. Each factor has slope 1, so the shortcut says x2x^2 has slope 1 everywhere. You already know it's 2x2x.

Slopes don't multiply just because functions do. Multiplying, dividing, and nesting each change a slope in their own way, and one rule covers each. Those rules bring exponentials, logs, and trig within reach, and then slopes settle a stranger question: what a fraction is worth when it reads 0/0.

Multiplying: the product rule

Think of uvuv as the area of a rectangle with width uu and height vv, both changing with xx. Nudge xx. The width grows by a sliver dudu, the height by a sliver dvdv, and the rectangle gains area in three places.

uv u dv v du du dv u du dv v
A rectangle stretched both ways

The corner, du dvdu\,dv, is a sliver of a sliver, and it vanishes as the nudge shrinks, as it did for the growing square in Derivatives and Slope. Divide the two strips by dxdx and you have the product rule, as the Handbook's Derivatives list prints it:

d(uv)dx=udvdx+vdudx\frac{d(uv)}{dx} = u\frac{dv}{dx} + v\frac{du}{dx}

Each factor takes a turn changing while the other holds still. On x⋅xx \cdot x, that gives x(1)+x(1)=2xx(1) + x(1) = 2x, which is right this time.

Dividing: the quotient rule

A fraction rises when its top rises and falls when its bottom rises. That's why the Handbook's quotient rule has a minus sign, and why the order of its numerator matters:

d(u/v)dx=v dudx−u dvdxv2\frac{d(u/v)}{dx} = \frac{v\,\dfrac{du}{dx} - u\,\dfrac{dv}{dx}}{v^2}

The term with du/dxdu/dx, the top's change, is the positive one. Write the numerator in the other order and every answer comes out with the wrong sign. If you doubt the order, test it on a fraction you know: with u=1u = 1 and v=xv = x, the rule gives (x⋅0−1⋅1)/x2=−1/x2(x \cdot 0 - 1 \cdot 1)/x^2 = -1/x^2, which is what the power rule says for x−1x^{-1}.

Nesting: the chain rule

Now one function sits inside another: y=(x2+1)5y = (x^2 + 1)^5. Expanding that would be misery. Instead, name the inside, u=x2+1u = x^2 + 1, so that y=u5y = u^5. A nudge now travels down a line, like motion through a train of gears: moving xx moves uu, moving uu moves yy, and each link multiplies the nudge by its own rate.

x x = 1 nudge x by 0.001 u = x2 + 1 u = 2 u moves about 0.002 y = u5 y = 32 y moves about 0.16 du/dx = 2x = 2 × 2 dy/du = 5u4 = 80 × 80 dy/dx = (80)(2) = 160
A nudge passing through y = (x² + 1)⁵ at x = 1

The rates multiply, and that's the chain rule:

dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}

The Handbook's list prints this in function notation, without calling it the chain rule. In words: the derivative of the outside, times the derivative of the inside. The outside's derivative leaves the inside whole:

ddx(x2+1)5=5(x2+1)4⋅2x\frac{d}{dx}(x^2 + 1)^5 = 5(x^2 + 1)^4 \cdot 2x

Most mistakes with these rules happen here, and nearly all of them are the same mistake: doing the outside and stopping. At x=1x = 1, that gives 5(2)4=805(2)^4 = 80 when the slope is 160. The Handbook's power rule, d(un)/dx=nun−1 du/dxd(u^n)/dx = nu^{n-1}\,du/dx, has the chain rule built in, and its du/dxdu/dx is simply 1 when uu is just xx.

Worked Example The slope of a rational function
1 of 4

Find the slope of y=(3x+1)/(x−2)y = (3x + 1)/(x - 2) at x=3x = 3.

Exponentials, logs, and trig

The Handbook's Derivatives list has the rest of the pieces you need. It writes each one in terms of uu, with the chain rule's du/dxdu/dx already attached. For plain xx that factor is 1, and for e3xe^{3x} it's 3.

Derivatives of the simple pieces
Function of uDerivative with respect to x
eue^ueu du/dxe^u\,du/dx
ln⁡u\ln u(1/u) du/dx(1/u)\,du/dx
sin⁡u\sin ucos⁡u du/dx\cos u\,du/dx
cos⁡u\cos u−sin⁡u du/dx-\sin u\,du/dx
tan⁡u\tan usec⁡2u du/dx\sec^2 u\,du/dx

Adapted from the FE Reference Handbook, Derivatives

exe^x is its own slope. That's what a continuous rate has meant all along: y=y0ekty = y_0 e^{kt} grows at dy/dt=kydy/dt = ky, or kk times whatever is there right now.

ln⁡x\ln x has slope 1/x1/x. It climbs ever more lazily: slope 1 at x=1x = 1, and only 0.1 at x=10x = 10.

sin⁡x\sin x has slope cos⁡x\cos x. Walk along a sine wave reading slopes: climbing at slope 1 at the start, flat at the crest, and falling at slope −1 as it crosses the axis at x=πx = \pi. Those readings trace out the cosine wave. The cosine itself starts flat and then falls, so its slope is −sin⁡x-\sin x.

x y 0 π/2 π 3π/2 2π 1 −1 x y 0 π/2 π 3π/2 2π 1 −1 slope 1 flat slope −1 flat y = sin x y = cos x
The slopes of the sine wave trace out the cosine wave

All of this has one condition, stated at the top of the Handbook's list: "All arguments of the trigonometric functions are in radians." A small angle in radians is nearly its own sine, sin⁡0.1=0.0998\sin 0.1 = 0.0998, and that's what makes the sine's slope at zero exactly 1. In degrees, every trig derivative would carry a stray factor of π/180\pi/180. So x=1x = 1 means 1 radian. Keep the calculator in radians for calculus, and switch back for geometry.

The table's sec⁡2u\sec^2 u is 1/cos⁡2u1/\cos^2 u, and your calculator probably has no sec key, so enter it that way.

Worked Example A product with a chain inside it
1 of 4

Find the slope of y=e2xsin⁡xy = e^{2x}\sin x at x=1x = 1.

When y won't stand alone

Sometimes xx and yy come tangled together, as in x2+xy+y2=7x^2 + xy + y^2 = 7. There's no single function to solve for, because this curve is a closed loop: at x=1x = 1 it has two heights, y=2y = 2 and y=−3y = -3.

x y −3 −1 1 3 3 1 −1 −3 (1, 2) (1, −3) tangent at (1, 2) x2 + xy + y2 = 7
A curve no single y(x) can describe

A loop still has a tangent line at each point, so you need a way to differentiate without solving for yy. Here it is: near any one point, a short piece of the loop is a function of xx, whether or not you have its formula. That makes y2y^2 a nested function with yy on the inside:

ddx(y2)=2y dydx\frac{d}{dx}(y^2) = 2y\,\frac{dy}{dx}

Differentiate each yy term as though yy were xx, then attach dy/dxdy/dx for the inside. When xx and yy multiply, that term is a product, so the product rule joins in. The Handbook has no entry for this, and it doesn't need one: it's the chain rule again.

Worked Example The slope on the tilted loop
1 of 3

Find dy/dxdy/dx at (1,2)(1, 2) on the curve x2+xy+y2=7x^2 + xy + y^2 = 7.

Fractions that read 0/0

What does (x2−4)/(x−2)(x^2 - 4)/(x - 2) do as xx closes in on 2? Put in x=2x = 2 and you get 0/0. That isn't a number, and it isn't an error either. It's an open question: the top and bottom are both racing to zero, and the fraction's fate depends on how fast each one is going. A limit asks what value the fraction closes in on.

For a polynomial fraction, factoring settles it. The top is (x−2)(x+2)(x - 2)(x + 2), so the x−2x - 2 cancels, and everywhere except at 2 itself the fraction is plain x+2x + 2:

lim⁡x→2x2−4x−2=lim⁡x→2 (x+2)=4\lim_{x \to 2} \frac{x^2 - 4}{x - 2} = \lim_{x \to 2}\,(x + 2) = 4

But sin⁡x/x\sin x / x as x→0x \to 0 has nothing to factor, so use slopes. Suppose ff and gg both reach zero at x=αx = \alpha. Zoom in until both look straight. A short step hh away, each one's height is its slope times hh:

fg≈f′(α) hg′(α) h=f′(α)g′(α)\frac{f}{g} \approx \frac{f'(\alpha)\,h}{g'(\alpha)\,h} = \frac{f'(\alpha)}{g'(\alpha)}

The hh cancels, so as it shrinks, the ratio of heights settles on the ratio of slopes. For (e2x−1)/sin⁡x(e^{2x} - 1)/\sin x at x=0x = 0, the top has slope 2 and the bottom has slope 1, and sure enough, the fraction is 2.22 at x=0.1x = 0.1 and 2.02 at x=0.01x = 0.01.

Full view x y −0.5 0 0.5 −1 0 1 2 f(x) = e2x − 1 g(x) = sin x Zoomed in near x = 0 x y −0.05 0 0.05 −0.1 0 0.1 0.2 h ≈ 2h ≈ 1h slope 2 slope 1 f g
Up close, both curves are straight lines through zero

That's L'Hôpital's rule, which the Handbook prints with the older spelling, L'Hospital's Rule. For a fraction in the form 0/0:

lim⁡x→αf(x)g(x)=lim⁡x→αf′(x)g′(x)\lim_{x \to \alpha} \frac{f(x)}{g(x)} = \lim_{x \to \alpha} \frac{f'(x)}{g'(x)}

Differentiate the top by itself and the bottom by itself. This isn't the quotient rule: you aren't after the slope of the fraction, you're comparing two slopes. So sin⁡x/x\sin x / x becomes cos⁡x/1\cos x / 1, which goes to 1 (in radians only), and (ex−1)/x(e^x - 1)/x becomes ex/1e^x / 1, also 1.

If the new fraction still reads 0/0, both slopes are zero there, so go on to the next derivatives. The Handbook builds this in: the limit equals the first ratio of derivatives that isn't indeterminate.

Worked Example A limit that takes two passes
1 of 4

Evaluate lim⁡x→01−cos⁡xx2\displaystyle\lim_{x \to 0} \frac{1 - \cos x}{x^2}.

The same race out to infinity

Now let xx grow without bound in ln⁡x/x\ln x / x. The top and bottom both grow forever, and ∞/∞ is the same kind of open question: what matters is how fast each one is growing. The Handbook's rule covers this form too, and its limit point may be infinite:

lim⁡x→∞ln⁡xx=lim⁡x→∞1/x1=0\lim_{x \to \infty} \frac{\ln x}{x} = \lim_{x \to \infty} \frac{1/x}{1} = 0

The bottom climbs steadily at 1 per unit while the top's climb fades away, so the log loses. In the same way, x/exx / e^x becomes 1/ex1 / e^x, which goes to 0.

Checkpoint
1 of 2

Evaluate lim⁡x→∞x2ex\displaystyle\lim_{x \to \infty} \frac{x^2}{e^x}.

A.
1
B.
2
C.
0
D.
It grows without bound

Rational functions at infinity

A ratio of polynomials doesn't need L'Hôpital at infinity, and a few numbers show why.

(3x² − 5x + 7)/(2x² + 9) as x grows
xTopBottomTop ÷ bottom
102572091.230
10029,50720,0091.475
1,0002,995,0072,000,0091.497

Out there, the x2x^2 terms do nearly all the work and the rest barely register. So keep the highest-power term on top and on the bottom, and cancel: 3x2/2x2=3/23x^2/2x^2 = 3/2. The Handbook doesn't print this shortcut, so know its three outcomes:

  • Same highest power on top and bottom: the limit is the ratio of their coefficients.
  • Higher power on the bottom: the limit is 0.
  • Higher power on top: the fraction grows without bound.

Check the form first

The Handbook's rule is only for 0/0 and ∞/∞. Use it on anything else and it hands you a wrong answer with a straight face. As x→2x \to 2, the fraction (x2+1)/(x+3)(x^2 + 1)/(x + 3) is 5/5=15/5 = 1, and that's the answer. Differentiating top and bottom would give 2x/1=42x/1 = 4. So substitute first, and look at what you get.

What the form at the limit tells you
FormWhat it meansL'Hôpital's rule?
0/0An open raceYes, or factor
∞/∞An open raceYes
A number over a nonzero numberThat's the limitNo
A number over ∞The limit is 0No
A nonzero number over 0No finite limitNo
∞ over a numberNo finite limitNo
Checkpoint
1 of 3

Evaluate lim⁡x→∞6x3−x+22x3+5x2\displaystyle\lim_{x \to \infty} \frac{6x^3 - x + 2}{2x^3 + 5x^2}.

Recap

  • Product rule: each factor takes a turn. Quotient rule: the numerator starts with the bottom, (v du/dx−u dv/dx)/v2(v\,du/dx - u\,dv/dx)/v^2.
  • Chain rule: the derivative of the outside, times the derivative of the inside. Don't stop at the outside.
  • exe^x is its own slope, ln⁡x\ln x has slope 1/x1/x, and the trig derivatives hold only in radians.
  • On a tangled curve, differentiate each yy term as though yy were xx and attach dy/dxdy/dx, with the product rule on xyxy.
  • 0/0 and ∞/∞ are open races: factor, or differentiate the top and bottom separately, as many times as it takes. Any other form just gets substituted, and a rational function at infinity comes down to its highest powers.