How many solutions does the expression $3^x(3^x+1)+2=|3^x-1|+|3^x+2|$ have? I can solve this by opening every single modulus, doing alternate combinations of $\pm$  and checking whether every $3^x$ is $>0$ or not. But that consumes a lot of time. Is there is a shorter way to solve such questions. 
The answer is 1

$\because\forall x\in\mathbb R,3^x>0,\therefore 3^x+2>0$,so
$$\begin{align}
3^x(3^x+1)+2 & =|3^x-1|+|3^x+2|\\
\Longleftrightarrow \quad\,\,\,\, 3^{2x}+3^x+2 & =|3^x-1|+3^x+2\\
\Longleftrightarrow \qquad\qquad\quad 3^{2x} & =|3^x-1|
\end{align}$$
And when $3^x>1$,it’s
$$3^{2x}>3^{2x}-1=(3^x+1)(3^x-1)>3^x-1$$
so it haven’t solution when $3^x>1$,you can just find the solution in the case: $3^x\leqslant 1$
