Let the first term be \(a\) and the common ratio be \(r\).
The second term is \(ar\) and the third term is \(ar^2\).
According to the problem, \(ar = a - 9\), so:
\(a - ar = 9\)
Also, \(ar + ar^2 = 30\), so:
\(ar + ar^2 = 30\)
From \(a - ar = 9\), we have:
\(a(1 - r) = 9\)
From \(ar + ar^2 = 30\), we have:
\(ar(1 + r) = 30\)
Eliminating \(a\) from these equations, we substitute \(a = \frac{9}{1-r}\) into the second equation:
\(\frac{9r(1 + r)}{1 - r} = 30\)
Solving for \(r\), we get:
\(9r + 9r^2 = 30 - 30r\)
\(9r^2 + 39r - 30 = 0\)
Dividing by 3:
\(3r^2 + 13r - 10 = 0\)
Solving this quadratic equation, we find:
\(r = \frac{2}{3}\)
Substituting \(r = \frac{2}{3}\) back into \(a(1 - r) = 9\):
\(a \left(1 - \frac{2}{3}\right) = 9\)
\(a \cdot \frac{1}{3} = 9\)
\(a = 27\)
Thus, the first term is 27.