If the first term is
, then the second term is
, the third is
, the fourth is
, and the fifth is
.
We're given

So the first five terms in the GP are
3, 6, 12, 24, 48
Adding up the first four gives a sum of 45.
If you were asked to find the sum of many, many more terms, having a formula for the n-th partial sum would convenient. Let
denote the sum of the first n terms in the GP:

Multiply both sides by 2:

Subtract this from
, which eliminates all the middle terms:

Then the sum of the first four terms is again
.