what is an easy way to solve piecewise functions?