2. The numbers are $a_{1}=\log _{2}\left(3^{x}-1\right), a_{2}=\log _{4}\left(9^{x}-3^{x+1}+2\right)$ and $a_{3}=\log _{2}\left(3-3^{x}\right)$.
a) Determine all real values of $x$ for which all 3 numbers $a_{1}, a_{2}$, and $a_{3}$ are defined.

b) Determine all real values of $x$ for which $a_{1}+a_{3}=2 a_{2}$.
2. a) For all three logarithms to be defined, the conditions $3^{x}-1>0$, $9^{x}-3^{x+1}+2>0$, and $3-3^{x}>0$ must hold. The first inequality simplifies to $3^{x}>1$, i.e., $x>0$; the third inequality simplifies to $3^{x}<3$, i.e., $x<1$. The second inequality can be rewritten as $9^{x}-3 \cdot 3^{x}+2>0$, and by substituting $t=3^{x}$, it becomes $t^2-3t+2>0$, i.e., $(t-1)(t-2)>0$, and its solution is $t \in(-\infty, 1) \cup(2, \infty)$. By reverting the substitution $t=3^{x}$, we get $x \in(-\infty, 0) \cup\left(\log _{3} 2, \infty\right)$. Taking the intersection of all three conditions for $x$, we conclude that all three logarithms are defined for $x \in\left(\log _{3} 2,1\right)$.

b) The given equation simplifies to

$$
\log _{2}\left(3^{x}-1\right)+\log _{2}\left(3-3^{x}\right)=2 \log _{4}\left(9^{x}-3^{x+1}+2\right)
$$

i.e.,

$$
\log _{2}\left(\left(3^{x}-1\right)\left(3-3^{x}\right)\right)=\log _{2^{2}}\left(9^{x}-3^{x+1}+2\right)^{2}
$$

The right side of the equation is actually $\log _{2}\left(9^{x}-3^{x+1}+2\right)$, so after removing the logarithms and substituting $t=3^{x}$, it remains to solve the equation $(t-1)(3-t)=(t-1)(t-2)$, where we used the factorization obtained earlier in part a) for the right side. This further simplifies to $0=(t-1)((t-2)-(3-t))=(t-1)(2t-5)$, which has solutions $t=1$ and $t=\frac{5}{2}$. The first solution gives $x=0$, which we discard because it does not belong to the domain of definition. The second solution gives $x=\log _{3} \frac{5}{2}$, and this value indeed satisfies the obtained constraints $\left(\log _{3} 2<\right.$ $\log _{3} \frac{5}{2}<1$), so it is the only solution to the given equation.