← Back to modules

Derivatives

Compute derivatives and interpret rates of change.

The derivative of a function measures its instantaneous rate of change at any point. Geometrically, f(a)f'(a) is the slope of the tangent line to y=f(x)y = f(x) at x=ax = a.

Derivatives power every optimization problem, every physics equation involving rates, and every approximation method in applied math. If you understand derivatives deeply, the rest of calculus becomes much easier.

The formal definition is f(a)=limh0f(a+h)f(a)hf'(a) = \lim_{h\to 0} \frac{f(a+h)-f(a)}{h}. This limit captures the idea of zooming in on a curve until it looks like a straight line, then measuring that line's slope.

The definition and what it means

The derivative f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h} is the limit of the difference quotient. The difference quotient f(x+h)f(x)h\frac{f(x+h)-f(x)}{h} is the slope of a secant line through two nearby points.

As h0h\to 0, the secant line becomes the tangent line, and its slope becomes the derivative.

If this limit exists at x=ax=a, we say ff is differentiable at aa. If ff is differentiable at aa, then ff is also continuous at aa. The converse is false: x|x| is continuous at 00 but not differentiable (it has a sharp corner).

Places where differentiability fails: sharp corners (like x|x|), vertical tangent lines (like x3\sqrt[3]{x} at 00), and discontinuities.


Core differentiation rules

Power rule: ddxxn=nxn1\frac{d}{dx} x^n = nx^{n-1} for any real number nn. This works for negative and fractional exponents too: ddxx2=2x3\frac{d}{dx} x^{-2} = -2x^{-3} and ddxx=12x\frac{d}{dx} \sqrt{x} = \frac{1}{2\sqrt{x}}.

Constant multiple rule: ddx[cf(x)]=cf(x)\frac{d}{dx}[cf(x)] = c f'(x). Constants pass through the derivative.

Sum/difference rule: ddx[f(x)±g(x)]=f(x)±g(x)\frac{d}{dx}[f(x) \pm g(x)] = f'(x) \pm g'(x). Differentiate term by term.

Constant rule: ddx[c]=0\frac{d}{dx}[c] = 0. The derivative of any constant is zero.

1

Using the power rule on a polynomial

  1. Find ddx(3x45x2+7x2)\frac{d}{dx}(3x^4 - 5x^2 + 7x - 2).
  2. Apply the rules term by term: sum rule lets us differentiate each term separately, constant multiple rule pulls out the coefficients.
  3. First term: ddx(3x4)=34x3=12x3\frac{d}{dx}(3x^4) = 3 \cdot 4x^3 = 12x^3 (power rule: bring down the 44, reduce exponent by 11).
  4. Second term: ddx(5x2)=52x=10x\frac{d}{dx}(-5x^2) = -5 \cdot 2x = -10x.
  5. Third term: ddx(7x)=71=7\frac{d}{dx}(7x) = 7 \cdot 1 = 7 (since x=x1x = x^1, power rule gives 1x0=11 \cdot x^0 = 1).
  6. Fourth term: ddx(2)=0\frac{d}{dx}(-2) = 0 (constant rule).
  7. Combine: ddx(3x45x2+7x2)=12x310x+7\frac{d}{dx}(3x^4 - 5x^2 + 7x - 2) = 12x^3 - 10x + 7.

Derivatives of common functions

Exponentials: ddxex=ex\frac{d}{dx} e^x = e^x (the only function equal to its own derivative). More generally, ddxax=axlna\frac{d}{dx} a^x = a^x \ln a.

Logarithms: ddxlnx=1x\frac{d}{dx} \ln x = \frac{1}{x}. More generally, ddxlogax=1xlna\frac{d}{dx} \log_a x = \frac{1}{x \ln a}.

Trigonometric: ddxsinx=cosx\frac{d}{dx} \sin x = \cos x, ddxcosx=sinx\frac{d}{dx} \cos x = -\sin x, ddxtanx=sec2x\frac{d}{dx} \tan x = \sec^2 x.

More trig: ddxsecx=secxtanx\frac{d}{dx} \sec x = \sec x \tan x, ddxcscx=cscxcotx\frac{d}{dx} \csc x = -\csc x \cot x, ddxcotx=csc2x\frac{d}{dx} \cot x = -\csc^2 x.

Memorize these. They are the building blocks for every derivative you will ever compute.


Product rule

When two functions are multiplied: (fg)=fg+fg(fg)' = f'g + fg'.

Think of it as: "derivative of the first times the second, plus the first times the derivative of the second."

Example: ddx[x2sinx]=2xsinx+x2cosx\frac{d}{dx}[x^2 \sin x] = 2x \sin x + x^2 \cos x.

Tip: always check if you can simplify the expression first. Sometimes you don't need the product rule at all.

1

Product rule with exponential and polynomial

  1. Find ddx[x3ex]\frac{d}{dx}[x^3 e^x].
  2. Identify the two functions: f(x)=x3f(x) = x^3 and g(x)=exg(x) = e^x.
  3. Find each derivative: f(x)=3x2f'(x) = 3x^2 and g(x)=exg'(x) = e^x.
  4. Apply the product rule: (fg)=fg+fg=3x2ex+x3ex(fg)' = f'g + fg' = 3x^2 \cdot e^x + x^3 \cdot e^x.
  5. Factor out common terms: ex(3x2+x3)=x2ex(3+x)e^x(3x^2 + x^3) = x^2 e^x(3 + x).
  6. Final answer: ddx[x3ex]=x2ex(x+3)\frac{d}{dx}[x^3 e^x] = x^2 e^x(x + 3).

Quotient rule

For a ratio of functions: (fg)=fgfgg2\left(\frac{f}{g}\right)' = \frac{f'g - fg'}{g^2}.

Memory aid: "low d-high minus high d-low, over the square of what's below."

Example: ddxx2cosx=2xcosxx2(sinx)cos2x=2xcosx+x2sinxcos2x\frac{d}{dx}\frac{x^2}{\cos x} = \frac{2x\cos x - x^2(-\sin x)}{\cos^2 x} = \frac{2x\cos x + x^2\sin x}{\cos^2 x}.

Alternative: you can often rewrite f/gf/g as fg1f \cdot g^{-1} and use the product rule instead. Use whichever feels easier.


Chain rule

The chain rule handles compositions: if y=f(g(x))y = f(g(x)), then dydx=f(g(x))g(x)\frac{dy}{dx} = f'(g(x)) \cdot g'(x).

In words: derivative of the outer function (evaluated at the inner function) times the derivative of the inner function.

Example: ddxsin(x3)=cos(x3)3x2\frac{d}{dx} \sin(x^3) = \cos(x^3) \cdot 3x^2. The outer function is sin\sin, the inner function is x3x^3.

Nested chains: for esin(x2)e^{\sin(x^2)}, apply the chain rule twice: esin(x2)cos(x2)2xe^{\sin(x^2)} \cdot \cos(x^2) \cdot 2x.

The chain rule is arguably the most important rule. It appears everywhere: in implicit differentiation, related rates, and integration by substitution.

💡Explain it simply

Imagine a machine with two gears connected together. The big gear turns the small gear. If you want to know how fast the final output changes, you need to know two things: how fast the big gear turns the small gear, and how fast the small gear turns on its own.

That's the chain rule. If you have a function inside another function (like sin\sin of x3x^3), the rate of change of the whole thing is: how fast the outer part changes × how fast the inner part changes.

A real-world example: temperature affects ice cream sales, and ice cream sales affect your revenue. If temperature goes up by 1°, sales go up by 50 cones, and each cone gives you \3,thenyourrevenuegoesupby3, then your revenue goes up by 50 \times 3 = 150dollarsperdegree.Youmultipliedthetworatestogetherthatsthechainrule. dollars per degree. You multiplied the two rates together — that's the chain rule.

1

Chain rule with a nested composition

  1. Find ddxln(cosx)\frac{d}{dx} \ln(\cos x).
  2. Identify the outer and inner functions. Outer: ln(u)\ln(u) where u=cosxu = \cos x. Inner: cosx\cos x.
  3. Derivative of the outer function: ddulnu=1u\frac{d}{du} \ln u = \frac{1}{u}, evaluated at u=cosxu = \cos x gives 1cosx\frac{1}{\cos x}.
  4. Derivative of the inner function: ddxcosx=sinx\frac{d}{dx} \cos x = -\sin x.
  5. Multiply them (chain rule): 1cosx(sinx)=sinxcosx=tanx\frac{1}{\cos x} \cdot (-\sin x) = -\frac{\sin x}{\cos x} = -\tan x.
  6. Final answer: ddxln(cosx)=tanx\frac{d}{dx} \ln(\cos x) = -\tan x.
2

Double chain rule

  1. Find ddxesin(x2)\frac{d}{dx} e^{\sin(x^2)}.
  2. There are three nested layers: e()e^{(\cdot)}, then sin()\sin(\cdot), then x2x^2. We peel them off one at a time.
  3. Outermost layer: ddueu=eu\frac{d}{du} e^u = e^u, evaluated at u=sin(x2)u = \sin(x^2) gives esin(x2)e^{\sin(x^2)}.
  4. Middle layer: ddvsinv=cosv\frac{d}{dv} \sin v = \cos v, evaluated at v=x2v = x^2 gives cos(x2)\cos(x^2).
  5. Innermost layer: ddxx2=2x\frac{d}{dx} x^2 = 2x.
  6. Multiply all three together: esin(x2)cos(x2)2xe^{\sin(x^2)} \cdot \cos(x^2) \cdot 2x.
  7. Final answer: ddxesin(x2)=2xcos(x2)esin(x2)\frac{d}{dx} e^{\sin(x^2)} = 2x \cos(x^2)\, e^{\sin(x^2)}.

Inverse trigonometric derivatives

ddxarcsinx=11x2\frac{d}{dx} \arcsin x = \frac{1}{\sqrt{1-x^2}}, valid for x<1|x| < 1.

ddxarccosx=11x2\frac{d}{dx} \arccos x = -\frac{1}{\sqrt{1-x^2}}.

ddxarctanx=11+x2\frac{d}{dx} \arctan x = \frac{1}{1+x^2}. This one appears frequently in integration.

With the chain rule: ddxarctan(3x)=31+(3x)2=31+9x2\frac{d}{dx} \arctan(3x) = \frac{3}{1+(3x)^2} = \frac{3}{1+9x^2}.


Implicit differentiation

When yy is defined implicitly by an equation like x2+y2=25x^2 + y^2 = 25, differentiate both sides with respect to xx.

Every time you differentiate a yy term, attach a dydx\frac{dy}{dx} factor (this is the chain rule in action: yy is a function of xx).

Example: differentiate x2+y2=25x^2 + y^2 = 25 to get 2x+2ydydx=02x + 2y\frac{dy}{dx} = 0, then solve dydx=xy\frac{dy}{dx} = -\frac{x}{y}.

Implicit differentiation is essential for curves that can't be written as y=f(x)y = f(x), such as circles, ellipses, and other relations.

💡Explain it simply

Usually, you have a nice equation like y=x2+3y = x^2 + 3 where yy is alone on one side. But sometimes xx and yy are tangled together, like in x2+y2=25x^2 + y^2 = 25 (a circle). You can't easily solve for yy.

Implicit differentiation says: just differentiate everything with respect to xx anyway. Whenever you hit a yy, remember that yy secretly depends on xx, so slap on a dydx\frac{dy}{dx} (that's just the chain rule). Then solve for dydx\frac{dy}{dx}.

It's like a detective figuring out how fast a hidden variable changes by looking at the equation it's trapped in.

1

Implicit differentiation of a circle

  1. Find dydx\frac{dy}{dx} for x2+y2=25x^2 + y^2 = 25.
  2. Differentiate both sides with respect to xx. Remember: yy is a function of xx, so we must use the chain rule on yy terms.
  3. Left side: ddx(x2)+ddx(y2)=2x+2ydydx\frac{d}{dx}(x^2) + \frac{d}{dx}(y^2) = 2x + 2y \frac{dy}{dx}.
  4. The 2ydydx2y \frac{dy}{dx} came from the chain rule: ddx(y2)=2ydydx\frac{d}{dx}(y^2) = 2y \cdot \frac{dy}{dx}.
  5. Right side: ddx(25)=0\frac{d}{dx}(25) = 0.
  6. So: 2x+2ydydx=02x + 2y \frac{dy}{dx} = 0.
  7. Solve for dydx\frac{dy}{dx}: 2ydydx=2x2y\frac{dy}{dx} = -2x, therefore dydx=xy\frac{dy}{dx} = -\frac{x}{y}.
  8. At the point (3,4)(3, 4) on the circle: dydx=34\frac{dy}{dx} = -\frac{3}{4}. This makes geometric sense — the tangent line at (3,4)(3,4) on a circle centered at the origin should slope downward to the right.

Logarithmic differentiation

For complicated products, quotients, or expressions like xxx^x, take the natural log of both sides first.

Example: find ddxxx\frac{d}{dx} x^x. Let y=xxy = x^x, then lny=xlnx\ln y = x \ln x.

Differentiate implicitly: 1ydydx=lnx+1\frac{1}{y}\frac{dy}{dx} = \ln x + 1.

Solve: dydx=xx(lnx+1)\frac{dy}{dx} = x^x(\ln x + 1).

This technique turns products into sums and powers into products, making differentiation much simpler.


Higher-order derivatives

The second derivative f(x)f''(x) is the derivative of f(x)f'(x). It measures how the rate of change itself is changing.

Notation: f(x)f''(x), d2ydx2\frac{d^2y}{dx^2}, or yy''. For higher orders: f(x)f'''(x), f(4)(x)f^{(4)}(x), etc.

Physical meaning: if s(t)s(t) is position, then s(t)s'(t) is velocity and s(t)s''(t) is acceleration.

The second derivative tells you about concavity: f(x)>0f''(x) > 0 means concave up (like a bowl), f(x)<0f''(x) < 0 means concave down (like an arch).

Higher-order derivatives appear in Taylor series: you need f(a),f(a),f(a),f'(a), f''(a), f'''(a), \ldots to build the polynomial approximation.


Tangent lines and linearization

The tangent line to ff at x=ax = a is: y=f(a)+f(a)(xa)y = f(a) + f'(a)(x - a). This is the best linear approximation near aa.

Linearization: f(x)f(a)+f(a)(xa)f(x) \approx f(a) + f'(a)(x-a) for xx close to aa. This is incredibly useful for quick estimates.

Example: approximate 4.1\sqrt{4.1}. Use f(x)=xf(x) = \sqrt{x} at a=4a = 4: f(x)=12xf'(x) = \frac{1}{2\sqrt{x}}, f(4)=14f'(4) = \frac{1}{4}.

Linearization gives 4.12+14(0.1)=2.025\sqrt{4.1} \approx 2 + \frac{1}{4}(0.1) = 2.025. The actual value is 2.02485...2.02485..., very close!

Differentials: dy=f(x)dxdy = f'(x)\,dx gives the approximate change in yy for a small change dxdx in xx.


Interpreting the derivative graphically

f(x)>0f'(x) > 0 on an interval means ff is increasing there. f(x)<0f'(x) < 0 means ff is decreasing.

Where f(x)=0f'(x) = 0, the tangent line is horizontal. These are critical points: potential maxima or minima.

The sign of f(x)f'(x) changing from ++ to - at a critical point signals a local maximum. From - to ++ signals a local minimum.

If f(x)f'(x) does not change sign, the critical point is neither a max nor a min (e.g., f(x)=x3f(x)=x^3 at x=0x=0).

The graph of f(x)f'(x) tells you the steepness and direction of ff. Where ff' crosses zero, ff has a horizontal tangent.


⚠️

Common Mistakes to Avoid

  • Forgetting the inner derivative in the chain rule. This is the single most common error. Always ask: is there a function inside another function?
  • Applying the power rule to exe^x. The derivative of exe^x is exe^x, not xex1xe^{x-1}. The power rule is for xnx^n, not nxn^x.
  • In implicit differentiation, forgetting to multiply by dydx\frac{dy}{dx} whenever you differentiate a yy term.
  • Using the quotient rule when simple algebra would work. For instance, x3x=x2\frac{x^3}{x} = x^2 is easier to differentiate directly.
  • Confusing the derivative of ln(f(x))\ln(f(x)) with 1f(x)\frac{1}{f(x)}. The correct answer is f(x)f(x)\frac{f'(x)}{f(x)} by the chain rule.
  • Getting signs wrong on trig derivatives: cosx\cos x differentiates to sinx-\sin x (not +sinx+\sin x).
  • Assuming differentiability implies smoothness everywhere. A function can be continuous but not differentiable at corners, cusps, or vertical tangents.

Worked Practice Problems (5 examples)

Study these solved examples to understand the techniques. Then head to Practice to try problems on your own.

Practice on your own →
1

Problem 1

Find ddx(5x3)\frac{d}{dx}(5x^3)

Step-by-Step Solution

1

Power rule: ddx(xn)=nxn1\frac{d}{dx}(x^n) = nx^{n-1}.

2

53x31=15x25 \cdot 3x^{3-1} = 15x^2.

Final Answer: 15x215x^2

2

Problem 2

Find ddx(x4+2x)\frac{d}{dx}(x^4 + 2x)

Step-by-Step Solution

1

Differentiate term by term.

2

ddx(x4)=4x3\frac{d}{dx}(x^4) = 4x^3 and ddx(2x)=2\frac{d}{dx}(2x) = 2.

Final Answer: 4x3+24x^3 + 2

3

Problem 3

Find ddx(e3x)\frac{d}{dx}(e^{3x})

Step-by-Step Solution

1

Chain rule: ddx(ekx)=kekx\frac{d}{dx}(e^{kx}) = ke^{kx}.

2

Here k=3k=3: 3e3x3e^{3x}.

Final Answer: 3e3x3e^{3x}

4

Problem 4

Find ddx(sin(x))\frac{d}{dx}(\sin(x))

Step-by-Step Solution

1

This is a fundamental derivative.

2

ddx(sinx)=cosx\frac{d}{dx}(\sin x) = \cos x.

Final Answer: cos(x)\cos(x)

5

Problem 5

Find ddx(ln(x))\frac{d}{dx}(\ln(x))

Step-by-Step Solution

1

This is a fundamental derivative.

2

ddx(lnx)=1x\frac{d}{dx}(\ln x) = \frac{1}{x}.

Final Answer: 1x\frac{1}{x}

Ready to practice?

Test your understanding with 40 problems on derivatives.