Find all real solutions for $x$ in $2(2^x−1)x^2+(2^{x^2}−2)x=2^{x+1}−2$.

Find all real solutions for $x$ in $2(2^x−1)x^2+(2^{x^2}−2)x=2^{x+1}−2$.

I started off by dividing $2(2^x- 1) x^2 + (2^{x^2}-2)x = 2^{x+1} -2$ by $2$, and I got $(2^x-1)x^2 + (2^{x^2-1}-1)x = 2^x -1$. I tried dividing by $2^x-1$ on both sides which would give me a simple quadratic to solve for $x$, but I don't know how to simplify $\frac{(2^{x^2}-1)}{(2^x-1)}$. Am I missing a simple trick here, or am I on a completely wrong path to solving this?


As per dxiv's hint: by elementary methods, the equation is equivalent to

$$f(x)\stackrel{\text{def}}{=}(2^x−1)(x^2-1)+(2^{x^2-1}−1)x=0$$ Note that, for any $y$, $2^y-1$ and $y$ have the same sign (positive, negative, or zero); write $\mathrm{sgn}\,y$ for the sign of $y$. Then

$$\mathrm{sgn}[(2^x-1)(x^2-1)]=\mathrm{sgn}(2^x-1)\mathrm{sgn}(x^2-1)=\mathrm{sgn}(x)\mathrm{sgn}(x^2-1)$$ and likewise $$\mathrm{sgn}[(2^{x^2-1}-1)x]=\mathrm{sgn}(x^2-1)\mathrm{sgn}(x)$$

Now, if $\mathrm{sgn}(y)=\mathrm{sgn}(z)$, then $\mathrm{sgn}(y+z)=\mathrm{sgn}(y)=\mathrm{sgn}(z)$. Consequently $$\mathrm{sgn}[f(x)]=\mathrm{sgn}(x)\mathrm{sgn}(x^2-1)=\mathrm{sgn}(x)\mathrm{sgn}(x+1)\mathrm{sgn}(x-1)\text{.}$$ By the zero product property and the fact that $\mathrm{sgn}(y)=0$ iff $y=0$, we find that $f(x)=0$ iff $x\in\{-1,0,1\}$.


Using Mathematica

eq = 2 (2^x - 1) x^2 + (2^(x^2) - 2) x == 2^(x + 1) - 2;

sol = Solve[eq, x, Reals]

(* {{x -> -1}, {x -> 0}, {x -> 1}} *)

Verifying the solutions

And @@ (eq /. sol)

(* True *)

Showing the solutions on a plot

Plot[{2 (2^x - 1) x^2 + (2^(x^2) - 2) x, 2^(x + 1) - 2},
 {x, -2, 2}, PlotLegends -> Placed["Expressions", {.22, .75}],
 Epilog -> {Red, AbsolutePointSize[5],
   Point[{x, 2^(x + 1) - 2} /. sol]}]

enter image description here