# Number of real roots

Find number of real roots of the equation

$$3^{|x|}-|2-|x||=1$$

My try:I have tried to remove the modulas by assuming x in some intervals and moved the linear part to RHS and drawn the rough graph of LHS and RHS and tried to interpret if there would be any intersection of two graphs but i could only interpret there are 1 solutions but it is not correct.

Is there some general way to solve such questions and how to solve this question without using any graphing tool ,we just have a pen and paper to solve it.

• Have you learnt curve sketching? The graphs aren't too difficult to plot actually. – Gummy bears Jul 16 '15 at 12:41
• Note: (a) $0$ is not a solution; (b) if $x=a$ is a solution, then $x=-a$ is also a solution (since every $x$ is in a $|x|$). So the number of solutions must be even :) – psmears Jul 16 '15 at 14:33

I think graphing would be the best option, the graph below shows the curves $3^{|x|}$ in blue and $1 + |2-|x||$ in red, they intersect in two places, so your equation has two real solutions.

It is quite easy to sketch these graphs. $3^{|x|}$ is simply an exponential function that goes to infinity fast after $x>1$ and you simply reflect the shape in the $y$-axis for $x<0$. There is a $y$-intercept of $1$.

On the other hand $1 + |2-|x||$ is simply a reflection in the $x$-axis of $|x|$, then translated upwards by $2$. Then you take the absolute value of that and translate it upwards by $1$ unit. The $y$-intercept is $3$.

• Hey ! we have to solve it without using graphing tool – Kartik Watwani Jul 16 '15 at 12:28
• You did not specify that. Your method used a sketching approach as well... – Zain Patel Jul 16 '15 at 12:30

By symmetry, if $x$ is a root, so is $-x$. Let us assume $x>0$ and solve

$$3^x-|2-x|=1,$$ i.e for $$x<2,\ 3^x-x-3=0$$ and for $$x>2,\ 3^x+x+1=0.$$ The latter relation is not possible, by positivity of the terms.

As $(3^x-x-3)'=\ln(3)3^x-1$, the function is increasing and has at most one real root. There is indeed one in the interval $(1,2)$, as the function goes from $-1$ to $4$.

More precisely, with the Lambert function

$$x=\pm\left(3+\frac{W\left(-\frac{\ln(3)}{27}\right)}{\ln(3)}\right).$$

• Also, one should check that $0$ isn't a root. $\;$ – user57159 Jul 16 '15 at 14:05
• Actually, this is covered by the fact that the first piece has a single root. But I admit that I assumed $x>0$ instead of $x\ge0$. – user65203 Jul 16 '15 at 14:09

$$|2-|x||=3^{|x|}-1$$

Case $$\#1:$$

Clearly, $$x=0$$ does not satisfy the equation

Case $$\#2:$$

If $$x>0,|2-x|=3^x-1$$

Case $$\#2A:$$ If $$x-2\ge0\iff x\ge2, x-2=3^x-1\ge8\iff x\ge9$$

$$\implies3^x-1>x-2$$

Case $$\#2B:$$ If $$0

Now $$2-x$$ is decreasing and $$3^x-1$$ is increasing

At $$x=0,2-0=2,3^0-1=0$$

At $$x=2,2-2=0,3^2-1=8$$

So, there must be a root in $$(0,2)$$

Case $$\#3:$$

If $$x<0, |2+x|=3^{-x}-1$$

Set $$-x=y, y>0$$ to get $$|2-y|=3^y-1$$ which is same as $$\#2$$