The answer for the given question above would be calculated as:
y = (1 + cos(x)) / (1 - cos(x))
Using the quotient rule.
dy/dx = [ (-sin(x)) (1 - cos(x)) - (1 + cos(x)) (sin(x)) ] / [ (1 - cos(x))^2 ]
dy/dx = [ -sin(x) + sin(x)cos(x) - sin(x) - sin(x)cos(x) ] / [ 1 - cos(x) ]^2
dy/dx = [ -2sin(x) ] / [ 1 - cos(x) ]^2
The answer is dy/dx = [ -2sin(x) ] / [ 1 - cos(x) ]^2