Introduction to differentiation and the derivative

Calculus
Author

Tom Coleman

Summary
The idea of differentiation is everywhere in modern mathematics and in the sciences as it is related to the rate of change of an object or process. In this guide, the idea of differentiation and the derivative is introduced from first principles, its role in explaining the behaviour of functions is explained, and derivatives of common functions are introduced and used.

Before reading this guide, it is recommended that you read [Guide: Properties of functions], Guide: Laws of indices, Guide: Logarithms, and [Guide: Tangents].

What is differentiation?

Functions can be used to model many real-life processes; such as the speed of a car, the performance of a stock market over time, and the growth rate of animal populations. You can use mathematical tools examined in the first three chapters to solve some of these problems (as well as a host of others).

Sometimes it is necessary to examine the rate of change of a particular process or phenomenon. For instance, the rate of change of the speed of a car is acceleration. Studying different rates of change of such a real life problem is often useful; for instance, by looking at acceleration of a car over time, you can determine how far the car goes. Rates of change are common in studying other, real-life processes, such as: the change in value of a company in a stock exchange in economics, the change in population of a species of animal in biology, or the rate of decay of radioactive material in chemistry.

The idea of investigating the rate of change of functions and their associated applications is known as differential calculus. The process of differentiation allows you to examine these properties of rates of change of functions. Importantly, this process is general, allowing you to investigate the rate of change of a function at any point. Differentiating a function \(y = f(x)\) gives its derivative, which is written as \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) or \(f'(x)\).

This guide will look at the idea of differentiation; where it comes from, how it can be used, and how you can apply its techniques to functions that you may be familiar with.

Gradients of a graph

The rate of change of a straight line \(y = mx + c\) is its gradient \(m\), and this doesn’t change wherever you are on the line. However, the rate of change of a function like \(f(x) = x^2/2 + 1\) is dependent on what point you are at — when \(x\) is small, the rate of change is correspondingly small; when \(x\) is large, the rate of change is larger. You can see this in the variable ‘steepness’ of the curve in the figure below.

The idea of examining the rate of change of a function is to look at the gradients of straight lines, with endpoints as values on the graph, that approximate the function. The smaller the straight line is, the better the approximation. So let \(h\) be some small real number. Then the line with endpoints \(f(x+h)\) and \(f(x)\) has vertical change \(f(x+h) - f(x)\), and horizontal change \((x+h) - x = h\). Therefore, the gradient of this line is \[\frac{f(x+h) - f(x)}{h}.\]

Here’s an interactive example of an approximation of the gradient of a function \(f(x)\). You can notice that as \(h\) gets smaller, then the gradient of the line segment on the graph gets closer to the gradient of the red line, providing a better approximation of the steepness of \(f(x)\) at a point.

The problem is when \(h\) tends towards \(0\), then \(f(x+h)\) and \(f(x)\) get closer and closer to one another, and the length of the line gets smaller and smaller. What use is there measuring the gradient of a line if the line disappears? The idea is to look at a parallel line, which has the same gradient.

Here, this convenient parallel line is the tangent of \(f(x)\) at \(x\); this is the straight line touching the curve at the point \((x,f(x))\), but does not intersect it at that point (see [Guide: Tangents]). Therefore, you can say that the gradient of the tangent to the curve at the point \(x\) is \[\lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\] and this consideration defines the derivative of a function.

Derivatives and differentiation

Following the investigation in the previous section, the derivative of a function can now be defined.

Definition of the derivative \(f'(x)\)

The derivative of \(f(x)\) with respect to \(x\) is defined to be the function \[f'(x) = \lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\] The derivative of \(f(x)\) with respect to \(x\) is a function in its own right. The value of the derivative \(f'(x)\) at the point \(x = a\), defined by \[f'(a) = \lim_{h\to 0}\frac{f(a+h) - f(a)}{h}\] is the gradient of the tangent to \(f(x)\) at the point \(a\).

If this limit exists, then \(f(x)\) is differentiable at \(x = a\). If \(f(x)\) is differentiable at every point of its domain, then it is a differentiable function. The process of finding \(f'(x)\) given a function \(f(x)\) is called differentiating with respect to \(x\).

The function \(f(x)\) is often defined in terms of a second variable \(y\). If a function is written \(y = f(x)\), then there is alternative notation for writing the derivative with respect to \(x\):

Definition of \(dy/dx\)

Let \(y = f(x)\) be a function of \(x\). Then the derivative of \(y\) with respect to \(x\) can be written as \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = f'(x)\)

The derivative of \(y\) with respect to \(x\) at a point \(x = a\) is written as \[\left.\dfrac{\mathrm{d}y}{\mathrm{d}x}\right|_{x = a} = f'(a)\].

Warning

Although \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) looks like a fraction, it isn’t. However, sometimes it behaves like a fraction, and you can use this to remember certain results. However, this isn’t an excuse to treat it as a fraction in standard mathematical work.

This notation was used by Leibniz to represent the derivative of a function \(y = f(x)\). It’s useful because it codifies the derivative as a rate of change (ratio of change in \(y\) to change in \(x\)) as well as explicitly naming the variable that you are differentiating with respect to. (This will be extremely useful in [Guide: Introduction to partial differentiation].) However, it’s not so useful for expressing the value of the derivative at a particular point \(x = a\); for instance \[f'(a)\quad\textsf{ compared to }\quad \left.\dfrac{\mathrm{d}y}{\mathrm{d}x}\right|_{x = a}.\] The important thing to consider is this:

Tip

As both notations \(f'(x)\) and \(\dfrac{\mathrm{d}f}{\mathrm{d}x}\) have their advantages over the other, it’s important to be able to use both sets of notation interchangeably.

Finally, the actual value of the derivative \(f'(x)\) of a function \(f(x)\) at a point \(x = a\) is very important, because it tells you about the behaviour of the function at that point. This is referred to as the rate of change of \(f(x)\) at \(x = a\), and is equal to the gradient of the tangent to \(f(x)\) at the point \((a,f(a))\). The way in which the function changes at a point \(x = a\) depends on the value of \(f'(a)\):

  • If \(f'(a) > 0\), then the function \(f(x)\) is increasing at \(x = a\);
  • If \(f'(a) < 0\), then the function \(f(x)\) is decreasing at \(x = a\);
  • If \(f'(a) = 0\), then the function \(f(x)\) is stationary at \(x = a\). The point \(x = a\) is called a stationary point of the function \(f(x)\).

Differentiating well-known functions

You can use the limit definition of the derivative to show that the following key functions have the following derivatives:

List of derivatives
  • For any number \(a\), the derivative of the constant function \(f(x) = a\) is \(f'(x) = 0\).

  • For any number \(n\neq 0\), the derivative of any function \(f(x) = x^n\) is \(f'(x) = nx^{n-1}\). This includes not only whole numbers, but also fractions and other non-zero real numbers.

  • The derivative of the exponential function \(f(x) = e^x\) is \(f'(x) = e^x\).

  • The derivative of the sine function \(f(x) = \sin(x)\) is \(f'(x) = \cos(x)\), and the derivative of the cosine function \(g(x) = \cos(x)\) is \(g'(x) = -\sin(x)\). (Notice the minus sign here!)

  • The derivative of the natural logarithm function \(f(x) = \ln(x)\) is \(f'(x) = \dfrac{1}{x}\).

Important

If you are going to use differentiation in your work/life, you should remember these results.

Most of these results are explained in Proof sheet: Derivatives of functions from first principles.

From here, you can combine two functions into one and differentiate. The following results say this.

Rules for differentiation

Let \(f(x)\) and \(g(x)\) be differentiable functions, and \(c\) be a non-zero real number. Then:

  • (sum rule) The derivative of two functions \(f(x)\) and \(g(x)\) added together is the same as their derivatives \(f'(x)\) and \(g'(x)\) added together; that is, \[\dfrac{\mathrm{d}}{\mathrm{d}x}(f + g) = \dfrac{\mathrm{d}f}{\mathrm{d}x} + \dfrac{\mathrm{d}g}{\mathrm{d}x}\]

  • (difference rule) The derivative of one function \(g(x)\) subtracted from another \(f(x)\) is the same as the derivative \(g'(x)\) subtracted from the derivative of \(f'(x)\); that is \[\dfrac{\mathrm{d}}{\mathrm{d}x}(f - g) = \dfrac{\mathrm{d}f}{\mathrm{d}x} -\dfrac{\mathrm{d}g}{\mathrm{d}x}\]

  • (scaling rule) The derivative of a function \(f(x)\) multiplied by a real number \(c\) is the same as the derivative \(f'(x)\) multiplied by \(c\); that is \[\dfrac{\mathrm{d}}{\mathrm{d}x}(cf(x)) = c\dfrac{\mathrm{d}f}{\mathrm{d}x}\]

Important

These differentiation rules do not tell you how to differentiate all possible combinations of functions. For instance:

  • you need the product rule to differentiate the product \(f(x)g(x)\) of two functions
  • you need the quotient rule (and \(g(x)\neq 0\)) to differentiate the quotient \(f(x)/g(x)\) of two functions
  • you need the chain rule to differentiate the composition \(f(g(x))\) of two functions

These techniques are important enough to merit their own guides. For more about these, see [Guide: The product rule], [Guide: The quotient rule], [Guide: The chain rule]. For more on where these results come from, see [Proof sheet: Rules of differentiation.]

Specifically, using the scaling and chain rule can be used to show the following results, which are incredibly useful for any work involving differentiation.

Generalized list of derivatives

Let \(a,b,n\) be real numbers where \(n\neq 0\). Then:

  • The derivative of a straight line \(f(x) = ax + b\) is \(f'(x) = a\).

  • The derivative of a power \(f(x) = ax^n\) is \(f'(x) = anx^{n-1}\).

  • The derivative of the exponential function \(f(x) = ae^{bx}\) is \(f'(x) = abe^{bx}\).

  • The derivative of the sine function \(f(x) = a\sin(bx)\) is \(f'(x) = ab\cos(bx)\), and the derivative of the cosine function \(g(x) = a\cos(bx)\) is \(g'(x) = -ab\sin(bx)\). (Notice the minus sign here!)

  • The derivative of the natural logarithm function \(f(x) = a\ln(bx)\) is \(f'(x) = \dfrac{a}{x}\).

So if there is a constant inside the argument of the function, you should multiply by that constant when you differentiate.

Examples

Here’s some examples of differentiation in action.

Example 1

Find the derivative of the function \(f(x) = \dfrac{x^2}{2} + 1\).

Here, you can use the sum and scaling rules to differentiate this function. Using the sum rule, you can see that \[\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{x^2}{2} + 1\right) = \dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{x^2}{2}\right) + \dfrac{\mathrm{d}}{\mathrm{d}x}\left(1\right)\] Now, using the scaling rule on the first of these terms, you can get \[\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{x^2}{2}\right) + \dfrac{\mathrm{d}}{\mathrm{d}x}\left(1\right) = \frac{1}{2}\cdot\dfrac{\mathrm{d}}{\mathrm{d}x}\left(x^2\right) + \dfrac{\mathrm{d}}{\mathrm{d}x}\left(1\right)\]

Now you can use the derivatives of common functions. The function \(x^2\) is of the form \(x^n\), so the derivative of \(x^2\) is \(2x^{2-1} = 2x^1 = 2x\). The function \(1\) is a constant, so the derivative of \(1\) is \(0\). Putting these results in gives \[\frac{1}{2}\cdot\dfrac{\mathrm{d}}{\mathrm{d}x}\left(x^2\right) + \dfrac{\mathrm{d}}{\mathrm{d}x}\left(1\right) = \frac{1}{2}(2x) + 0\] Simplifying gives the answer: \(\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{x^2}{2} + 1\right) = x\) and so the derivative of \(f(x) = x^2/2 + 1\) is equal to \(f'(x) = x\).

You can then say that this function \(f(x) = x^2/2 + 1\) is increasing if \(x > 0\), decreasing if \(x < 0\), and is stationary exactly when \(x = 0\).

You do not need to be so meticulous in your general practice when differentiating. You can differentiate functions without stating what rules you are using.

Example 2

Find the derivative of the function \(f(x) = 4e^{3x} - \sqrt{x}\).

Of these two terms, \(4e^{3x}\) looks like a common function, but you have not seen how to differentiate \(\sqrt{x}\) yet. In fact, this is another case of \(x^n\); in this case, \(n = 1/2\). (See Guide: Laws of indices for why this is.)

You can then rewrite the function as \[f(x) = 4e^{3x} - x^{1/2}\] which you can then apply your knowledge of differentiation to. Using the results above, the derivative of \(4e^{3x}\) is \(4\cdot3\cdot e^{3x} = 12e^{3x}\). The derivative of \(x^{1/2}\) is \(\left(\dfrac{1}{2}\right)x^{1/2 - 1} = \dfrac{x^{-1/2}}{2}\). Therefore, the derivative of \(4e^{3x} - \sqrt{x}\) is \[f'(x) = 12e^{3x} - \frac{x^{-1/2}}{2}\]

You could turn \(x^{-1/2}\) into \(1/\sqrt{x}\); however, you may be asked to differentiate this function again (particularly if you are looking into behaviour of a function), and often it is best to leave the power as a real number rather than using the square root notation.

As a rule of thumb, you should always write an \(n\)th root using a fractional power instead. Here’s another example of where you should write a term involving a power of \(x\):

Example 3

Find the derivative of the function \(f(x) = \dfrac{1}{x^4} + 4\cos(x) - \sin(4x)\).

Again, the cosine and sine terms are manageable from the derivative above, it is only the \(1/x^4\) term that needs a little thought. In fact, this is yet another case of \(x^n\); this time when \(n = - 4\). (See Guide: Laws of indices for why this is.)

You can then rewrite the function as \[f(x) = x^{-4} + 4\sin(x) - \cos(4x)\] and use the familiar rules of differentiation above. Using the results above with \(n = -4\), the derivative of \(x^{-4}\) is \(-4x^{-4-1} = -4x^{-5}\). The derivative of \(4\sin(x)\) is \(4(\cos(x)) = 4\cos(x)\). The derivative of \(\cos(4x)\) is \(-4\sin(4x)\). Taking care of your signs you can write the derivative of \(\dfrac{1}{x^4} + 4\cos(x) - \sin(4x)\) as \[f'(x) = -4x^{-5} + 4\cos(x) - (-4\sin(4x)) = -4x^{-5} + 4\cos(x) + 4\sin(4x).\]

Example 4

Determine the behaviour of the function \(f(x) = 2\ln(3x) - x\) when \(x = 1\).

Here, you will first need to differentiate the function \(f(x)\) to find \(f'(x)\). Then, you will need to evaluate the derivative \(f'(x)\) when \(x = 1\) to see how the function behaves.

Using your rules of differentiation as you found above, you can say that the derivative of \(2\ln(3x)\) is \(2/x\), and the derivative of \(x\) is \(1\). Therefore, the derivative of the function \(f(x) = 2\ln(3x) - x\) is \[f'(x) = \frac{2}{x} - 1.\] You can evaluate the derivative \(f'(x)\) at \(x = 1\) to get \[f'(1) = \frac{2}{1} - 1 = 2 - 1 = 1\] and so the derivative is positive at \(x = 1\). This implies that the function \(f(x) = 2\ln(3x) - x\) is increasing at the point \(x = 1\).

It also means that the gradient of the tangent to the function \(f(x)\) at the point \((1,2\ln(3) - 1)\) is \(1\). You can see this in the figure below.

 

Summary

Here’s a table of derivatives that you should remember going into any further reading on differentiation. Here, \(a,b,c,n\) are any real numbers.

Function \(f(x)\) Derivative \(f'(x)\) Notes
\(f(x) = c\) \(f'(x) = 0\)
\(f(x) = ax + b\) \(f'(x) = a\)
\(f(x) = ax^n\) \(f'(x) = anx^{n-1}\) \(n \neq 0\)
\(f(x) = ae^{bx}\) \(f'(x) = abe^{bx}\)
\(f(x) = a\sin(bx)\) \(f'(x) = ab\cos(bx)\)
\(f(x) = a\cos(bx)\) \(f'(x) = -ab\sin(bx)\)
\(f(x) = a\ln(bx)\) \(f'(x) = \dfrac{a}{x}\)

Quick check problems

  1. Answer the following questions true or false:
  1. The derivative of a function at \(x = a\) is equal to the gradient of the tangent to \(f(x)\) at \(x = a\). Answer: .

  2. If \(f'(a) < 0\), then the function is increasing at \(x = a\). Answer: .

  3. If \(f(x) = c\), then the derivative \(f'(x) = c-1\). Answer: .

  4. The derivative of \(f(x) = \cos(x)\) is \(f'(x) = -\sin(x)\). Answer: .

  5. The derivative of \(f(x) = \dfrac{1}{x}\) is \(f'(x) = \ln(x)\). Answer: .

  6. The power of \(x\) in the derivative of \(f(x) = \dfrac{1}{\sqrt{x}}\) is \(-3/2\). Answer: .

  1. Fill in the gaps of the statements below.
  1. If \(f(x) = 3x^7 - 14x\), then \(f'(x) =\) \(x^6 -\) .

  2. If \(f(x) = -4\cos(3x)\), then \(f'(x) =\) \(\sin\big(\) \(\big)\).

  3. If \(f(x) = -15\sin(x) + e^{8x}\), then \(f'(x) =\) \(\cos\big(\) \(\big) +\) \(e^{8x}\).

Further reading

For more questions on the subject, please go to Questions: Introduction to differentiation and the derivative.

For more about techniques of differentiation, please see [Guide: The product rule], [Guide: The quotient rule], and [Guide: The chain rule].

For more about where the derivatives in the above table come from, please see Proof sheet: Derivatives of functions from first principles and [Proof sheet: Derivatives of other common functions]. For more about why the rules of differentiation are true, please see [Proof sheet: Rules of differentiation].

Version history

v1.0: initial version created 03/25 by tdhc.

This work is licensed under CC BY-NC-SA 4.0.

Feedback

Your feedback is appreciated and useful. Feel free to leave a comment here.