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)0f(x)if f(x)<0

Example

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

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

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

Finding inverses of modulus functions

Question:

f:x|x2|,x<1,g:x|x2|,x2.

Find f1(x) and g1(x).


Solution:

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

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

f1(x)=2x

When x2, then x2 is non-negative so g(x)=x2

Let y=x2x=y+2

g1(x)=x+2