Dear guauser+ahmadmath,
This is almost exercise 71 of a book that I have written (in portuguese).
To put it shortly, if f(k) = q^k sin(kx), then
F(k) = \frac{q^{k+1} sin(k-1)x - q^k sin(kx) } {1 - 2qcos(x) + q^2}.
So,
S_n(q,x) = \sum_{k=1}^n q^k sin(kx) = F(n+1) - F(1).
This is the answer if q^k sin(kx) is always \geq 0.
Hope this helps.
Luis