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?

$\begin{align*} 2\left (2^{x}-1 \right )x^{2}+\left(2^{x^{2}}-2\right)x&=2^{x}.2-2\\ 2\left(2^{x}-1\right)x^{2}-\left(2^{x^{2}}-2\right)x&=2(2^{x}-1) \end{align*}$
Let $2^{x}-1=a$ and $2^{x^{2}}-2=b$ and equation becomes:
$2ax^{2} + bx=2a$ or $2ax^{2}+bx-2a=0$. It's a quadratic equation. The quadratic equation has real solution if and only if $b^{2}-4ac>0$.
