Solution to the problem tells us that ##S_5 + i S_6## is the sum of the terms of a geometric sequence and thus the solutions should be :
$$S_5 = \frac{\sin( (n+1) x)}{\cos^n(x) \sin(x)},\,\,\,\, S_6 = \frac{\cos^{n+1}(x) - \cos((n+1)x)}{\cos^n(x) \sin(x)} , x \notin \frac{\pi}{2} \mathbb{Z}$$...