Equation of a line: The derivation of y = mx + b

We have discussed in context the origin (click here and here) of the linear equation y = ax + b, where a and b are real numbers.  We have also talked about the slope of a line and many of its properties. In this post, we will discuss the generalization of the equation of a line in the coordinate plane based on its slope and y-intercept.

We have learned that to get a slope of a line, we only need two points.  We have also learned that given two points on a line, its slope is described as the rise (difference in the y-coordinates) over the run (difference in x-coordinates).  Therefore, if we have two points with coordinates (x_1,y_1) and (x_2,y_2), the slope m is  defined the formula

m = \displaystyle\frac{y_2 - y_1}{x_2 - x_1}.

All the points on a vertical line have similar x-coordinates; therefore, the run {x_2 - x_1} is equal to 0 making m undefined.  From here, we can conclude a vertical line has no slope. » Read more

Matchsticks, Linear Relations, and Multiple Representations


We have mentioned the different types of functions in the Introductions to Functions post.  In this post, we are going to learn about linear function and its  characteristics.

To start, let us examine the problem below taken from the TIMSS 2003 released items given to Grade 10 students in more than 40 countries all over the world.

Matchsticks are arranged as shown in the figures.

If the pattern is continued, how many matchsticks would be used to make figure 10.

A. 30                      B. 33                      C. 36                      D. 39                      E. 42

The problem is too easy that even a first grade pupil would be able to answer it given enough time. Smart students would be able to easily see patterns. For example, they can relate the number of squares to the number of matchsticks.  If they cannot find a pattern, the last resort would be by brute force; that is, by manually drawing the tenth figure. » Read more

Introduction to the Concept of Functions

Problem: A cube is painted on all faces and cut into smaller cubes of the same size. Investigate the number of painted faces of the smaller cubes.


In Figure 1, shown are the cubes with side lengths two units and three units. The light blue cube has been painted and cut into eight smaller unit cubes, while the yellow cube has been painted yellow and cut into 27 smaller unit cubes. To avoid confusion, we will simply call the bigger or uncut cubes “cube”and the smaller cubes “unit cubes”.

How many unit cubes can be formed from a painted cube with length 4 units? 5 units? n units?

Figure 1 – Cubes with side lengths 2 and 3 cut into unit cubes.

Before scrolling down, investigate the number of painted faces of each yellow unit cube. In Figure 2, the unit cubes have been drawn from different perspectives to make visualization easier.

How many cubes are there with 3 painted faces? 2 painted faces? 1 painted face? 0 painted face?

Figure 2 – Cube cut into 27 unit cubes shown in different perspectives.

Without drawing, can you determine the number of painted faces of a cube with side length 4 units? How about 5 units? 6 units?

Challenge: Find a formula for the number of unit cubes 3 painted faces, 2 painted faces, 1 painted face and 0 painted face given a side length n units.

To determine how many unit cubes are painted given a particular size, it will help us if we know the properties of a cube. Let us recall that a cube has 8 vertices, 6 faces and 12 edges.

Figure 3 – Parts of a cube.

For the sake of discussion, we will name and color the unit cubes (see Figure 4) and group them depending on their positions – whether they are at the edges, vertices or faces of the cube.

  • Vertex Cubes (Red) – are the unit cubes located at the vertices of the cube. It is evident only 3 of their faces are painted.
  • Edge Cubes (Green) – are the unit cubes located at the 12 edges of the cube. Note that only two of their faces are painted.
  • Wall Cubes (Blue) – are the unit cubes at the faces of the cube. We will call the wall cubes because we will use the word “face” in another context.
  • Core Cubes (No color) – are cubes that are at the core of the cube that was not painted.

Figure 4 – The cube showing number of painted faces depending on their positions.

From Figure 4, it is clear that vertex cubes have 3 painted faces, edge cubes have 2 painted faces, wall cubes have 1 painted face and core cubes have no painted face.

Extending this type of grouping to cubes of larger side lengths, a pattern can be seen as shown in the table below. The calculation for the number of cubes can be generalized.

Figure 5 – Table showing the relationship of the number of painted faces given the cube’s sidel length.

Let us make the following definitions:

a = number of core cubes of an cube with side length n

b = number of wall cubes of a cube with side length n

c = number of edge cubes of a cube with side length n

d = the number vertex cubes with side length n


a = (n – 2)3 = n3 – 9n2 + 27n – 27

b = 6(n-2)2 = 6n2 – 24n + 24

c = 12(n-1) = 12n- 12

d = 8

That means that we have created a formula for finding the number of painted faces no matter how large it is. For example, if we want to find the number of wall cubes in from a cut cube with length 100 units, then there are a = 6(100)2 – 24(100) + 24 = 57624 wall cubes.

Question: If m is the volume of the cube before it was cut, then how can you express m in terms of a,  b, c and d?

Let us consider first the equation c = 12(n-1) = 12n – 12. Note that for each side length n, there is a corresponding number of edge cubes denoted by c. And there is only one c. For instance, if n = 3, there is no other value for c except 24. And clearly, this is true for all values of n.

If for each n there is exactly one corresponding c, then we say that c is a function of n.  Hence, we describe what a function means:

A function is a relationship between two sets where for every element of the first set, there is exactly one corresponding element in the second set.

In our case, our first set is the side length of the cube which is n, and our second set is the number of edge cubes that we denoted by c.   In general, if we have set A and set B, for every element in A, there is exactly one corresponding element in B.

The symbol f(x) is read as “f of x” and is usually used as a notation of a function.

We now denote the functions a as f(x), b as g(x), c as h(x) and d as k(x).

We will now graph our functions in the xy plane. The graphs of these functions are shown in Figure 6. The dots represent the ordered pairs and the dashed lines and curves are the lines that we will be formed if we will let x be the set of real numbers instead of integers.

Figure 6 – The points and the trendlines of the graphs of f(x), g(x), h(x) and k(x).


In this article, we have learned the following:

  • A function is a relationship between varying quantities.
  • A function is a relationship between two sets where for each element in the first set, there is exactly one corresponding element in the second set.
  • A function maybe represented as a table, set of ordered pairs such as (3,8), (4,8), (5,8), equations and graphs.

In the sequel of this article, we will discuss more about the basics of functions and its properties, so keep posted.