0

Consider a piecewise function . I want a general way to rewrite it , into the single expression . I know that for sign function there is a single expression but I'm looking for solve it generally.

S.H.W
  • 4,379

2 Answers2

2

It is not always possible, and many of the times it is possible, it's only because we're hiding the piecewise definition behind a dedicated piece of notation. For instance, the function $f(x)=|x|$ is really the function $$ f(x)=\cases{x&if $x\geq0$\\-x&if $x<0$} $$It's just that this particular piecewise function is so common that we have established a specific piece of notation to make writing the function easier.

Arthur
  • 199,419
1

In one of your comments, you asked for a function, defined for all $x \in \mathbb{R},\,$ such that $$ f(x)=\cases{ 0 &\text{if}\; x < 0\\[3pt] 1 &\text{if}\; x > 0 } $$ Here's one trick which will bury the cases . . .

$$f(x)=\left\lfloor{\max\left(0\,,\frac{1+x}{1+|x|}\right)}\right\rfloor$$

quasi
  • 58,772