Modulus functions

Understanding the modulus function

Numbers can be positive or negative (or zero). We sometimes will like to convert our numbers into positive numbers (non-negative to be exact). The modulus function, denoted by |⋅|, does that.

For example |3|=3, |0|=0 and |−5|=5.

This is sometimes also called the absolute value function.

Modulus as a piecewise function

The modulus function can be defined as a piecewise function:

|f(x)|={f(x)if f(x)≥0−f(x)if f(x)<0

Example

For example, consider the function f(x)=|x−2|.

If x<2, then x−2 is negative so the function can be rewritten as f(x)=−(x−2)=2−x.

On the other hand, if x≥2, then x−2 is non-negative so the function can be rewritten as f(x)=x−2.

Finding inverses of modulus functions

Question:

f:x↦|x−2|,x<1,g:x↦|x−2|,x≥2.

Find f−1(x) and g−1(x).


Solution:

When x<1, then x−2 is negative so f(x)=−(x−2)

Let y=−(x−2)y=−x+2x=2−y

f−1(x)=2−x∎

When x≥2, then x−2 is non-negative so g(x)=x−2

Let y=x−2x=y+2

g−1(x)=x+2∎