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
The Lambert W function is defined as the inverse of $f(x) = xe^x$.
If $y=x^2e^x$, then $$\frac 12\sqrt y = \frac x2e^{\frac{x}{2}}$$ so that $x =2 W(\frac12 \sqrt y)$. Changing variables, our inverse is
$$f^{-1}(x) = 2 W(\frac12 \sqrt x)$$
Of course, the above only solves your problem for $x \geq 0$. I'm sure you can modify it for $x<0$.