5. The function $f(x)=a^{2 x}+3 a^{x}-2(a>0, a \neq 1)$ has a maximum value of 8 on the interval $x \in[-1,1]$. Then its minimum value on this interval is $\qquad$ .
5. $-\frac{1}{4}$.

Let $a^{x}=y$. Then the original function becomes
$$
g(y)=y^{2}+3 y-2 \text {, }
$$

and $g(y)$ is increasing on $\left(-\frac{3}{2},+\infty\right)$.
When $01$, $y \in\left[a^{-1}, a\right]$,
$$
g(y)_{\max }=a^{2}+3 a-2=8 \Rightarrow a=2 \text {. }
$$

Thus, $g(y)_{\min }=2^{-2}+3 \times 2^{-1}-2=-\frac{1}{4}$.
In conclusion, the minimum value of $f(x)$ on $x \in[-1,1]$ is $-\frac{1}{4}$.