2
$\begingroup$

The other day, I came across the problem (or something that reduced to the problem):

Solve for $x$ in terms of $y$ and $e$: $$x^2e^x=y$$

I tried for a while to solve it with logarithms, roots, and the like, but simply couldn't get $x$ onto one side by itself without having $x$ on the other side too.

So, how can I solve this, step-by-step?

More generally, how can I solve equations that involve both polynomials (e.g. $x^2$, $x^3$) and exponentials (e.g. $e^x$,$10^x$)?

EDIT - I now remember why I this question came up. I was reading something about complexity theory (the basics: P, NP, NP-hard, etc.), and I got to a part that talked about how polynomial time is more efficient than exponential time. So, I decided to take a very large polynomial function and a very small exponential function and see where they met. Hence, I had to solve an equation with both polynomials and exponentials, which I figured could reduce to $x^2e^x=y$.

$\endgroup$
7
  • 2
    $\begingroup$ If this equation can be solved without numerical methods, then only with the Lambert-W-Function, not sure if this works. The Lambert-W-function is the inverse function of $f(x)=xe^x$ $\endgroup$
    – Peter
    Apr 25 '16 at 20:50
  • $\begingroup$ @Peter, sorry, I haven't heard of the Lambert-W-Function. I would accept an answer that used that function if you explained what it is and how it works. $\endgroup$ Apr 25 '16 at 20:52
  • 1
    $\begingroup$ The same can be said about every equation $p(x)e^x=y$, where $p(x)$ is a non-constant polynomial. It can be solved with Lambert-W-function perhaps, otherwise you will need numerical methods. $\endgroup$
    – Peter
    Apr 25 '16 at 20:52
  • $\begingroup$ @Peter Are there any good resources about the Lambert-W-Function that aren't too verbose/scholarly? (The Wikipedia article is beyond my understanding) $\endgroup$ Apr 25 '16 at 20:54
  • 1
    $\begingroup$ Since the Lambert-W-Function cannot be calculated explicit, there is no point to use it for the concrete calculation of solutions. It was just invented to allow to formulate some inverse functions. Better try newton method or regula falsi. With such methods, you can calculate the solutions easy and as precise as you want. $\endgroup$
    – Peter
    Apr 25 '16 at 20:58
2
$\begingroup$

Solution with Lambert W: $$ x^2 e^x=y \\ x e^{x/2} = \sqrt{y} \\ \frac{x}{2}\;e^{x/2} = \frac{\sqrt{y}}{2} \\ \frac{x}{2} = W\left(\frac{\sqrt{y}}{2}\right) \\ x = 2\;W\left(\frac{\sqrt{y}}{2}\right) $$ One solution for each branch of the W function.

Other solutions by taking the other square-root: $$ x = 2\;W\left(\frac{-\sqrt{y}}{2}\right) $$

Is there "no point" in these solutions? Perhaps. There are known properties of W. Your CAS may already have W coded.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.