Revision:Ocr core 3 - the modulus function

7. The modulus function

The modulus function and its graph

The modulus function is defined as follows:

 |x| = x, \ if \ x \ge 0

 |x| = -x, \ if \ x < 0 .

This is defined for all real numbers, and can also be called "absolute value".

The shape of the graph of this function is easy to predict. Consider that all positive "x" values will have no change (hence there will be a line which has gradient 1, and passes through the origin). But there is a difference to the negative values of "x". These values will be changed (they will become positive), and therefore what would be a line going in the same direction as the one for positive "x" (if there was no modulus function) will be reflected in the x-axis, forming a line that has gradient -1, and passes through the origin.

These lines meet at the origin, and give the "V" shape of the graph  y = |x| .

Graphs of functions involving the modulus

The method previously used to predict the shape of  y = |x|  can be used with other functions involving the modulus function (as a component).

Consider the graph of  y = | x - n | .

Consider the times when this is positive, and therefore  | x - n | = x - n .

 x - n \ge 0 \implies x \ge n .

Hence, for all values of "x" greater than or equal to "n" there is a line of gradient 1.

Now consider the other case, where the modulus function changes the value.

 | x - n | = - (x - n) = n - x


 x - n < 0 \implies x < n .

Hence there is a line, of gradient -1 for all values of "x" below "n". This gives the same "V" shape as the original graph (of  y = |x| ), however this time the line of symmetry is not  x = 0 , but  x = n .

The reason for the gradients being 1, and -1 is simply that  \forall x \ge n, \ y = x - n , and  \forall x < n, \ y = n - x .

The two graphs are of gradient 1, and -1 (respectively), and this is where this information can be found.

This idea can be further generalised:

 y = |f(x)|

 \forall f(x) \ge 0, \ y = f(x)

 \forall f(x) < 0, \ y = -f(x) .

This implies that for all of the values such that the function applied to "x" is greater than or equal to 0, the function of "x" is graphed as usual. When the function is negative, there is a reflection in the x-axis.

Notice that there are sharp corners, at these points there is no derivative but it is possible for these points to be minima or maxima.

Graphs of  y = f(|x|)  are different to those discussed previously.

In these graphs, the positive values of "x" are not changed, and therefore the function outputs the same value, and the graph is unchanged for all positive "x". The negative values of "x" are changed such that they are positive, and correspond to their magnitudinally equivalent positive "x" values. This implies that there is a symmetry about the y-axis, as all of the negative values of "x" are plotted as if they were positive. Considering this in terms of transformations:

 y = f(x), \ if \ x \ge 0

There is no change to the function for positive "x".

 y = f(-x), \ if \ x < 0

There is a reflection in the y-axis for negative "x".

Some algebraic properties

It is useful to be able to correctly manipulate the modulus function.


 |a| \times |b|

 a \ge 0, \ and \ b \ge 0 \implies |a||b| = ab = |ab|

 a < 0, \ and \ b \ge 0 \implies |a||b| = (-a)b = -ab = |ab|

 a \ge 0, \ and \ b < 0 \implies |a||b| = a(-b) = -ab = |ab|

 a < 0, \ and \ b < 0 \implies |a||b| = (-a)(-b) = |ab|

So,  |a||b| = |ab| .

Similarly,  \frac{|a|}{|b|} = | \frac{a}{b} |

(Do not make the common mistake of assuming these rules hold for addition and subtraction).

Modulus on the number line

The distance between two points on a number line can be expressed using the modulus.

 | b - a |  is the distance between the numbers "a", and "b".

The reason for this is simply that if "b" is less than "a", the distance would appear negative (if there was no modulus), however, distance is not a vector quantity, and therefore it must be expressed as a positive quantity.

Conversely, if "b" is greater than or equal to "a" it is either the same point as "a", or it is further along the line; hence the distance need not have the modulus (but it makes no difference that there is a modulus function).

Consider  |a| = n .

This implies that  a = -n, \ or \ a = n .

In this manner inequalities can be formed, and solved.

 |a| \le n \implies -n \le a \le n .

(For the obvious restriction of "n" being positive).

Now consider the idea of the distance:

 |b - a| = n

Consider the cases that can occur:

 b - a = n \implies b = n + a

 -(b - a) = n \implies b = -n + a


 |b - a| \le n  \implies -n + a \le b \le n + a

And similarly:

 |b - a| \le n  \implies -n + b \le a \le n + b

Equations involving modulus

There are two main methods for solving equations involving the modulus function. The first involves using graphs. This method relies upon the ability of the candidate to draw an accurate graph involving the modulus function, and understand the concept that the intersections of the graphs of the appropriate functions will lead to the solution to the equation.

The second method is perhaps a more versatile method that allows for greater extensibility, and more accurate answers. This method involves understanding the concept of a modulus function, and hence how to handle the different cases that arise. (This method will be concentrated on in these notes as it is perhaps more complicated).

Consider the equation  |x - k| = n .

There are two different cases for the modulus function in this equation, either it changes the expression it is applied to, or it does not; consider both.

 x - k \ge 0 \implies x \ge k


 x - k < 0 \implies x < k .

Now the equation can be solved:

 x - k = n \implies x = k + n

 -(x - k) = n \implies x = k - n .

(Note that these are the different cases, either the modulus function changes the expression it is applied to, or it does not).

But, there are conditions upon these statements being true.

For the case that the modulus function does not change the expression, it has been shown that  x \ge k , and that  x = k + n ; the true values which solve this are the ones for which this is true.

 x \ge k \implies x = k + t, \ where \ t \in \mathbb{R} ^{+}

 k + t = k + n \implies t = n

Hence, this is only true for positive (or zero) "n".

The other case should be considered:

 x < k \implies x = k + t, \ where \ t \in \mathbb{R} ^{-}

 k + t = k - n \implies t = -n

Hence, this is only true for positive "n".

(This process is easier if there are numbers in it (as the number is either positive, negative, or neither, and therefore there would simply be an answer, not a condition).

Inequalities involving modulus

The same methods as for equations can be applied to inequalities.

 |x - k| \le n

Consider the different cases:

 x - k \ge 0 \implies x \ge k

 x - k < 0 \implies x < k


 x - k \le n \implies x \le n + k

 -(x - k) \le n \implies x \ge k - n

There are restrictions however; consider the case for the expression within the modulus being positive first.

 x \ge k \implies x = k + t, \ where \ t \in \mathbb{R} ^{+}

 k + t \le n + k \implies t \le n

Hence, the difference between "x", and "k" must be less than or equal to "n" for this to be true.

The other case is:

 x < k \implies x = k + t, \ where \ t \in \mathbb{R} ^{-}

 k + t \ge k - n \implies t \ge -n

Hence, the difference between "x", and "k" must be greater than or equal to "-n" for this to be true.

Note that when dealing with two moduli in an inequality all of the different cases must be considered (both expressions are positive, one expression is positive, the other expression is positive, both expressions are negative).

Squares, square roots and moduli

For real numbers the square is always greater than or equal to zero, hence:

 x \in \mathbb{R} \implies | x^{2} | = |x| ^{2} = x^{2} .


 x \in \mathbb{R} \implies |x| = \sqrt{ x^{2} } .

Sometimes it is convenient to square the moduli to remove them from an equation or inequality (as opposed to the rather lengthy method aforementioned).

If it is the desire of a candidate to square each side of an expression it is useful for them to know which steps are valid (and, indeed, which are not).

An identity can be used.

 x^{2} - y^{2} \equiv |x|^{2} - |y|^{2} \equiv (|x| - |y|)(|x| + |y|) .

In order to use this it should be demonstrated.

Consider the four cases:

 x \ge 0, \ and \ y \ge 0

 x < 0, \ and \ y \ge 0

 x \ge 0, \ and \ y < 0

 x < 0, \ and \ y < 0

The first case:

 x^{2} - y^{2} \equiv |x|^{2} - |y|^{2}

(The above is obviously true, as the moduli of the two values are not changing anything [the values are positive]).

The second part follows from simple factorisation.

It is simple to shorten the demonstration by simply explaining that  x^{2} \ge 0, \ for \ x \in \mathbb{R} , hence there is no problem with the statement.

 x^{2} - y^{2} > 0 \Leftrightarrow |x| - |y| > 0


 x^{2} - y^{2} > 0 \implies x^{2} > y^{2} \implies \sqrt{x^{2}} > \sqrt{y^{2}} \imples |x| > |y| \implies |x| - |y| > 0

The case where  y = 0  can be considered, and simply shows that  x^{2} > 0 \Leftrightarrow |x| > 0  which is obviously true.

Similarly, the following statements can be deduced:

 x^{2} - y^{2} < 0 \Leftrightarrow |x| - |y| < 0

 x^{2} - y^{2} = 0 \Leftrightarrow |x| = |y| .


 |x| = |y| \Leftrightarrow x^{2} = y^{2}

 |x| > |y| \Leftrightarrow x^{2} > y^{2}

Also, if  y \not =  0 :

 |x| < |y| \Leftrightarrow x^{2} < y^{2} .

The special case above has to be considered as for all "x" the modulus of "x" is greater than or equal to 0.

These results show that inequalities are preserved through squaring, and therefore that it can be a valid step.


1. Solve the following inequality:

 |x - 2| \le 0 .

Using the squaring method:

 (x - 2)^{2} \le 0 \implies x^{2} - 4x + 4 \le 0


 x = 2 .

It is not always correct to use this method, and it can lead to extra roots. If this method is used, it is very useful to check the answers obtained before submitting them.