Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 68 ยท Derivatives

Derivatives of Exponentials, Logs and Trig Functions

Derive and use the derivatives of e^x, ln x, sin, cos, tan and hyperbolic functions, and master logarithmic differentiation, with sympy and numeric checks.

Growth, decay, oscillation: the three behaviours that fill engineering textbooks are described by exponentials, logarithms and trigonometric functions. A charging capacitor follows 1 - e^(-t/RC), a vibrating beam follows sin(ฯ‰t), and the loudness of sound in decibels follows a logarithm. To analyse any of them you need their derivatives, and each has a delightfully simple form.

This lesson gives you those derivatives, explains why e is special, applies the chain rule to composite versions, introduces hyperbolic functions, and finishes with logarithmic differentiation, a trick for awkward products and for variable exponents like x^x.

The number e and its derivative

Consider a^x for some base a > 0. Its difference quotient is a^x * (a^h - 1) / h. The factor (a^h - 1) / h does not depend on x; it is just a constant for each base, the slope of a^x at x = 0. For a = 2 it approaches about 0.693, for a = 3 about 1.099. There is exactly one base where that constant equals 1. That base is e โ‰ˆ 2.71828, and it gives the remarkable result:

TEXT
d/dx e^x = e^x

The function equals its own slope. That is why exponential growth is the natural model whenever a quantity grows at a rate proportional to its current size.

Python Why e is special

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The slope at 0 equals ln a, which is exactly 1 for a = e. So in general d/dx a^x = a^x ln a, and e^x is the case where the extra factor disappears.

The natural logarithm

ln x is the inverse of e^x. By the inverse-function rule, if y = ln x then x = e^y, so dx/dy = e^y = x and therefore

TEXT
d/dx ln x = 1/x       (for x > 0)

Notice the odd consequence: 1/x has no power-rule antiderivative. That gap is filled by ln x itself, which you will exploit in the integral chapters. For any other base, d/dx log_a x = 1 / (x ln a). For absolute values, d/dx ln|x| = 1/x for all x โ‰  0.

With the chain rule: d/dx e^(g(x)) = g'(x) e^(g(x)) and d/dx ln(g(x)) = g'(x) / g(x). So d/dx e^(-3x) = -3e^(-3x) and d/dx ln(x^2 + 1) = 2x / (x^2 + 1).

Sine, cosine and tangent

These come from the angle-addition formulas and the limit sin(h)/h โ†’ 1 (angles in radians):

TEXT
d/dx sin x = cos x
d/dx cos x = -sin x
d/dx tan x = sec^2 x = 1 / cos^2 x

Radians matter. If x is in degrees, extra factors of ฯ€/180 appear. Engineers working with sin(ฯ‰t) use radians per second, so d/dt sin(ฯ‰t) = ฯ‰ cos(ฯ‰t): the angular frequency multiplies the derivative.

A pattern worth noticing: differentiate sin four times and you return to sin: sin โ†’ cos โ†’ -sin โ†’ -cos โ†’ sin. That cycle is why sinusoids solve oscillation equations, as you will see in Second-Order Linear ODEs.

flowchart LR
    A["sin x"] -->|"d/dx"| B["cos x"]
    B -->|"d/dx"| C["-sin x"]
    C -->|"d/dx"| D["-cos x"]
    D -->|"d/dx"| A

Four derivatives bring sine back to itself.

Python Check the standard derivatives with sympy

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Each line applies the chain rule automatically. For cos(x)**2 sympy prints -2*sin(x)*cos(x), which equals -sin(2x) by a double-angle identity.

Inverse trig derivatives

Using the inverse-function rule on sin, tan, you get:

TEXT
d/dx arcsin x = 1 / sqrt(1 - x^2)        (|x| < 1)
d/dx arctan x = 1 / (1 + x^2)

The arctan formula is especially friendly, and it shows up in phase calculations in circuits and in control theory.

Hyperbolic functions

The hyperbolic sine and cosine are built from exponentials:

TEXT
sinh x = (e^x - e^(-x)) / 2        cosh x = (e^x + e^(-x)) / 2

Differentiating the definitions term by term gives d/dx sinh x = cosh x and d/dx cosh x = sinh x, with no minus sign, unlike their circular cousins. The curve y = cosh x describes a hanging chain (a catenary), and tanh x is used as a smooth S-shaped function in neural networks, with derivative 1 - tanh^2 x.

Python Hyperbolic derivatives numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Logarithmic differentiation

Sometimes the rules combine painfully. Take y = x^x. It is neither a power rule case (the exponent varies) nor an exponential rule case (the base varies). The trick is to take ln of both sides, which turns exponents into products and products into sums, then differentiate implicitly.

  1. Start: y = x^x.
  2. Take logs: ln y = x ln x.
  3. Differentiate both sides (chain rule on the left, product rule on the right): y'/y = ln x + 1.
  4. Solve: y' = y (ln x + 1) = x^x (ln x + 1).

The same method simplifies long products and quotients. For y = x^3 (2x + 1)^4 / (x - 5)^2, taking logs turns it into 3 ln x + 4 ln(2x + 1) - 2 ln(x - 5), and y'/y becomes 3/x + 8/(2x + 1) - 2/(x - 5). Multiply back by y.

Python Logarithmic differentiation of x^x

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Logarithmic differentiation needs y > 0 where you take the log. For negative values use ln|y|; the derivative 1/y is the same.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is d/dx e^(5x)?

    By the chain rule the inner derivative 5 multiplies e^(5x): d/dx e^(5x) = 5e^(5x).
  2. 2. What is d/dx ln(x^2 + 1)?

    d/dx ln(g) = g' / g, so with g = x^2 + 1 we get 2x / (x^2 + 1).
  3. 3. Why must angles be in radians when you use d/dx sin x = cos x?

    The identity depends on sin(h)/h approaching 1, true only when h is in radians. With degrees an extra factor of pi/180 appears.
  4. 4. What is d/dx cosh x?

    Differentiating (e^x + e^(-x))/2 gives (e^x - e^(-x))/2, which is sinh x, with no minus sign.
  5. 5. Logarithmic differentiation of y = x^x gives which derivative?

    ln y = x ln x, so y'/y = ln x + 1 by the product rule, and y' = x^x (ln x + 1).

Summary

  • e^x is its own derivative, and d/dx a^x = a^x ln a; e is the base for which the slope at 0 is exactly 1.
  • d/dx ln x = 1/x, and with the chain rule d/dx ln g = g'/g.
  • sin' = cos, cos' = -sin, tan' = sec^2, with angles in radians; sinh' = cosh, cosh' = sinh.
  • Inverse trig: arcsin' = 1/sqrt(1 - x^2), arctan' = 1/(1 + x^2).
  • Logarithmic differentiation handles variable exponents and long products.

Next, put derivatives to work in Applications of Derivatives.