For the following question, we need to find the length of the polar curve:

r= 2/(1-cosx) from pi/2 </= x </= pi
dr/dx= -2sinx/(1-cosx)^2

therefore the length would be expressed as follows:
the integral from pi/2 to pi of (sqrt)[(2/(1-cos))^2 + (-2sinx/((1-cosx)^2))^2
simplifying inside the sqrt we get:
4/(1-cos)^2 - 4(sin^2)/(1-cos)^4
I was following a similar example in the book (in which the original problem had (1+cos x) in the denominator, and they rearranged the integral like so:
|1/1-cosx| sqrt (1-(sin^2)/(1-cos)^2)
and since 1/1-cosx is greater than 0 for all x between pi/2 and pi, it can be written without the absolute value. Now here is where I am stuck. In the books problem, they rewrote the "1" under the sqrt as (1+cosx)^2/(1+cosx)^2, so that there was one fraction in which the numerator simplified to 2 + 2cosx. pulling out the two, the numerator and denominator cancelled. However, since my denominator is (1-cosx)^2, the numerator does not cancel nicely. What I get is this as my numerator:
cos^2-2cos+1-sin^2
Now I know that cos^2-sin^2= cos2x, so I could rewrite the numerator like this:
cos2x-2cosx+1
But this doesn't bring me any closer to something that will cancel with the denominator and allow me to integrate. Any ideas on how to simplify the fraction within the square root? For reference, it is:
1 - [(sinx)^2/(1-cosx)^2]

Thank you!

dont forget that when you square a - number it becomes positive

To simplify the fraction within the square root, let's start by rewriting it as follows:

1 - [(sinx)^2/(1-cosx)^2]

Now, let's expand the numerator and denominator of the fraction:

1 - [(sinx)^2/(1-cosx)^2] = (1-cos^2x)/(1-cosx)^2

Next, we can simplify the numerator by using the trigonometric identity cos^2x + sin^2x = 1:

(1-cos^2x)/(1-cosx)^2 = sin^2x/(1-cosx)^2

Now, notice that the denominator (1-cosx)^2 can be factored as (1-cosx)(1-cosx):

sin^2x/(1-cosx)^2 = sin^2x/[(1-cosx)(1-cosx)]

Next, we can cancel out one factor of (1-cosx):

sin^2x/[(1-cosx)(1-cosx)] = sin^2x/(1-cosx)

So now, the expression inside the square root becomes:

1 - [(sinx)^2/(1-cosx)^2] = sin^2x/(1-cosx)

Now, you can proceed with the integration using this simplified expression.