Let the first term be \(a\) and the common ratio be \(r\).
The second term is given by \(ar = 12\).
The sum to infinity is given by \(\frac{a}{1-r} = 54\).
From \(ar = 12\), we have \(a = \frac{12}{r}\).
Substitute \(a = \frac{12}{r}\) into \(\frac{a}{1-r} = 54\):
\(\frac{\frac{12}{r}}{1-r} = 54\)
\(\frac{12}{r(1-r)} = 54\)
\(12 = 54r(1-r)\)
\(12 = 54r - 54r^2\)
\(54r^2 - 54r + 12 = 0\)
Divide through by 6:
\(9r^2 - 9r + 2 = 0\)
Using the quadratic formula \(r = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\), where \(a = 9\), \(b = -9\), \(c = 2\):
\(r = \frac{9 \pm \sqrt{(-9)^2 - 4 \times 9 \times 2}}{2 \times 9}\)
\(r = \frac{9 \pm \sqrt{81 - 72}}{18}\)
\(r = \frac{9 \pm \sqrt{9}}{18}\)
\(r = \frac{9 \pm 3}{18}\)
\(r = \frac{12}{18} = \frac{2}{3}\) or \(r = \frac{6}{18} = \frac{1}{3}\)
For \(r = \frac{2}{3}\), \(a = \frac{12}{\frac{2}{3}} = 18\).
For \(r = \frac{1}{3}\), \(a = \frac{12}{\frac{1}{3}} = 36\).
Thus, the possible values of the first term are 18 or 36.