If the first term is [tex]a[/tex], then the second term is [tex]ar[/tex], the third is [tex]ar^2[/tex], the fourth is [tex]ar^3[/tex], and the fifth is [tex]ar^4[/tex].
We're given
[tex]\begin{cases}ar=6\\ar^4=48\end{cases}\implies\dfrac{ar^4}{ar}=r^3=8\implies r=2\implies a=3[/tex]
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 [tex]S_n[/tex] denote the sum of the first n terms in the GP:
[tex]S_n=3+3\cdot2+3\cdot2^2+\cdots+3\cdot2^{n-2}+3\cdot2^{n-1}[/tex]
Multiply both sides by 2:
[tex]2S_n=3\cdot2+3\cdot2^2+3\cdot2^3+\cdots+3\cdot2^{n-1}+3\cdot2^n[/tex]
Subtract this from [tex]S_n[/tex], which eliminates all the middle terms:
[tex]S_n-2S_n=3-3\cdot2^n\implies -S_n=3(1-2^n)\implies S_n=3(2^n-1)[/tex]
Then the sum of the first four terms is again [tex]S_4=3(2^4-1)=45[/tex].