<s>[INST] number of real solution in exp equation 
Find number of real values of  $x$ in 
  $$3^x (3^x-1)=|3^x-1|+|3^x-2|$$

What i try
Put $\displaystyle 3^{x}-\frac{1}{2}=t.$ Then
$$\bigg(t-\frac{1}{2}\bigg)\cdot \bigg(t+\frac{1}{2}\bigg)= \bigg|t-\frac{1}{2}\bigg|+\bigg|t-\frac{3}{2}\bigg|$$
So $$t^2-\frac{1}{4}=|t-0.5|+|t-1.5|$$
How do i solve it Help me please 
 [/INST] If $3^x > 0$ and $|A| + |B| \ge 0$ so $3^x(3^x-1) \ge 0$ so $3^x-1 \ge 0$.  So $x \ge 0$.
If $x=0$ then LHS $= 0$ and RHS $=0 + 1= 1$.  So $x = 0$ is not a solution.
Case 1: If $0 < x < \log_3 2$ then $3^x -1 > 0$ but $3^x - 2 < 0$ so
$3^x(3^x-1) = (3^x -1) + (2 - 3^x)$.  Let $a = 3^x$ and solve for $a(a-1)=(a-1)+(2-a)$ and when you know what $a$ is (watch out!  $a \ge 1$ so don't include any negative solutions or any solutions less than $1$) then solve for $3^x =a$.
Case 2:  If $x \ge \log_3 2$ then $3^x -1 > 0$ and $3^x -2 \ge 0$ so
$3^x(3^-1) = (3^x-1) + (3^x -2)$.  Let $b = 3^x$ and solve for $b(b-1)=(b-1)+(b-2)$ ane when you know what $b$ is (watch out! $b \ge 2$ so don't include any solutions less than $2$) then solve for $3^x = a$.
</s>