7. If the function $y=a^{2 x}+2 a^{x}-9(a>0, a \neq 1)$, has a maximum value of 6 on the interval $[-1,1]$, then $a=$
7. 3 or $\frac{1}{3}$ Let $t=a^{x}, y=t^{2}+2 t-9(t>0)$, when $a>1, t=a$, $y_{\text {max }}=a^{2}+2 a-9=6, a=3$; when $0<a<1$, $\left(\frac{1}{a}\right)^{2}+\frac{2}{a}-9=0, a=\frac{1}{3}$.