(5) The function $y=a^{2 x}+2 a^{x}-1(a>0, a \neq 1)$ has a maximum value of 14 on the interval $[-1,1]$. Find the value of $a$.

 untranslated text is preserved in the translation result.
(5) $a=\frac{1}{3}$ or $a=3$