# The Modulus of a function

The modulus of a function represents its positive value excluding the sign. If you’ve ever used a GPS, you may have noticed that the distance from your location to a destination is always a positive number. Behind the scenes, a modulus function is in operation, ensuring the distance remains positive despite any negative calculations along the way. Similarly, in a financial context, if you’re trying to determine the absolute change in a stock price, the modulus function helps depict the sheer magnitude of change, regardless of it being an increase or decrease. Thus, practical uses of the modulus function permeate various real-world scenarios, making it a crucial concept in mathematical computations and problem-solving.

To take the modulus of a function means to take the positive value of that function’s output. Of course, this means that if the function is positive, we do nothing. If it turns out that the value of the function is negative then the modulus is the corresponding positive. We denote the modulus of a function with straight lines, i.e. the modulus of the function is . We sometimes write this as – the absolute value of . Take the modulus of some scalar values, for example, but . It follows that the piecewise definition of the modulus of a function is given by

What does piecewise mean?ย See the Piecewise Definition Example to define the modulus of a linear function in a piecewise fashion. The piecewise definition can be particularly helpful when solving equations. See the other examples.

## Sketching the Modulus of a Function and Solving Equations

Consider the graph of . The piecewise definition of is given by:

It follows that the graph doesn’t change for positive but is reflected for negative . You can see this from the graph, is in dashed blue whereas is in solid red.

We can apply this process to the modulus of any function. All we need to do is sketch the original curve and reflect any negative parts across the -axis. We can then use this to solve equations (or inequalities – see example) that involve the modulus of a linear function.

Consider solving the equation . We can start by sketching the graph of (dashed purple), flipping any negative parts across the -axis to get (solid purple), then plotting it against (solid orange). There are two intersection points and so there are two solutions to the original equation. The piecewise definition of is . It follows that to find the right hand solution we need to solve , that is . To find the left hand solution, we solve or . Hence the solutions are and .

## Sketching |f(x)| and f(|x|)

Given the graph of a function , you should know how to sketch the graphs of and . We obtain the graph of by reflecting any part of graph that falls below the -axis across it. This is because any negative value is made positive. However, the graph of is not so straight forward. In this case, we make the -value positive first before we evaluate the function. This means that we reflect the right hand side of the graph across the -axis and we effectively delete the left hand side of the graph. ย See below for these two transformations.ย A question may also require you to sketch the original curve before performing the above transformations. See the Quadratic Example.