One formula for function

18 Views Asked by At

Let $f(x)$ is a function such that $f(x)=x$ if $x\ge0$ and $f(x)=-x$ if $x<0$ then we can write $f(x)=|x|$.

How about $g(x)$ such that $g(x)=x^3$ if $x\ge0$ and $g(x)=x^2$ if $x<0$? Can we write $g(x)$ use one formula?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes we can! Use $g(x)=x^{2.5+\frac{sgn(x)}{2}}$
(where $sgn(x)$ is the sign function)