I am having problems finding the inverse function of a complicated function. In this case: $$y=x|x|e^x $$
I thought I could 'split' this function but I'm not sure if that's the right way.
for $y=x$ it would be $x=y$
for $y=e^x$ it would be $x=\ln(y)$
for $y=|x|$ we need to split it in 2 cases: if $x<0, y=-x,$ if $x>0, y=x $
So all together it would be:
for $x<0$:
$$y = x \cdot (-x) \cdot \ln y $$
$$-x^2= y/\ln y$$
$$x = - \sqrt{\frac{y}{\ln y}} $$
For $x>0$:
$$y = x \cdot x \cdot ln y $$
$$x^2 = y/\ln y $$
$$x = \sqrt{\frac{y}{\ln y}} $$
Is this the right way of solving this case? I would be grateful for any help