How to integrate dx/(4-5 sin x) using t-substitution method(i.e. taking tan x/2=t)?

sin(x) = sin[2(x/2)] =

2 sin(x/2) cos(x/2)

Draw a right triangle with one angle equal to x/2. If you make the length of the side opposite to that angle equal to
t = tan(x/2) then the length of the side side orthogonal to it that connects to that angle will be equal to 1, because ratio of the two sides must be equal to tan(x/2) = t.

This means that the length of the hypotenuse is equal to:

h = sqrt(1+t^2)

and you have that:

sin(x/2) = t/sqrt(1+t^2)

cos(x/2) = 1/sqrt(1+t^2)

Therefore:

sin(x) = 2 t/(1+t^2)

And:

x = 2 arctan(t) ------>

dx = 2dt/(1+t^2)

This gives:

dx/(4-5 sin x)

2 dt/(1+t^2) 1/[4 - 10 t/(1+t^2)] =

dt/[2+2 t^2 -5t] =

dt/[2(t-1/2)(t-2)] =

dt/(t-1/2) * 1/[2* (1/2 - 2)] +

dt/[(t-2)] * 1/[2* (2-1/2)]

Integrating gives:

-1/3 Log|t-1/2| + 1/3 Log|t-2| =

1/3 Log|[tan(x/2) - 2]/[tan(x/2) -1/2]|

To integrate the given expression, you can use the t-substitution method by letting:

tan(x/2) = t

Now we need to express dx in terms of dt. Since:
tan(x/2) = t

Taking the derivative of both sides with respect to x using the chain rule, we get:
sec^2(x/2) * (1/2) = dt/dx

Rearranging this equation, we have:
dt = sec^2(x/2) * (1/2) * dx

Next, we substitute the value of dx in the integral expression using dt:
dx = 2 * sec^2(x/2) * dt

Now, let's express the given integral in terms of t:
∫ dx / (4 - 5sin(x)) = ∫ dx / (4 - 5(2tan(x/2))/(1+tan^2(x/2)))
= ∫ dx / (4 - 10tan(x/2)/(1+tan^2(x/2)))
= ∫ dx / (4(1+tan^2(x/2)) - 10tan(x/2))
= ∫ (2 sec^2(x/2) * dt) / (4(1+tan^2(x/2)) - 10tan(x/2))
= ∫ (2 dt) / (4(1+t^2) - 10t).

Simplifying further:
∫ (2 dt) / (4(1+t^2) - 10t)
= ∫ (2 dt) / (4 + 4t^2 - 10t)
= ∫ (2 dt) / (4t^2 - 10t + 4).

Now, you can proceed to integrate this expression using partial fraction decomposition or completing the square method to obtain the final result.