Answer
$a_n= \dfrac{15}{2} (-\dfrac{1}{2})^{n-1}$ and $a_n= \dfrac{5}{2} (\dfrac{1}{2})^{n-1}$
Work Step by Step
Here, we have $a_n= a_1 r^{n-1}$ for the Geometric series.
The sum of an infinite Geometric Series can be found as: $S_n=\dfrac{a_1}{1-r}$
Given : $S_n=\dfrac{a_1}{1-r}=5$
This implies that $a_1=5(1-r)=5-5r$
Plugging in $r=\dfrac{1}{2}$, we have $a_1=5-5(0.5)=\dfrac{5}{2}$
Now, plugging in $r=-\dfrac{1}{2}$, we have $a_1=5-5(-0.5)=\dfrac{15}{2}$
Thus, we have,
$a_n= \dfrac{15}{2} (-\dfrac{1}{2})^{n-1}$ and $a_n= \dfrac{5}{2} (\dfrac{1}{2})^{n-1}$