Kilcullen Science and Engineering

Kilcullen Science and Engineering - Exploring Science, Engineering, and Technology

Saturday, March 07, 2026

How to Understand Calculus: Integration Rules and Examples

Title diagram showing the concepts of calculus
© Eugene Brennan

What Is Calculus?

Calculus is a study of rates of change of functions and accumulation of infinitesimally small quantities. It can be broadly divided into two branches:

  • Differential Calculus: This concerns rates of changes of quantities and slopes of curves or surfaces in 2D or multidimensional space.
  • Integral Calculus: This involves summing infinitesimally small quantities.

What's Covered in This Tutorial

In the previous tutorial, we learned about differential calculus. In this second part of a two-part tutorial, we cover:

  1. Concept of integration
  2. Definition of indefinite and definite integrals
  3. Integrals of common functions
  4. Rules of integrals and worked examples
  5. Applications of integral calculus, volumes of solids, real world examples

If you find this tutorial useful, please show your appreciation by sharing on Facebook or Pinterest.

Integration Is a Summing Process

Differentiation is a way of working out the rate of change of functions. Integration in a sense is the opposite of that process. It is a summing process used to add up infinitesimally small quantities.

What Is Integral Calculus Used For?

Integration is a summing process, and as a mathematical tool it can be used for:

  • evaluating the area under functions of one variable
  • working out the area and volume under functions of two variables or summing multidimensional functions
  • calculating the surface area and volume of 3D solids

In science, engineering, economics etc, real world quantities such as temperature, pressure, magnetic field strength, illumination, speed, flow rate, share values etc can be described by mathematical functions. Integration allows us to integrate these variables to arrive at a cumulative result.

Area Under a Graph of a Constant Function

Imagine we have a graph showing the velocity of a car versus time. The car travels at a constant velocity of 50 mph, so the plot is just a horizontal straight line.

Graph of vehicle's velocity versus time
© Eugene Brennan

The equation for distance travelled is:

Distance travelled = velocity x time

So in order to calculate distance travelled at any point in the journey, we multiply the height of the graph (the velocity) by the width (time) and this is just the rectangular area under the graph of velocity. We are integrating velocity to calculate distance. The resulting graph we produce for distance versus time is a straight line.

So if the car's velocity is 50 mph, then it travels

50 miles after 1 hour

100 miles after 2 hours

150 miles after 3 hours

200 miles after 4 hours and so on.

Note that an interval of 1 hour is arbitrary, we can choose it to be anything we want.

Graph of vehicle's speed versus time and calculation of distance travelled
If we take an arbitrary interval of 1 hour, the car travels an additional 50 miles each hour. © Eugene Brennan

If we draw a graph of distance travelled versus time, we see how the distance increases with time. The graph is a straight line.

Graph of vehicle's distance  travelled versus time
© Eugene Brennan

Area Under a Graph of a Linear Function

Now let's make things a little bit more complicated!
This time we'll use the example of filling a water tank from a pipe.

Initially there is no water in the tank and no flow into it, but over a period of minutes, the flow rate increases continuously.

The increase in flow is linear which means that the relationship between flow rate in gallons per minute and time is a straight line.

Annotated diagram of a tank filling with water
A tank filling with water. Water volume increases and is the integral of flow rate into the tank. © Eugene Brennan

We use a stopwatch to check elapsed time and record the flow rate every minute. (Again this is arbitrary).

After 1 minute, flow has increased to 5 gallons per minute.

After 2 minutes, flow has increased to 10 gallons per minute.

and so on.....

Graph of flow rate versus time for a tank
Plot of water flow rate versus time. © Eugene Brennan

Flow rate is in gallons per minute (gpm) and volume in the tank is in gallons.

The equation for volume is simply:

Volume = average flow rate x time

Unlike the example of the car, to work out the volume in the tank after 3 minutes, we can't just multiply the flow rate (15 gpm) by 3 minutes because the rate was not at this rate for the full 3 minutes. Instead we multiply by the average flow rate which is 15/2 = 7.5 gpm.

So volume = average flow rate x time = (15/2) x 3 = 2.5 gallons

In the graph below, this just turns out to be the area of the triangle ABC.

Just like the car example, we are calculating the area under the graph.

raph of flow rate versus time for a tank
Water volume can be calculated by integrating the flow rate. © Eugene Brennan

If we record the flow rate at intervals of 1 minute and work out the volume, the increase in water volume in the tank is an exponential curve.

Graph of volume of water accumulated in a tank versus time
Plot of water volume. Volume is the integral of flow rate into the tank. © Eugene Brennan

Now consider a case where the flow rate into the tank is variable and non-linear. Again we measure the flow rate at regular intervals. Just like before, the volume of water is the area under the curve. We can't use a single rectangle or triangle to calculate area, but we can try to estimate it by dividing it up into rectangles of width Δt, calculating the area of those and summing the result.

However there will be errors and the area will be underestimated or over estimated depending on whether the graph is increasing or decreasing.

Graph showing the calculation of volume using numerical integration or trapezoidal approximation
We can get an estimate of area under the curve by summing a series of rectangles. © Eugene Brennan

Using Numerical Integration to Find the Area Under a Curve

We can improve accuracy by making the intervals Δt shorter and shorter.

We are in effect using a form of numerical integration to estimate the area under the curve by adding together the area of a series of rectangles.

Graph showing the calculation of volume using numerical integration or trapezoidal approximation
As the number of rectangles increases, the errors get smaller and accuracy improves. © Eugene Brennan

 

Animation showing the calculation of volume using numerical integration or trapezoidal approximation
As the number of rectangles gets bigger and their width gets smaller, the errors get smaller and the result more closely approximates the area under the curve. 09glasgow09, CC BY SA 3.0 via Wikimedia Commons

Now consider a general function y = f (x).

We are going to specify an expression for the total area under the curve over a domain [a,b] by summing a series of rectangles. In the limit, the width of the rectangles will become infinitesimally small and approach 0. The errors will also become 0.

  • The result is called the definite integral of f (x) over the domain [a,b].
  • The ∫ symbol means "the integral of" and the function f (x) is being integrated.
  • f (x) is called an integrand.

The sum is called a Riemann Sum. The one we use below is called a right Reimann sum. dx is an infinitesimally small width. Roughly speaking, this can be thought of as the value Δx becomes as it approaches 0. The Σ symbol means that all the products f (xi)xi (the area of each rectangle) are being summed from i = 1 to i = n and as Δx → 0, n → ∞.

Graph showing the calculation of volume using numerical integration or trapezoidal approximation
A generalised function f(x). Rectangles can be used to approximate the area under the curve. © Eugene Brennan

Rieman sum formula

The Difference Between Definite and Indefinite Integrals

Analytically we can find the anti-derivative or indefinite integral of a function f (x).
This function has no limits.
If we specify an upper and lower limit, the integral is called a definite integral.

Using Indefinite Integrals to Evaluate Definite Integrals

If we have a set of data points, we can use numerical integration as described above to work out the area under curves. Although it wasn't called integration, this process has been used for thousands of years to calculate area and computers have made it easier to do the arithmetic when thousands of data points are involved.
However if we know the function f (x) in equation form (e.g. f (x) = 5x2 + 6x +2) , then firstly knowing the anti-derivative (also called the indefinite integral) of common functions and also using rules of integration, we can analytically work out an expression for the indefinite integral.

The fundamental theorem of calculus then tells us that we can work out the definite integral of a function f(x) over an interval using one of its anti-derivatives F(x). Later we will discover that there are an infinite number of anti-derivatives of a function f (x).

Indefinite Integrals and Constants of Integration

The table below shows some common functions and their indefinite integrals or anti-derivatives. C is a constant. There are an infinite number of indefinite integrals for each function because C can have any value.

Why is this?

Consider the function f (x) = x3

We know the derivative of this is 3x2

What about x3 + 5 ?

d/dx ( x3 + 5 ) = d/dx (x3) + d/dx(5) = 3x2 + 0 = 3x2 ....... the derivative of a constant is 0

So the derivative of x3 is the same as the derivative of x3 + 5 and = 3x2

What's the derivative of x3 + 3.2 ?

Again d/dx ( x3 + 3.2 ) = d/dx (x3) + d/dx(3.2) = 3x2 + 0 = 3x2

No matter what constant is added to x3, the derivative is the same.

Graphically we can see that if functions have a constant added, they are vertical translations of each other, so since the derivative is the slope of a function, this works out the same no matter what constant is added.

Since integration is the opposite of differentiation, when we integrate a function, we must add on a constant of integration to the indefinite integral

So e.g. d/dx( x3) = 3x2

and ∫ 3x2 dx = x3 + C

Graph showing constants of integration
Slope field of a function x^3/3 - x^2/2 - x + c, showing three of the infinite number of functions that can be produced by varying the constant c. The derivative of all the functions is the same. pbroks13talk, public domain image via Wikimedia Commons

Indefinite Integrals of Common Functions

Indefinite Integrals of Common Functions
Function Type Function Indefinite Integral
Constant ∫ a dx ax + C
Variable ∫ x dx x² / 2 + C
Reciprocal ∫ 1/x dx ln x + C
Square ∫ x² dx x³ / 3 + C
Trigonometric Functions ∫ sin(x) dx - cos(x) + C

∫ cos(x) dx sin(x) + C

∫ sec²(x) dx tan(x) + C
Exponential Functions ∫ eˣ dx eˣ + C

∫ aˣ dx (aˣ) / ln(a) + C

∫ ln(x) dx x ln(x) - x + C

In the table below, u and v are functions of x.

u ' is the derivative of u wrt x.

v ' is the derivative of v wrt x.

Rules of Integration

Rules of Integration
Rule Function Integral
Multiplication by a constant rule ∫ au dx a ∫ u dx
Sum rule ∫ (u + v) dx ∫ u dx + ∫ v dx
Difference rule ∫ (u - v) dx ∫ u dx - ∫ v dx
Power rule (n ≠ -1) ∫ xⁿ dx x⁽ⁿ⁺¹⁾ / (n + 1) + C
Reverse chain rule / Substitution ∫ f(u) u' dx ∫ f(u) du + C — Replace u'(x)dx by du, integrate with respect to u, then substitute back u in terms of x in the evaluated integral.
Integration by parts ∫ u v' dx u v - ∫ u' v dx

Examples of Working Out Integrals

Example 1:

Evaluate ∫ 7 dx

∫ 7 dx =

7 ∫ dx ..........multiplication by a constant rule

= 7x + C

Example 2:

What is ∫ 5x4 dx

5x4 dx = 5 x4 dx ....... using multiplication by a constant rule

= 5(x5/5) + C .......... using power rule

= x5 + C

Example 3:

Evaluate ∫ (2x3 + 6cos(x) ) dx

∫ (2x3 + 6cos(x) ) dx = ∫ 2x3 dx + ∫ 6cos(x) dx .....using the sum rule

= 2 ∫ x3 dx + 6 ∫ cos(x) dx ..........using the multiplication by a constant rule

= 2(x4/4) + C1 + 6(sin(x) + C2 .....using the power rule. C1 and C2 are constants.

C1 and C2 can be replaced by a single constant C, so:

∫ (2x3 + cos(x) ) dx = x4/2 + 6sin(x) + C

Example 4:

Work out ∫ sin2(x)cos(x) dx

  • We can do this using the reverse chain rule ∫ f(u) u'(x) dx = ∫ f(u) du where u is a function of x
  • We use this when we have an integral of a product of a function of a function and its derivative

sin2(x) = (sin x) 2

Our function of x is sin x so replace sin(x) by u giving us:

u = sin(x)

u' = cos(x)

sin2(x) = f(u) = u2

Replace cos(x)dx by du

So ∫ sin2(x)cos(x) dx = ∫ u2du = u3/3 + C

Substitute u = sin(x) back into the result:

u3/3 + C = sin3(x)/3 + c

So ∫ sin2(x)cos(x) dx = sin3(x)/3 + c

Example 5:

Evaluate ∫ xex^2 dx

It looks as though we could use the reverse chain rule for this example because 2x is the derivative of the exponent of e which is x2. However we need to adjust the form of the integral first.
So write ∫ xex^2 dx as 1/2 x ∫ 2xex^2 dx = 1/2 ∫ ex^2 (2x) dx

No we have the integral in the form ∫ f(u) u' dx where u = x2 and du = 2xdx

Substituting for x2 and 2x dx:

1/2 ∫ ex^2 (2x) dx = 1/2 ∫ eu u' dx = 1/2 ∫ eu du

but the integral of the exponential function eu is itself, so:

1/2 ∫ eu du = 1/2 eu

Substitute for u giving

1/2 eu = 1/2 ex^2

Example 6:

Evaluate ∫ 6/(5x + 3) dx

  • For this, we can use the reverse chain rule again.
  • We know that 5 is the derivative of 5x + 3.

Rewrite the integral so that 5 is within the integral symbol and in a format that we can use the reverse chain rule:

∫ 6/(5x + 3) dx = ∫ (6/5) 5/(5x + 3) dx = 6/5 ∫ 1/(5x + 3) 5 dx

Again we have our reverse chain rule ∫ f(u) u' dx = ∫ f(u) du

Let u = 5x + 3

u' = 5 and du = 5dx

Plug these into the integral:

6/5∫ 1/(5x + 3)5dx = 6/5∫ (1/u) du

But ∫ (1/u) du = ln(u) + C

So substituting back 5x + 3 for u gives:

∫ 6/(5x + 3) dx = 6/5∫ (1/u) du = 6/5ln(u) + C = 1.2ln(5x + 3) + C

References

Stroud, K.A., (1970) Engineering Mathematics (3rd ed., 1987) Macmillan Education Ltd., London, England.

This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

© 2019 Eugene Brennan

Thursday, March 05, 2026

What Is Calculus? A Beginner's Guide to Limits and Differentiation

Title image diagram showing the meaning of derivatives and integrals
 © Eugene Brennan

Calculus is a study of rates of change of functions and accumulation of infinitesimally small quantities. It can be broadly divided into two branches:

  • Differential Calculus. This concerns rates of changes of quantities and slopes of curves or surfaces in 2D or multidimensional space.
  • Integral Calculus. This involves summing infinitesimally small quantities.

 

What's Covered in This Tutorial

In this tutorial, you will learn about:

  • Limits of a function
  • How the derivative of a function is derived
  • Rules of differentiation
  • Derivatives of common functions
  • What the derivative of a function means
  • Working out derivatives from first principles
  • 2nd and higher order derivatives
  • Applications of differential calculus
  • Worked examples

 

Who Invented Calculus?

Calculus was invented by the English mathematician, physicist and astronomer Isaac Newton and German mathematician Gottfried Wilhelm Leibniz independently of each other in the 17th century.

Isaac Newton (1642 - 1726)
Isaac Newton (1642 - 1726) and Gottfried Wilhelm Leibniz (below) invented calculus independent of each other in the 17th century.  Image from Pixabay.
Gottfried Wilhelm von Leibniz (1646 - 1716)
Gottfried Wilhelm von Leibniz (1646 - 1716), a German philosopher and mathematician. Public domain image via Wikimedia Commons.

What Is Calculus Used For?

Calculus is used widely in mathematics, science, in the various fields of engineering and economics.

Introduction to Limits of Functions

To understand calculus, we first need to grasp the concept of limits of a function.

Imagine we have a continuous line function with the equation f(x) = x + 1 as in the graph below.

The value of f(x) is simply the value of the x coordinate plus 1.

Graph of the function f(x) = x + 1
© Eugene Brennan

The function is continuous which means that f(x) has a value that corresponds to all values of x, not just the integers ....-2, -1, 0, 1, 2, 3.... and so on, but all the intervening real numbers. I.e. decimal numbers like 7.23452, and irrational numbers like π, and √3.

So if x = 0, f(x) = 1

if x = 2, f(x) = 3

if x = 2.3, f(x) = 3.3

if x = 3.1, f(x) = 4.1 and so on.

Let's concentrate on the value x =3, f(x) = 4.

As x gets closer and closer to 3, f(x) gets closer and closer to 4.

So we could make x = 2.999999 and f(x) would be 3.999999.

We can make f(x) as close to 4 as we want. In fact we can choose any arbitrarily small difference between f(x) and 4 and there will be a correspondingly small difference between x and 3. But there will always be a smaller distance between x and 3 that produces a value of f(x) closer to 4.

So What's the Limit of a Function Then?

Referring to the graph again, the limit of f(x) at x = 3 is the value f(x) approaches as x gets closer to 3. Not the value of f(x) at x=3, but the value it approaches. As we'll see later, the value of a function f(x) may not exist at a certain value of x, or it may be undefined.

Mathematical depiction of the limit of a function.
This is expressed as, "The limit of f(x) as x approaches c, equals L".

Formal Definition of a Limit

The (ε, δ) Cauchy Definition of a Limit

The formal definition of a limit was specified by the mathematicians Augustin-Louis Cauchy and Karl Weierstrass

Let f(x) be a function defined on a subset D of the real numbers R.

c is a point of the set D. ( The value of f(x) at x = c may not necessarily exist)

L is a real number.

Then:

lim f(x) = L
x → c

exists if:

  • Firstly for every arbritarily small distance ε > 0 there exists a value δ such that, for all x belonging to D and 0 > | x - c | < δ, then | f(x) - L | < ε
  • and secondly the limit approaching from the left and right of the x coordinate of interest must be equal.

In plain English, this says that the limit of f(x) as x approaches c is L, if for every ε greater than 0, there exists a value δ, such that values of x within a range of c ± δ (excluding c itself, c + δ and c - δ) produces a value of f(x) within L± ε.

....in other words we can make f(x) as close to L as we want by making x sufficiently close to c.

This definition is known as a deleted limit because the limit omits the point x = c.

Definition of a limit
Limit of a function. 0 > |x - c| then 0 > | f(x) - L | < ϵ. © Eugene Brennan

Continuous and Discontinuous Functions

A function is continuous at a point x = c on the real line if it is defined at c and the limit equals the value of f(x) at x = c. I.e:

lim f(x) = L = f(c)
x → c

A continuous function f(x) is a function that is continuous at every point over a specified interval.

Examples of continuous functions:

  • Temperature in a room versus time.
  • The speed of a car as it changes over time.

A function that is not continuous, is said to be discontinuous. Examples of discontinuous functions are:

  • Your bank balance. It changes instantly as you lodge or withdraw money.
  • A digital signal, it's either 1 or 0 and never in between these values.
Graph of sin(x)/x
The function f(x) = sin (x) / x or sinc (x). The limit of f(x) as x approaches 0 from both sides is 1. The value of sinc (x) at x = 0 is undefined because we can't divide by zero and sinc (x) is discontinuous at this point. © Eugene Brennan

 

Limits of Common Functions

Common functions and their limits
FunctionLimit
1/x as x tends to infinity0
a/(a + x) as x tends to 0a
sin x/x as x tends to 01

Calculating the Velocity of a Vehicle

Imagine we record the distance a car travels over a period of one hour. Next we plot all the points and join the dots, drawing a graph of the results (as shown below). On the horizontal axis, we have the time in minutes and on the vertical axis we have the distance in miles. Time is the independent variable and distance is the dependent variable. In other words, the distance travelled by the car depends on the time which has passed.

Graph of distance versus time for a vehicle
Graph of distance travelled by a vehicle at constant speed is a straight line. © Eugene Brennan

If the car travels at a constant velocity, the graph will be a line, and we can easily work out its velocity by calculating the slope or gradient of the graph. To do this in the simple case where the line passes through the origin, we divide the ordinate (vertical distance from a point on the line to the origin) by the abscissa (horizontal distance from a point on the line to the origin).

So if it travels 25 miles in 30 minutes,

Velocity = 25 miles/30 minutes = 25 miles / 0.5 hour = 50 mph

Similarly if we take the point at which it has travelled 50 miles, the time is 60 minutes, so:

Velocity is 50 miles/60 minutes = 50 miles / 1 hour = 50 mph

Note: In physics we normally speak of the "velocity" of a body. Technically, the definition of velocity is speed in a given direction, so it is a vector quantity. Speed is the magnitude of the velocity vector.

Average Velocity and Instantaneous Velocity

Ok, so this is all fine if the vehicle is travelling at a steady velocity. We just divide distance by time taken to get velocity. But this is the average velocity over the 50 mile journey. Imagine if the vehicle was speeding up and slowing down as in the graph below. Dividing distance by time still gives the average velocity over the journey, but not the instantaneous velocity which changes continuously. In the new graph below, the vehicle accelerates mid way through the journey and travels a much greater distance in a short period of time before slowing down again. Over this period, its velocity is much higher.

Graph of distance versus time for a vehicle with variable speed
Graph of a vehicle travelling at a variable speed. © Eugene Brennan

In the graph below, if we denote the small distance travelled by Δs and the time taken as Δt, again we can calculate velocity over this distance by working out the slope of this section of the graph.

So average velocity over interval Δt = slope of graph = Δs/Δt

Note: The Greek letter "Δ" pronounced "delta" is often used in mathematics to represent a small quantity.

Graph showing how speed is calculated
Approximate speed over a short range can be determined from slope. The average speed over the interval Δt is Δs/Δt. © Eugene Brennan

However the problem is that this still only gives us an average. It's more accurate than working out velocity over the full hour, but it's still not the instantaneous velocity. The car travels faster at the start of the interval Δt (we know this because distance changes more rapidly and the graph is steeper). Then the velocity starts to decrease midway and reduces all the way to the end of the interval Δt.

What we're aiming to do is find a way of determining the instantaneous velocity.
We can do this by making Δs and Δt smaller and smaller so we can work out the instantaneous velocity at any point on the graph.

See where this is heading? We're going to use the concept of limits we learned about before.

What Is Differential Calculus?

Differential calculus is one of the two branches of calculus which also includes integral calculus. It is a study of the rate at which quantities change.

In the example above we saw how we could attempt to determine a more accurate measurement of velocity by working out the slope of a graph over a shorter interval. We can do this using limits.

Slope of a graph

In the graph below we have a generalised function y = f (x).

x is a point on the horizontal axis and Δx is a small change in x.

The value of the function at x is f (x)

As x changes to x + Δx , f (x) changes by Δy to f (x + Δx)

You may remember from coordinate geometry if we know two points on a graph: (x1, y1) and (x2, y2), the slope of a line joining the two points is:

(y2 - y1) / ( x2 - x1)

So the slope of this line is ( f (x + Δx) - f (x) ) / (x + Δx - x) = Δy / Δx

The slope Δy / Δx is approximately the slope of a tangent to the graph for small Δx.

Over a short distance, the slope of the secant (red line) is approximately the rate of change of the function. © Eugene Brennan
Graph showing the slope of a graph
Approximate slope of a function for small increments of x and f(x)

What Happens When ΔX Becomes Smaller and Smaller?

The red line that intersects the graph at two points in the diagram above is called a secant.

If we now make Δx and Δy smaller and smaller, the red line eventually becomes a tangent to the curve. The slope of the tangent is the instantaneous rate of change of f (x) at the point x.

Derivative of a Function

If we take the limit of the value of the slope as Δx tends to zero, the result is called the derivative of y = f (x).

lim (Δy / Δx) =
Δx → 0

= lim ( f (x + Δx) - f (x) ) / (x + Δx - x)
Δx → 0

The value of this limit is denoted as dy/dx.

Since y is a function of x, i.e. y = f(x), the derivative dy/dx can also be denoted as f '(x) or just f ' and is also a function of x. I.e. it varies as x changes.

If the independent variable is time, the derivative is sometimes denoted by the variable with a dot superimposed on top.

E.g. if a variable x represents position and x is a function of time. I.e. x(t)

Derivative of x wrt t is dx/dt or ( or dx/dt is speed, the rate of change of position)

We can also denote the derivative of f (x) wrt x as d/dx(f (x))

Animation showing the slope of  graph becomes the derivative
As Δx and Δy tend to zero, the slope of the secant approaches the slope of the tangent. © Eugene Brennan, created in GeoGebra.

Differentiating Functions From First Principles

To find the derivative of a function, we differentiate it wrt to the independent variable. There are several identities and rules to make this easier, but first let's try to work out an example from first principles.

Equation showing how a limit becomes a derivative
Slope over an interval Δx. The limit is the derivative of the function.

Example: Evaluate the derivative of x2

So f (x) = x2

f (x + Δx) = (x + Δx)2

d/dx( f (x)) =

lim ( f (x + Δx) - f (x) ) / ((x + Δx) - x)
Δx → 0

Substitute for f (x + Δx) and f (x) giving

lim ( (x + Δx)2 - x2 ) / Δx)
Δx → 0

Expand out (x + Δx)2 giving

lim ( (x2 + 2xΔx + Δx2- x2 ) / Δx)
Δx → 0

The two x2 cancel out which gives:

lim ( (2xΔx + Δx2 ) / Δx)
Δx → 0

Dividing by Δx gives:

lim (2x + Δx )
Δx → 0

= 2x

Using Rules to Work out Derivatives

Rather than working out the derivatives of functions from first principles, we normally use a set of rules to make things easier.

In the table below, f and g are two functions.

f ' is the derivative of f

g' is the derivative of g

Rules of Differentiation

Rules of differentiation
Rule TypeFunctionDerivative

Constant factor rule

af

af '

Power rule for polynomials

xᵇ

bxᵇ ⁻ ¹

Sum rule

f + g

f ' + g '

Difference rule

f - g

f ' - g '

Product rule

fg

fg ' + gf '

Reciprocal of a function

1/f

- f ' / f ^2

Quotient rule

f / g

(f 'g - g ' f )/ g ^2

Chain rule (function of a function rule)

f(g) where g is a function of x

f ' (g) g ' (x)

Derivatives of Common Functions

Derivatives of comon functions
Function TypeFunctionDerivative

Constant

c

0

Line

mx

m

Line with y axis intercept

mx + c

m

x squared

x ^ 2

2x

x cubed

x ^ 3

3x^2

Square root

x ^ (1/2)

(1/2) x ^ (-1/2)

Reciprocal

1/x

-1/x^2

Exponential function

e^x

e^x

Natural log

ln (x)

1/x

Trigonometric function

sin (x)

cos (x)

Trigonometric function

cos (x)

- sin (x)

Trigonometric function

tan (x)

1 + (tan (x))^2 = (cosec (x))^2

Examples of Working Out Derivatives

Example 1:

What is the derivative of 20?

Derivative of a constant is 0, so d/dx(20) = 0

Example 2:

What is the derivative of 3x?

Using the constant factor rule (multiplication by a constant rule)

d/dx(3x) = 3( d/dx(x) )

But using the power rule the derivative of x1 = 1x0 = 1

So d/dx(3x) = 3( d/dx(x) ) = 3(1) = 3

Example 3:

What is the derivative of 6x3

Using the multiplication by a constant rule, d/dx(6x3) = 6 ( d/dx(x3) )

From the power rule, d/dx(x3) = 3x2

So d/dx(6x3) = 6 ( d/dx(x3) ) = 6 (3x2) = 18x2

Example 4:

Evaluate the derivative of 5sin (x) + 6x5

We use the sum rule to find the derivatives of 5sin (x) and 6x5 and then add the result together.

So d/dx (5sin (x)) = 5d/dx(sin (x)) = 5cos (x)

d/dx(6x5) = 6d/dx(x5) = 6(5x4) = 30x4

Adding the results together

d/dx (5sin (x) + 6x5) = 5cos (x) + 30x4

Example 5:

What is the derivative of x3sin (x) ?

Use the product rule, so:

d/dx(x3sin (x)) = x3d/dx(sin(x)) + sin(x)d/dx(x3)

d/dx (sin(x)) = cos(x)

d/dx(x3) = 3x2 (from the power rule)

so d/dx(x3sin (x)) = x3d/dx(sin(x)) + sin(x)d/dx(x3) = x3cos(x) + 3x2sin(x)

Example 6:

Evaluate the derivative of tan (x)

tan (x) = sin (x) / cos (x)

We can use the quotient rule to work this out:

d/dx (f(x)/g(x)) = (f '(x)g(x) - g '(x)f (x))/ g(x)2

so d/dx(sin (x) / cos (x)) = (d/dx(sin (x))cos (x) - d/dx(cos (x))sin (x)) / cos2 (x)

d/dx(sin (x)) = cos (x)

d/dx(cos (x)) = - sin x

Substituting

(d/dx(sin (x))cos (x) - d/dx(cos (x))sin (x)) / cos2(x)

= (cos (x)cos (x) - (-sin (x))sin (x)) / cos2(x)

= (cos2(x) + sin2(x)) / cos2(x)

= 1 + tan2(x) = sec2(x)

Example 7:

What is the derivative of ln(5x3) ?

We use the chain rule to work this out.

For two functions f(g) and g(x)

df/dx = (df/dg)(dg/dx)

Let g(x) = 5x3

and f(g) = ln(g)

df/dg = 1/g

dg/dx = 5(3x2) = 15x2

df/dx = (df/dg)(dg/dx)

= (1/g)(15x2)

Substituting for g:

= 1/(5x3)((15x2) = 3/x

We could also have evaluated the derivative by first using the rules of logarithms to simplify the expression.

So ln(5x3) = ln(5) + ln(x3) = ln(5) + 3ln(x) ............(product rule and power rule)

d/dx (ln(5) + 3ln(x)) = d/dx (ln(5)) + d/dx(3ln(x)) = 0 + 3d/dx(ln(x))

= 0 + 3(1/x) = 3/x

Positive and Negative Values of the Derivative

The animation below shows the function sin(Ө) and it's derivative cos(Ө). At Ө = 0, the value of the derivative is cos(Ө) = cos(0) = 1. As Ө increases, the value of cos(Ө) decreases, i.e the slope of the tangent to sin(Ө) becomes smaller. Eventually at Ө = π/2, the slope is zero. This is an important point because as we'll see later, we can use this fact to find the maxima and minima of functions.
As Ө exceeds π/2, the value of the derivative becomes negative.

How come?

Remember the definition of the derivative?

Δx is positive, but the change Δy is negative since f (x +Δx) - f (x) is negative because f (x +Δx) < f (x)......(the function is decreasing in value)

In the limit as Δx and Δy tend to zero, the derivative is also less than zero.

Sin(Ө) and Its Derivative Cos(Ө)

Animation showing the derivative of the function sin(x)
The derivative of sin(Ө) is cos(Ө). Notice how the value of the derivative at Ө = 0 is positive and decreases to 0 at the peak of the waveform when Ө = π/2. Then it becomes negative and reaches zero before becoming positive again. © Eugene Brennan. Created in GeoGebra

2nd and Higher Order Derivatives

What happens if we take the derivative of a derivative?

Consider the function y = f (x)

The derivative of y is f '(x) or dy/dx

The derivative of dy/dx is known as the second derivative or second order derivative and is denoted by d2y/dx2 or f '' (x) ......(f with a double dash). We can have third and higher order derivatives so for instance the third order derivative of y is d3y/dx3

Examples:

(1) If y = sin (x), what is d2y/dx2 ?

dy/dx = cos (x)

d2y/dx2 = d/dx (cos (x)) = -sin (x)

(2) What is the second derivative of ln (x)?

y = ln (x)

So dy/dx = 1/x = x(-1)

d2y/dx2 = d/dx (x(-1)) = -1( x(-2) ) = -1/x2

Since dy/dx is the rate of change of a function, roughly speaking we can think of d2y/dx2 as being the rate at which dy/dx itself is changing.

Returning to the car example:

s(t) is a function describing how distance travelled changes with time.
ds/dt is the rate of change of position, called speed or velocity.
d2s/dt2 is the rate of change of velocity, which is called acceleration.

If v is the velocity of the vehicle and a is its acceleration:

v = ds/dt

a = dv/dt = d/dt(ds/dt) = d2s/dt2

So the second derivative of distance which is acceleration is equal to the first derivative of velocity.

We can go up to the third derivative of s, so:

d3s/dt3 = da/dt is the rate of change of acceleration, known as "jerk".

Stationary and Turning Points of a Function

A stationary point of a function is a point at which the derivative is zero. On a graph of the function, the tangent to the point is horizontal and parallel to the x-axis.

A turning point of a function is a point at which the derivative changes sign. A turning point can be either a local maxima or minima. If a function can be differentiated, a turning point is a stationary point. However the reverse is not true. Not all stationary points are turning points. For instance in the graph of f (x) = x3 below, the derivative f '(x) at x = 0 is zero and so x is a stationary point. However as x approaches 0 from the left, the derivative is positive and decreases to zero, but then increases positively as x becomes positive again. Therefore the derivative doesn't change sign and x is not a turning point.

Graph showing stationary and turning points of a function
Points A and B are stationary points and the derivative f'(x) = 0. They are also turning points because the derivative changes sign. © Eugene Brennan
Example of a function with a stationary point that is not a turning point. The derivative f'(x) at x = 0 is 0, but doesn't change sign. © Eugene Brennan

Inflection Points of a Function

An inflection point of a function is a point on a curve at which the function changes from being concave to convex. At an inflection point, the second order derivative changes sign (i.e it passes through 0. See the graph below for a visualisation).

Graph showing inflexion points of a function
The red circles are stationary points. The blue squares are inflection points. Self CC BY SA 3.0 via Wikimedia Commons
Grpah showing inflexion, stationary and turning points of a function
Explaining stationary, turning points and inflection points and how they relate to the first and second order derivatives. Cmglee, CC BY SA 3.0 unported via Wikimedia Commons

Using the Derivative to Find the Maxima, Minima and Turning Points of Functions

We can use the derivative to find the local maxima and minima of a quadratic function (the points at which the function has local maximum and minimum values) These points are called turning points because the derivative changes sign from positive to negative or vice versa. For a function f (x), we do this by:

  • differentiating f (x) wrt x.
  • equating f ' (x) to 0. I.e. finding the point where the derivative and slope of the graph is zero.
  • and then finding the roots of the equation, i.e. the values of x that make f '(x) = 0.

For higher order functions such as cubics (i.e. when the "x" is cubed), further analysis may be needed as a point where the derivative is equal to zero may be an inflection point where the slope of the graph becomes zero but then increases or decreases again as x changes.

Example 1:

Find the maxima or minima of the quadratic function f (x) = 3x2 + 2x +7 (the graph of a quadratic function is called a parabola).

Graph showing minium point of a function
A quadratic function. © Eugene Brennan

f (x) = 3x2 + 2x +7

and f '(x) = 3(2x1) + 2(1x0) + 0 = 6x + 2

Set f '(x) = 0

6x + 2 = 0

Solve 6x + 2 = 0

Rearranging:

6x = -2

giving x = - 1/3

and f(x) = 3x2 + 2x +7 = 3(-1/3)2 + 2(-1/3) + 7 = 6 2/3

A quadratic function has a maximum when the coefficient of x² < 0 and a minimum when the coefficient > 0. In this case since the coefficient of x² was 3, the graph "opens up" and we have worked out the minimum and it occurs at the point (- 1/3, 6 2/3).

Example 2:

In the diagram below, a looped piece of string of length p is stretched into the shape of a rectangle. The sides of the rectangle are of length a and b. Depending on how the string is arranged, a and b can be varied and different areas of rectangle can be enclosed by the string. What is the maximum area that can be enclosed and what will be the relationship between a and b in this scenario?

Diagram of a rectangular area
Finding the maximum area of a rectangle that can be enclosed by a perimeter of fixed length. © Eugene Brennan

p is the length of the string

The perimeter p = 2a + 2b (the sum of the 4 side lengths)

Call the area y

and y = ab

We need to find an equation for y in terms of one of the sides a or b, so we need to eliminate either of these variables.

Let's try to find b in terms of a:

So p = 2a + 2b

Rearranging:

2b = p - 2a

and:

b = (p - 2a)/2

y = ab

Substituting for b gives:

y = ab = a(p - 2a)/2 = ap/2 - a2 = (p/2)a - a2

Work out the derivative dy/da and set it to 0 (p is a constant):

dy/da = d/da((p/2)a - a2) = p/2 - 2a

Set to 0:

p/2 - 2a = 0

Rearranging:

2a = p/2

so a = p/4

We can use the perimeter equation to work out b, but it's obvious that if a = p/4 the opposite side is p/4, so the two sides together make up half the length of the string which means both of the other sides together are half the length. In other words maximum area occurs when all sides are equal. I.e when the enclosed area is a square.

So area y = (p/4)(p/4) = p2/16

Example 3 (Max Power Transfer Theorem or Jacobi's Law):

The image below shows the simplified electrical schematic of a power supply. All power supplies have an internal resistance (RINT) which limits how much current they can supply to a load (RL). Calculate in terms of RINT the value of RL at which maximum power transfer occurs.

Diagram of Thévenin's theory
The schematic of a power supply connected to a load, showing the supply's equivalent internal resistance Rint. © Eugene Brennan

The current I through the circuit is given by Ohm's Law:

So I = V/(RINT+ RL)

Power = Current squared x resistance

So power dissipated in the load RL is given by the expression:

P = I2RL

Substituting for I:

= (V/(RINT+ RL))2RL

= V2RL/(RINT+ RL)2

Expanding the denominator:

= V2RL/(R2INT + 2RINTRL + R2L)

and dividing above and below by RL gives:

P = V2 / (R2INT / RL + 2RINT + RL)

Rather than finding when this is a maximum, it's easier to find when the denominator is a minimum and this gives us the point at which maximum power transfer occurs, i.e. P is a maximum.

So the denominator is R2INT / RL + 2RINT + RL

Differentiate it wrt RL giving:

d/dRL (R2INT / RL + 2RINT + RL) = -R2INT / R2L + 0 + 1

Set it to 0:

-R2INT / R2L + 0 + 1 = 0

Rearranging:

R2INT / R2L = 1

and solving gives RL = RINT.

So max power transfer occurs when RL = RINT.

This is called the max power transfer theorem.

A Beginner's Guide to Integration

See my other tutorial, which covers integral calculus and applications of integration:

How to Understand Calculus: Integration Rules and Examples 

References

Stroud, K.A., (1970) Engineering Mathematics (3rd ed., 1987) Macmillan Education Ltd., London, England.

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2019 Eugene Brennan

Tuesday, March 03, 2026

What Would Happen if You Fell Down a Hole That Went Through the Centre of the Earth?

Cut-away of Earth with tunnel and a person falling through it
Created by Grok

Well you'd be incinerated as you pass through the hot and molten core! But imagine if the core wasn't there or you had a special suit that protected you from the heat—what would happen then? Would you suddenly stop when you got to Oz?

The scenario is an example of a simple harmonic oscillator—other examples being a swinging pendulum and a weight bobbing up down, suspended from a spring. Both of the latter rely on interchange of energy and its change in form, from kinetic energy due to motion of an object, to stored potential energy. In the example of a weight suspended from a spring, the potential energy is manifested as tension in the spring. Energy in physics is defined as "the ability to do work". "Work" in physics also has a specific meaning: work is done when a force moves a body through a distance. The stored potential energy in a spring can do work, which is how a clock spring can move the hands of the clock.

Simple harmonic oscillators as the name suggests oscillate or move backwards and forwards indefinitely. For an ideal spring-mass system in a vacuum, with a perfect spring and no friction,  the mass will bounce up and down forever, with energy being interchanged as described above. Simple harmonic oscillators have a natural frequency that depends on the magnitude of the mass and the stiffness of the spring (how hard it is to stretch or compress it). In real life, systems are lossy and due to mechanical friction in a spring and drag from air, oscillations eventually die out. Technically this is known as damping. Dampers are actually used as components in your washing machine's drum suspension and also vehicle suspension systems to smooth out oscillations.

Back to the hole in the Earth that goes all the way to Australia—if you jumped in and there was no air in the hole, you would fall and accelerate, your velocity increasing as you drop downwards. In fact, you'd free fall under the influence of gravity, being continually accelerated. This differs from the situation of falling in air, because in that case, you eventually reach a constant velocity—known as terminal velocity—when the downward force of gravity is balanced by the upward drag, resulting in no net acceleration. As you continue to fall closer to the centre of the Earth, your velocity increases until you reach maximum velocity at the centre. Due to inertia however, you overshoot and pass through the centre. However, from now on, there's "less Earth" in front of you and more behind you. So now you're being decelerated and the gravitational force of the Earth is having a braking effect. Your velocity decreases after you pass through the centre, and it keeps decreasing until it falls to zero as you emerge from the hole on the other side, just like the way a ball kicked up into the air pauses momentarily when it reaches the apex of its trajectory. Once your velocity reaches zero, you start to fall back down the hole and the process is repeated as you fall back to where you started from. Without any losses due to friction, you would keep moving from one side of the planet to the other indefinitely, and it works out that the transit time would be 42 minutes. In reality, if such a hole was a civil engineering possibility, which is highly unlikely and it was filled with air, your oscillations back and forth would be damped and you'd eventually settle and float at the centre of the Earth, weightless. 

Tuesday, February 24, 2026

Science Friday Podcast — Jim Lovell Interview

NASA astronaut Jim Lovell in a space suit
NASA astronaut Jim Lovell, photographed in 1969. Image credit: NASA, public domain, via Wikimedia Commons

The late Jim Lovell, commander of the ill-fated Apollo 13 mission talks with Ira Flatow of SF in an interview from 1995.
Apollo 13 was the seventh crewed mission and would have been the third operation to land humans on the Moon. However an explosion in an oxygen tank caused loss of electrical power and cut short the mission. The crew had to slingshot the spacecraft around the Moon to gain enough momentum to get back to Earth. In the interview, Jim explained the details of the event, we hear recordings of radio comms between flight control and the the spacecraft and Commander Lovell answers questions from callers. 

Wednesday, February 18, 2026

Another Few Stats on Poulaphouca Reservoir Water Levels and Volume

Ash tree growing beside a lake
An ash tree growing on a trail beside the Poulaphouca Reservoir. © Eugene Brennan
In the period from 20th to 31st January, the volume of water in the Poulaphouca Reservoir increased by 52 million m³ of water, corresponding to a 2.3 m rise in level. In the same period, discharges from Golden Falls dam totalled 16 million m³. Since the level in the Golden Falls lake didn't change appreciably over those 12 days, and its surface area is much smaller than that of the Poulaphouca lake, the amount of water that flowed into Poulaphouca must have been equal to the increase in volume plus the amount that flowed out — 68 million m³. Over the 12 days, that gives an average inflow rate of 68/12 million or approximately 5.6 million m³/day. That's about 1.6 times the peak daily flow rate through Kilcullen last week. The Poulaphouca lake is fed by two rivers: The River Liffey and Kings River and so that's understandable. Some small streams also add to the water accumulated.
The ash tree above is on a nice section of path along the lake that leads to the car park on the N81, near the turn for Ballymore Eustace .
Stats are available on the ESB hydrometric website here.
 

Tuesday, February 17, 2026

Making a Bit Of Space : Golden Falls Lake Level Has Risen

Water level in Golden Falls Lake
Water level in Golden Falls Lake, Ballymore Eustace. Image courtesy ESB hydrometrics

The Golden Falls lake rose 1.44 m since yesterday. That's a bit of a jump since the downwards trend over the last week or so, and equivalent to approximately 370,000 cubic metres (m³) of water. The Golden Falls lake doesn't really provide a large storage capacity compared to the much larger Poulaphouca Reservoir, which has a surface area of approximately 22.6 square kilometres (km²), 86 times that of the Golden Falls lake. According to Esbarchives.ie, the head of the Golden Falls dam is 17.4 m. If the walls of the 256,000 m² lake were vertical, that would give a storage capacity of about 4.4 million m³ of water. To put that into perspective, if it were empty, it could store only about a day and a quarter's worth of the water that passed through Kilcullen at peak discharge last week. So dropping the level isn't a huge advantage as regards overall storage and I guess the objective is to try and make more "headroom" available in the Poulaphouca Reservoir to cater for extended periods of heavy rain.

Image courtesy ESB hydrometrics.


×

Posts by Category