How to Write a Piecewise Function - Search