Why avoid piecewise notation?

218 Views Asked by At

A lot of people come here asking, essentially, some variation of the following:

I know how to write a piecewise function that [does something]. How do I write a non-piecewise function that does the same thing?

To my mind, that is like asking the following:

I've written this formula in red whiteboard marker. How do I write it in blue whiteboard marker instead?

Probably there is some use to doing this, given that so many people ask for it, but I haven't the faintest idea what that use is. Most of the time, it makes the function longer and more complex, often with some combination of $(-1)^n$, absolute value notation, and periodic functions such as sine and cosine popping up. I don't see the use of these extra terms in most cases. They obscure the core purpose and behavior of the function.

What is the purpose of rewriting a function to avoid piecewise notation? In what contexts does it help you reason about the function?

2

There are 2 best solutions below

0
On BEST ANSWER

Occasionally, it's useful to interpolate a discrete-valued function using some sort of differentiable function, so that say, the function can be optimized using gradient descent. But otherwise, these questions basically come from either people who are just curious, or misguided students who think that piecewise functions somehow "don't count" as mathematical formulae, basically just out of habits ingrained in them at school.

0
On
  1. A single expression is usually more compact.
  2. They think that it is mathematically more correct to have a single expression.
  3. They think that it is easier to take derivatives or antiderivatives of a single expression.