# How do you write p(x) = |x-1| +4 as a piecewise function?

Apr 16, 2017

Use the definition of the absolute value function:

|a| = {(a; a >=0),(-a;a<0):}

#### Explanation:

Given: $p \left(x\right) = | x - 1 | + 4$

Please observe that $a = x - 1$ with regard to the definition:

|x-1| = {(x-1; x-1 >=0),(1-x;x-1<0):}

Simplify the inequalities

|x-1| = {(x-1; x >=1),(1-x;x<1):}

|x-1|+4 = {(x-1+4; x >=1),(1-x+4;x<1):}
Simplify the right side and substitute $p \left(x\right)$ on the left:
p(x) = {(x+3; x >=1),(5-x;x<1):}