2. The functions \(f\) and \(g\) are defined by
$$\begin{aligned}
& \mathrm { f } : x \rightarrow 1 - a x , \quad x \in \mathbb { R } ,
& \mathrm {~g} : x \rightarrow x ^ { 2 } + 2 a x + 2 , \quad x \in \mathbb { R } ,
\end{aligned}$$
where \(a\) is a constant.
- Find the range of g in terms of \(a\).
Given that \(\operatorname { gf } ( 3 ) = 7\),
- find the two possible values of \(a\).