# Proving Sum (r^ncos(nt))=rcos(t)-r^2/(1-2rcos(t)+r^2

## Homework Statement

This is a two part question, though once one is solved the other should be the same process:

"Write z=re^(it), where 0 < r < 1, in the summation formula and then with the aid of the theorem show that

$\sum$ r^n*cos(nt) = (r cos (t) - r^2)/(1-2r*cos(t) + r^2)

when 0 < r < 1

And

$\sum$ r^n*sin(nt) = (r sin (t))/(1-2r*cos(t) + r^2)

## Homework Equations

Summation formula:

$\sum$ z^n = (1/(1-z))

Theorem:

$\sum$zn=S iff $\sum$xn=X and $\sum$yn=Y (zn=xn+iyn, S=X+iY)

## The Attempt at a Solution

My problem seems to be algebraic: I used S=1/(1-z) to find, by multiplying by the conjugate, S=(1/(1-x-iy))=(1-x+iy)/(1-2x+x^2+y^2), where x=rcos(t), y=rsin(t). Which means that X=(1-rcos(t))/(1-2rcos(t)+r^2) and Y=rsin(t)/(1-2rcos(t)+r^2), and due to the above theorem that means that the first solution should be X and the second solution should be Y.

The second solution matches up with my answer, as does the denominator of the first with the solution, but the problem is that the numerators do not, and I cannot figure out what I am doing wrong, or if 1-rcos(t)=rcos(t)-r^2, and if that is the case how I am supposed to justify it.

Thank you for any help.