M5.4.6 Chapter 6

Exponentials, logs and trig functions

What are the gradient functions of eˣ, ln x, sin x and cos x?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Differentiate eˣ, ln x, sin x and cos x
  • Explain why x must be in radians for these results

You can now differentiate every power of x. But the curves that model growth, decay and waves are not powers. They are eˣ, ln x, sin x and cos x. Their derivatives turn out to be as short as the power rule, and they are results you will use again and again.

Start with eˣ. Take any base a above 1, and ask how steep y = aˣ is at x = 0, where the height is 1. The chord from x = 0 to x = h has gradient (a^h − 1) ÷ h. Use a small step such as h = 0.001 and a calculator. The table shows the answer for three bases.

A table with the heads base a and gradient at x = 0. The rows read 2 and 0.6934, e and 1.0005, 3 and 1.0992.base agradient at x = 020.6934e1.000531.0992
The chord gradient at x = 0 for y = aˣ, with h = 0.001. A base of 2 is a little too gentle and a base of 3 is a little too steep. The base e gives a gradient of about 1. With a smaller h it gets closer to 1.

The base 2 gives a gradient below 1, and the base 3 gives one above 1. Somewhere between them is a base where the gradient at x = 0 is exactly 1. That base is the number e, about 2.718. This is the best way to describe e: it is the base whose curve has gradient 1 at height 1.

Now take any x. The chord gradient of eˣ from x to x + h is (e^(x + h) − eˣ) ÷ h. Write e^(x + h) = eˣ × e^h. Then the chord gradient is eˣ × (e^h − 1) ÷ h. The part (e^h − 1) ÷ h is the gradient at 0, which tends to 1. So the whole chord gradient tends to eˣ × 1. The result: if y = eˣ then dy/dx = eˣ. The gradient of the curve at every point is equal to its height.

Two graphs one above the other, with the same x axis x. The upper graph has the y axis y and the curve named eˣ. The lower graph has the y axis gradient and a curve named eˣ, which is the same curve. Dotted lines join a dot at x = −1, x = 0 and x = 1 on the upper curve to the dot straight below on the lower one, at the same height.eˣ−2−11224680xyeˣ−2−11224680xgradient
The gradient graph of y = eˣ is the same curve. At x = 0 the height is 1 and the gradient is 1. At x = 1 both are e = 2.72.

Next, ln x. The curves y = eˣ and y = ln x are mirror images in the line y = x. A mirror swaps across and up. So it swaps the rise and the run of any tangent, and turns a gradient m into 1 ÷ m. On y = eˣ the point (1, e) has gradient e. Its mirror image on y = ln x is the point (e, 1), and the gradient there is 1/e. In general, at x = b on y = ln x the gradient is 1/b. So if y = ln x then dy/dx = 1/x.

A graph with equal scales on the x axis x and the y axis y. The curve eˣ and the curve ln x are drawn, and the dashed line y = x lies between them as a mirror. The point P is at (1, 2.72) on eˣ and the point Q is at (2.72, 1) on ln x. A tangent at P rises steeply and a dashed tangent at Q rises gently.PQy = xeˣln x123412340xy
The mirror line y = x swaps the two curves. The tangent at P (1, 2.72) has gradient e = 2.72. Its mirror image, the tangent at Q (2.72, 1), has gradient 1/e = 0.37.

Now sin x and cos x. Look at the gradient of y = sin x with the picture below. The curve starts at 0 and climbs. Its gradient is highest at x = 0, flat at the top, and negative as it falls. That is exactly the shape of the cosine curve. In fact, if y = sin x then dy/dx = cos x. And if y = cos x then dy/dx = −sin x. The cosine curve starts at its top, where its gradient is 0. Its gradient is −sin x, which is 0 at x = 0 and then negative.

Two graphs one above the other, with the same x axis x (radians). The upper graph has the y axis y and the curve sin x. The lower graph has the y axis gradient and the curve cos x. Dotted lines join a dot at x = 0, x = 1.57 and x = 3.14 on the sine curve to the dot straight below on the cosine curve.sin x123457−110x (radians)ycos x134567−110x (radians)gradient
The gradient of sin x is cos x. At x = 0 the gradient is 1. At x = π/2 the sine is at its top and the gradient is 0. At x = π the sine is falling and the gradient is −1.

Both results come with a warning. They are true only when x is measured in radians. The reason is in the gradient of sin x at 0. The chord from 0 to h has gradient sin h ÷ h. With h in radians this tends to 1. If h were in degrees, the same chord would have a gradient of about 0.01745, which is π ÷ 180, because 1 degree is only π/180 of a radian.

Here is the reason in a picture. Take a circle of radius 1. An angle of h radians at the centre cuts off an arc of length exactly h, since a radian is defined by arc ÷ radius. The height of the point above the x axis is sin h. For a small angle the arc and the height are almost the same, so sin h ÷ h is close to 1. In degrees the arc is only πh/180 long, and the ratio of height to angle is about π/180.

A circle of radius 1 with its centre O at the origin and the axes x and y. The point P is on the circle, and the radius OP is labelled 1. The angle at the centre between the x axis and the line OP is labelled h. The arc of the circle from the x axis to P is drawn thick and labelled arc h. A dashed line drops from P to the x axis and is labelled sin h, and the stretch along the x axis is labelled cos h.xycos hsin hharc h1PO
On the unit circle an angle of h radians cuts off an arc of length h, drawn thick. The height of P is sin h. For a small h the two are nearly equal, so sin h ÷ h is close to 1. The picture uses h = 1.25 so that the names fit.
A table with the heads h, radians and degrees. The rows read 1 and 0.84147 and 0.01745, 0.1 and 0.99833 and 0.01745, 0.01 and 0.99998 and 0.01745.hradiansdegrees10.841470.017450.10.998330.017450.010.999980.01745
The value of sin h ÷ h for small h, with the calculator in radian mode and in degree mode. In radians it goes to 1. In degrees it sits at 0.01745, which is π ÷ 180.

Worked example

Estimate the gradient of y = sin x at x = 0, with the chord for h = 0.01. Do it with the calculator in radian mode and in degree mode.

  1. The chord from x = 0 to x = 0.01 has gradient (sin 0.01 − sin 0) ÷ 0.01 = sin 0.01 ÷ 0.01.
  2. In radian mode, sin 0.01 = 0.0099998. So the gradient is 0.0099998 ÷ 0.01 = 0.99998.
  3. In degree mode, sin 0.01° = 0.00017453. So the gradient is 0.00017453 ÷ 0.01 = 0.01745.
  4. Only the radian value is close to cos 0 = 1. In degree mode the rule dy/dx = cos x fails, because the answer is π/180 times too small.

Answer: Radian mode gives 0.99998 and degree mode gives 0.01745.

See it three ways

With things

Spin a bicycle wheel and watch a spot on the rim. The height of the spot goes up and down like sin x. How fast it is rising or falling at each moment is like cos x. The speed is biggest when the spot passes the middle height.

As a picture

A table with the heads y and dy/dx. The rows read eˣ and eˣ; ln x and 1/x; sin x and cos x; cos x and −sin x.ydy/dxeˣeˣln x1/xsin xcos xcos x−sin x

In words

The gradient of eˣ is eˣ. The gradient of ln x is 1 over x. The gradient of sin x is cos x, and the gradient of cos x is minus sin x, with x in radians.

In symbols

d/dx (eˣ) = eˣ, d/dx (ln x) = 1/x, d/dx (sin x) = cos x, d/dx (cos x) = −sin x.

These results work with the earlier rules. A constant multiplier stays, and a sum is differentiated term by term. So the derivative of 3eˣ is 3eˣ, and the derivative of 5 sin x is 5 cos x.

Worked example

Differentiate y = 4 sin x − 3 cos x + 2eˣ, and find the gradient at x = 0.

  1. Differentiate each term. The derivative of 4 sin x is 4 cos x.
  2. The derivative of −3 cos x is −3 × (−sin x) = 3 sin x.
  3. The derivative of 2eˣ is 2eˣ.
  4. So dy/dx = 4 cos x + 3 sin x + 2eˣ.
  5. At x = 0: cos 0 = 1, sin 0 = 0 and e⁰ = 1. So the gradient is 4 × 1 + 3 × 0 + 2 × 1 = 6.

Answer: dy/dx = 4 cos x + 3 sin x + 2eˣ, and the gradient at x = 0 is 6.

Worked example

Find the minimum point of y = eˣ − 2x.

  1. Differentiate: dy/dx = eˣ − 2.
  2. Set it to 0: eˣ = 2. Take natural logs: x = ln 2 = 0.693, to 3 decimal places.
  3. The second derivative is eˣ, which is always positive, so this is a minimum.
  4. At the minimum, y = e^(ln 2) − 2 ln 2 = 2 − 2 × 0.693 = 0.614.

Answer: The minimum is at (0.693, 0.614).

Try it

Test eˣ with a calculator

You need: a calculator with an eˣ key, paper and a pencil.

  1. Work out e¹ and e^1.001 on the calculator. Write down both, with at least 6 decimal places.
  2. Find the chord gradient (e^1.001 − e¹) ÷ 0.001.
  3. Compare it with the height e¹ = 2.718.
  4. Do the same at x = 2, using e² and e^2.001.

What you will see: The chord gradient is nearly equal to the height of the curve each time. This is the property of eˣ: its gradient equals its height.

If you cannot try it, this is what happens.
A table with the heads x, height and chord. The rows read 0 and 1 and 1.0005, 1 and 2.7183 and 2.7196, 2 and 7.3891 and 7.3928.xheightchord011.000512.71832.719627.38917.3928

A wrong idea many people have

The derivative of eˣ follows the power rule, so it is xeˣ⁻¹.

Why it feels right: The power rule is the one derivative you know well. The expression eˣ has x in a power, so it feels as if it should be brought down in front.

The test that breaks it: In the power rule, the base is the variable and the power is a fixed number. In eˣ the base is the fixed number e and the variable is the power. At x = 0, xeˣ⁻¹ gives 0, but the chord gradient of eˣ at 0 is about 1.

What is true: The power rule is for xⁿ. The function eˣ is an exponential. Its derivative is eˣ itself. Do not use the power rule when the variable is in the power.

A wrong idea many people have

The derivative of ln x is ln(x) × x, or the derivative of x with ln written in front.

Why it feels right: Logs look complicated, so a complicated result looks reasonable. A product or an extra ln seems a natural result.

The test that breaks it: At x = 4, the chord gradient of ln x is (ln 4.01 − ln 4) ÷ 0.01 = 0.2497. The claim ln 4 × 4 would give 5.5, far too big. And 1/x = 0.25.

What is true: The derivative of ln x is 1/x. It is the reciprocal of the gradient of eˣ at the mirror point. The curve y = ln x is steep near x = 0 and gets flatter as x grows, which 1/x does too.

A wrong idea many people have

The results for sin x and cos x work in degrees as well as in radians.

Why it feels right: The same curve is drawn whichever unit you use, so the gradient looks the same. A calculator accepts x in either mode.

The test that breaks it: The table above showed that sin h ÷ h goes to 1 in radian mode, and sits at 0.01745 in degree mode. The rule dy/dx = cos x would give 1 at x = 0, so it fails in degrees.

What is true: The results d/dx (sin x) = cos x and d/dx (cos x) = −sin x need x in radians. In degrees, a factor π/180 appears in front of each. Always set the calculator to radian mode in calculus.

Key words

e
the base, about 2.718, for which the curve y = aˣ has gradient 1 where it crosses the y axis.
natural logarithm
ln x, the logarithm to base e. It is the inverse of eˣ.
radian
the unit of angle in which d/dx (sin x) = cos x. π radians = 180°.
exponential
a function with the variable in the power, such as eˣ.

Back to your guess

The answer is B: The curve y = eˣ has height 1 at x = 0. Its gradient at x = 0 is 1.

The gradient is exactly 1 at x = 0, the same as the height. This is what makes e special. The curve y = eˣ has gradient equal to its height at every point, so its derivative is eˣ itself.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. What is the derivative of y = eˣ?

    Tap your answer.
    1. Yes, that is right. The gradient of the curve y = eˣ is equal to its height at every point. So dy/dx = eˣ.

    2. Not this one. That uses the power rule, which is for xⁿ. In eˣ the variable is in the power, not the base. Read this page again. Try another.

    3. Not this one. The gradient of eˣ at x = 0 is 1, but at x = 1 it is e. The derivative is a function of x, and it is eˣ. Read this page again. Try another.

    4. Not this one. The number e is the value of eˣ at x = 1. The derivative is eˣ, the same function. Read this page again. Try another.

    See the answer

    eˣ

    The gradient of the curve y = eˣ is equal to its height at every point. So dy/dx = eˣ.

    • If you chose B: That uses the power rule, which is for xⁿ. In eˣ the variable is in the power, not the base. Read this page again.
    • If you chose C: The gradient of eˣ at x = 0 is 1, but at x = 1 it is e. The derivative is a function of x, and it is eˣ. Read this page again.
    • If you chose D: The number e is the value of eˣ at x = 1. The derivative is eˣ, the same function. Read this page again.
  2. What is the derivative of y = ln x?

    Tap your answer.
    1. Not this one. The derivative of ln x gets smaller as x grows, because the curve flattens. A derivative of x would grow. Read this page again. Try another.

    2. Not this one. That is the derivative of eˣ. The function ln x is the inverse of eˣ, and its gradient is the reciprocal. Read this page again. Try another.

    3. Yes, that is right. The curve y = ln x is the mirror image of y = eˣ in y = x. A mirror turns a gradient m into 1/m, which gives 1/x.

    See the answer

    1/x

    The curve y = ln x is the mirror image of y = eˣ in y = x. A mirror turns a gradient m into 1/m, which gives 1/x.

    • If you chose A: The derivative of ln x gets smaller as x grows, because the curve flattens. A derivative of x would grow. Read this page again.
    • If you chose B: That is the derivative of eˣ. The function ln x is the inverse of eˣ, and its gradient is the reciprocal. Read this page again.
  3. What is the derivative of y = sin x, with x in radians?

    Tap your answer.
    1. Not this one. The gradient of sin x at x = 0 is +1, but −cos 0 = −1. The sign is wrong. Read this page again. Try another.

    2. Yes, that is right. The gradient of the sine curve is 1 at x = 0, 0 at the top, and −1 on the way down at x = π. That is cos x.

    3. Not this one. That is the function itself, not its gradient. At x = 0 the gradient of sin x is 1, but sin 0 = 0. Read this page again. Try another.

    4. Not this one. That is the derivative of cos x. At x = 0 the gradient of sin x is 1, but −sin 0 = 0. Read this page again. Try another.

    See the answer

    cos x

    The gradient of the sine curve is 1 at x = 0, 0 at the top, and −1 on the way down at x = π. That is cos x.

    • If you chose A: The gradient of sin x at x = 0 is +1, but −cos 0 = −1. The sign is wrong. Read this page again.
    • If you chose C: That is the function itself, not its gradient. At x = 0 the gradient of sin x is 1, but sin 0 = 0. Read this page again.
    • If you chose D: That is the derivative of cos x. At x = 0 the gradient of sin x is 1, but −sin 0 = 0. Read this page again.
  4. What is the derivative of y = cos x, with x in radians?

    Tap your answer.
    1. Not this one. The cosine curve starts at its top, where the gradient is 0, then falls. sin x is positive just after 0, but the gradient is negative. Read this page again. Try another.

    2. Not this one. At x = 0 the gradient of cos x is 0, but −cos 0 = −1. Read this page again. Try another.

    3. Not this one. At x = 0 the gradient of cos x is 0, but cos 0 = 1. Read this page again. Try another.

    4. Yes, that is right. The cosine curve is flat at x = 0 and then falls, so its gradient is 0 and then negative. That is −sin x.

    See the answer

    −sin x

    The cosine curve is flat at x = 0 and then falls, so its gradient is 0 and then negative. That is −sin x.

    • If you chose A: The cosine curve starts at its top, where the gradient is 0, then falls. sin x is positive just after 0, but the gradient is negative. Read this page again.
    • If you chose B: At x = 0 the gradient of cos x is 0, but −cos 0 = −1. Read this page again.
    • If you chose C: At x = 0 the gradient of cos x is 0, but cos 0 = 1. Read this page again.
  5. From an earlier chapter

    Which step comes first when you solve a problem about the biggest or smallest value?

    Tap your answer.
    1. Yes, that is right. The function must have one variable before it can be differentiated. For the box it was V = x(30 − 2x)², and for the fence L = 2x + 200/x.

    2. Not this one. You can only differentiate once the quantity is written using one variable, with its allowed values stated. Go to M5.4.5. Try another.

    3. Not this one. Rounding comes last. First write the quantity with one variable, then differentiate. Go to M5.4.5. Try another.

    See the answer

    Write the quantity using one variable.

    The function must have one variable before it can be differentiated. For the box it was V = x(30 − 2x)², and for the fence L = 2x + 200/x.

    • If you chose B: You can only differentiate once the quantity is written using one variable, with its allowed values stated. Go to M5.4.5.
    • If you chose C: Rounding comes last. First write the quantity with one variable, then differentiate. Go to M5.4.5.
  6. The gradient of y = sin x at x = 0 is 1 only if x is measured in what unit?

    Tap your answer.
    1. Not this one. In degrees the gradient at 0 is about 0.01745. The result depends on the unit. Read this page again. Try another.

    2. Not this one. The rule gives different values in the two units, so the unit matters. Read this page again. Try another.

    3. Yes, that is right. A radian is the angle for which the arc equals the radius. With radians, sin h ÷ h goes to 1 for small h. With degrees it goes to π/180.

    See the answer

    radians

    A radian is the angle for which the arc equals the radius. With radians, sin h ÷ h goes to 1 for small h. With degrees it goes to π/180.

    • If you chose A: In degrees the gradient at 0 is about 0.01745. The result depends on the unit. Read this page again.
    • If you chose B: The rule gives different values in the two units, so the unit matters. Read this page again.
  7. The curve is y = 3eˣ + 5 sin x − 2 cos x. Find the gradient at x = 0.

    See the answer

    8

    dy/dx = 3eˣ + 5 cos x + 2 sin x. At x = 0 this is 3 × 1 + 5 × 1 + 2 × 0 = 8.

  8. Find the gradient of y = ln x at x = 4.

    See the answer

    0.25

    dy/dx = 1/x. At x = 4 the gradient is 1/4 = 0.25.

  9. Find the x-coordinate of the minimum point of y = 4x − ln x.

    See the answer

    0.25

    dy/dx = 4 − 1/x. Set it to 0: 1/x = 4, so x = 1/4 = 0.25. The second derivative is 1/x², which is positive, so it is a minimum.

  10. In degree mode, work out sin 0.01° ÷ 0.01 to 5 decimal places. This is the chord gradient of sin x at 0, with the angle in degrees.

    See the answer

    0.01745

    In degree mode sin 0.01° = 0.00017453. Divide by 0.01 to get 0.01745. This is π ÷ 180, not 1, so the rule dy/dx = cos x fails in degrees.

Keep it

Copy this into your exercise book.

eˣ gives eˣ. ln x gives 1/x. sin x gives cos x. cos x gives −sin x. Radians only: in degrees a factor π/180 appears. Constants stay, sums go term by term.

Draw: A sine curve above a cosine curve, with a dotted line from a point on the sine to the matching height of the cosine.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (925 KB). It opens on any phone.