# Piecewise function confusing

Sorry if there are multiple answers for this type of question (probably are), but I'm having a hard time understanding piecewise functions. Or rather, this particular function.

Say I have the function f(x) = |x-3|x

Do I find where the absolute value part is equal to zero, and then have a greater than or less than clause? But then the x outside of the absolute value function messes with my attempt at doing that. Basically, I don't know how to write f(x) as a piecewise function.

Any help would be greatly appreciated.

Thanks!

• Well...can you write $|x|$ as a piecewise function? What about $|x-3|$?
– lulu
Commented Sep 7, 2016 at 10:19

## 1 Answer

If $\ x-3\ge 0\$, we have $\ |x-3|=x-3\$, hence $\ f(x)=(x-3)x\ \$ for $x\ge 3$.

If $\ x-3<0\$, we have $\ |x-3|=3-x\$, hence $\ f(x)=(3-x)x\ \$ for $x<3$.

• Explanation: @Peter is using the definition of the absolute value in order to simplify. $f(x)<0 \implies |f(x)|= -f(x)$. Commented Feb 10, 2019 at 18:34