<s>[INST] The number of real roots of the equation $5+|2^x-1|=2^x(2^x-2)$ I'm trying to find the number of real roots of the equation $5+|2^x-1|=2^x(2^x-2)$.
Let $2^x=a$
$$|a-1|=a^2-2a-5$$
Then there are two cases 
$$a-1=a^2-2a-5$$
And $$a-1=-a^2+2a+5$$
Solving both equations 
$$a=1,-4,-2,3$$
Now -4 and -2 can be neglected so there are two values 
1 and 3.
Then $$2^x=1$$
$$x=0$$
And $$2^x=3$$
$$x=\log_2 3$$
But the answer doesn’t seem to consider the $\log_2 3$ as a viable root, and the answer is 1. Why is that the case?
 [/INST] There are two cases:


*

*$x\geq0$. The equation becomes $$2^{2x}-2^{x+1}-2^x-4=0$$$$(2^x-2)(2^x-1)= 6$$Clearly, $2^x-2>0$, which implies $x>1$. Let $y=2^x$. We have $y^2-3y-4=0$ which implies $$(y-4)(y+1)=0$$ So, $y=4$ and $x = 2$.

*$x<0$. The equation becomes $$6-2^x=2^{2x}-2^{x+1}$$$$2^{2x}-2^{x+1}+2^x-6=0$$$$(2^x-2)(2^x+1)=4$$Let $y=2^x$. Hence, $$y^2-y-6=0\to(y-3)(y+2)=0$$Neither solution can equal $2^x$ where $x<0$. So there are no solutions.
So, the only solution is $x=2$.
</s>