a)
[tex]a_1 = 2\\a_2 = 4\\q = \frac{a_2}{a_1}=\frac{4}{2} = 2\\n = 6\\\\\\S_{n} + a_1\cdot\frac{1-q^{n}}{1-q}\\\\S_{6} = 2\cdot\frac{1-2^{6}}{1-2} = 2\cdot\frac{1-64}{-1} = 2\cdot(64-1) = 2\cdot63 = 126[/tex]
b)
[tex]a_1 = 1\\a_2 = -2\\q = \frac{a_2}{a_1} = \frac{-2}{1} = -2\\n = 6\\\\\\S_{n} = a_1\cdot\frac{1-q^{n}}{1-q}\\\\S_{6} = 1\cdot\frac{1-(-2)^{6}}{1-(-2)} = \frac{1-64}{3} = -\frac{63}{3} = -21[/tex]