2. Given $f(x)=2^{x}(x \in \mathbf{R})$ can be expressed as the sum of an odd function $g(x)$ and an even function $h(x)$. If the inequality $a g(x)+h(2 x) \geqslant 0$ holds for all $x \in[1,2]$, then the range of the real number $a$ is . $\qquad$
2. $\left[-\frac{17}{6},+\infty\right)$.
Obviously, $f(x)=g(x)+h(x)$,
$$
f(-x)=-g(x)+h(x) \text {. }
$$

Then $g(x)=\frac{f(x)-f(-x)}{2}=\frac{2^{x}-2^{-x}}{2}$,
$h(x)=\frac{f(x)+f(-x)}{2}=\frac{2^{x}+2^{-x}}{2}$.
Let $t=2^{x}-2^{-x}\left(\frac{3}{2} \leqslant t \leqslant \frac{15}{4}\right)$. Then $2^{2 x}+2^{-2 x}=t^{2}+2$.
Thus $\operatorname{ag}(x)+h(2 x)=\frac{1}{2} a t+\frac{1}{2}\left(t^{2}+2\right) \geqslant 0$, which means $a \geqslant-\left(t+\frac{2}{t}\right)$ for $t \in\left[\frac{3}{2}, \frac{15}{4}\right]$.

It is easy to see that $-\left(t+\frac{2}{t}\right)$ is a decreasing function on $\left[\frac{3}{2}, \frac{15}{4}\right]$. Therefore, when $t=\frac{3}{2}$, $-\left(t+\frac{2}{t}\right)$ reaches its maximum value $-\frac{17}{6}$.
Hence, $a \geqslant-\frac{17}{6}$.