Question 203271
This is a tricky one. It involves a substitution which "converts" rational
functions of sin and/or cos into "plain" rational functions which may be
more easily integrated. The substituion is based on a right triangle with
legs of 2z and (1-z^2) and a hypotenuse of (1+z^2). And let the angle
between the hypoentuse and the (1-z^2) leg be called x. In this triangle:
{{{sin(x) = (2z)/(1+z^2)}}}
{{{cos(x) = (1-z^2)/(1+z^2)}}}
And, thru the use of 1/2 angle trig identities:
{{{x = 2 arctan(z)}}}
or z = tan((1/2)x)
which leads to:
{{{dx = (2/(1+z^2))dz}}}<br>
Now we can substitute in for sin(u) and, if we had one, cos(u), and for du:
{{{int(1/(2 + sin(x)), dx) = int(1/(2 + (2z)/(1+z^2))*(2/(1+z^2)), dz)}}}
Multiplying the numerator and denominaor of the fraction by (1+z^2) we get:
{{{int(2/((1+z^2)*2 + 2z), dz) = int(2/(2+2z^2+2z), dz) = int(2/(2(z^2 + z
+ 1)), dz) = int(1/(z^2 + z + 1), dz)}}}
And, if we complete the square in the denominator we can have an integral
of the du/(a^2 + u^2) variety (an arctan):
{{{int(1/(z^2 + z + 1), dz) = int(1/((3/4) + (z^2 + z + 1/4)), dz) =
int(1/((sqrt(3)/2)^2 + (z + (1/2)^2)), dz)}}}
This fits the pattern of the intergation formula: {{{int(1/(a^2 + u^2),
du) = (1/a) arctan((u/a) + c)}}}
So {{{int(1/(z^2 + z + 1), dz) = (2/sqrt(3))arctan(2(z + 1/2)/sqrt(3)) + C
= (2/sqrt(3))arctan((2z + 1)/sqrt(3)) + C }}}
Substituting back in for z we get:
{{{(2/sqrt(3))arctan(2(tan((1/2)x) + 1)/sqrt(3)) + C }}}
of, if you like rationalized denominators:
{{{(2sqrt(3)/3)arctan(2sqrt(3)(tan((1/2)x) + sqrt(3))/3) + C }}}
the derivative of which, believe it or not, is {{{1/(2+sin(x))}}}!