<s>[INST] Find the range of $ f(x)=9^x - 3^x+1$ 
Problem:-Find range of function $ f(x)=9^x - 3^x+1$, here the domain of $f$ is $\mathbb R$.
Solution: $ f(x)=9^x - 3^x+1$. Let $f(x)=y$. Then 
  $$ \begin{split}y&=9^x - 3^x+1\\
 y&=3^{2x} - 3^x+1
\end{split}$$
  Let $3^x= u$. Then $ y=u^2 - u+1$, so
  $$ u^2 - u+1-y=0.$$

Am I doing right?
 [/INST] After some computation, you will get $$f(x)=(3^x-1/2)^2+3/4.$$
</s>