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
 A: Simplify the equation by substituting $a=3^x$ and using the fact that $a>0$.
$a(a+1)+2=|a-1|+a+2$ since $a+2>0$
There are only two cases to be checked:
Case 1: $a^2 + a+2=a-1+a+2$
$\Longleftrightarrow a^2 -a+1=0$
Here $D=b^2-4ac=1-4=-3<0$
Therefore no real solutions.
Case 2: $a^2 + a+2=-a+1+a+2$
$\Longleftrightarrow a^2+a-1=0$
$\Longleftrightarrow a= \frac{-1+ \sqrt 5}{2} $ since $a>0$ we neglect $a= \frac{-1- \sqrt 5}{2} $
Therefore, there's only one root.
Further, if you want to find $x$,
$3^x=\frac{-1+ \sqrt 5}{2} $
Take $\log$ on both sides,
$x= \log_3\frac{\sqrt 5 -1}{2}$
This is the only solution to the expression given.
A: $\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$
A: Notice that $3^x$ will always be positive as it is an exponential function. Also, to make things easier, $3^x\geq 1 \forall x\geq 0$. That gives you $2$ cases only which now can be solved easily.
Hope this helps.
