I have discovered an algebraic way to represent Piecewise functions

139 Views Asked by At

I was fiddling with some graph theory ideas and with piecewise functions, and I made a startling discovery. I found out that if you consider the function, $$f\left(x,k\right)=-\lfloor\left(\frac{x-k}{\left(abs\left(x-k\right)+1\right)}\right)\rfloor$$ where $$\lfloor{x}\rfloor$$ is the floor function, or smallest integer function $$$$ and two arbitrary functions $g(x)$ and $h(x)$, you can create a piecewise function of the form $$t(x)=\begin{cases}g(x) & x \leq k\\h(x) & x > k\end{cases}$$ by simply creating $$t(x)=f(x,k)g(x)+(1-f(x,k))h(x)$$ this may seem complicating, but basically the function $f$ return a value of $-1$ from $-\infty$ to $k$ and returns 0 from $k$ to $\infty$. I use this to my advantage in order to provide a multiplier in order to make the graph of $t$ either $g$ of $h$ depending on the value of $k$. What I am wondering is, has this been discovered already and is this significance? I spend quite some time creating $f$ such that it is defined for all reals. So the domain of the algebraic piecewise should be the domain of $g$ up to and including $k$ and the domain of $k$ and beyond should be the domain of $k$, exactly as it would be in the piecewise. On another note, you can also find an algebraic piecewise for two functions and use it to create another algebraic piecewise, effectively being able to create piecewise of as many functions as you wish, in any parts of the domain you want.