1. Big problem with integral

$\int\frac{sinx}{cosx-2sinx+2}dx$
I found the following relations:
$tan\frac{x}{2}=t$
$sinx=\frac{2t}{1+t^2}$
$cosx=\frac{1-t^2}{1+t^2}$
$dx=\frac{dt}{1+t^2}$
Then I did substitutions and got:
$\int\frac{(1-t^2)+2(1+t^2)-4t}{2t(1+t^2)}dt=\int\frac{t^2-4t+3}{2t(1+t^2)}$
Then:
$t^2-4t+3=A(1+t^2)+(Mt+N)2t$
Got that:
$A=3$
$M=-1$
$N=4$
Thus:
$\int\frac{t^2-4t+3}{2t(1+t^2)}dt=\int\frac{A}{2t}+\int\frac{Mt+N }{1+t^2}=\frac{3}{2}\int\frac{dt}{t}-\int\frac{tdt}{1+t^2}+4\int\frac{dt}{1+t^2}$

Am I very lost ?
It doesn't seem to work out according to math book answer

2. Hello, totalnewbie!

Your substitution is off . . .

$\int\frac{\sin x\,dx}{\cos x-2\sin x+2}$

I found the following relations:
$\tan\frac{x}{2}=t\qquad \sin x=\frac{2t}{1+t^2} \qquad \cos x=\frac{1-t^2}{1+t^2} \qquad dx = \frac{dt}{1+t^2}$

Substitute: . $\int\frac{\frac{2t}{1+t^2}\cdot\frac{2\,dt}{1+t^2} }{\frac{1-t^2}{1+t^2} - \frac{4t}{1+t^2} + 2}$ $= \;\int\frac{\frac{4t\,dt}{(1+t^2)^2}}{\frac{t^2 - 4t + 3}{1 + t^2}}$ $= \;\int\frac{4t\,dt}{(t-1)(t-3)(t^2+1)}$

Use partial fractions: . $\frac{4t}{(t-1)(t-3)(t^2+1)}\;=\;\frac{A}{t-1} + \frac{B}{t-3} + \frac{Ct + D}{t^2+1}$

. . I got: . $A = -1,\;B = \frac{3}{5},\;C = \frac{2}{5},\;D = -\frac{4}{5}$

Integrate: . $-\!\int\frac{dt}{t-1} \;+\;\frac{3}{5}\!\int\frac{dt}{t-3} \;+ \;\frac{2}{5}\!\int\frac{t\,dt}{t^2+1} \;- \;\frac{4}{5}\!\int\frac{dt}{t^2+1}$

3. Originally Posted by Soroban
Hello, totalnewbie!

Your substitution is off . . .

Substitute: . $\int\frac{\frac{2t}{1+t^2}\cdot\frac{2\,dt}{1+t^2} }{\frac{1-t^2}{1+t^2} - \frac{4t}{1+t^2} + 2}$ $= \;\int\frac{\frac{4t\,dt}{(1+t^2)^2}}{\frac{t^2 - 4t + 3}{1 + t^2}}$ $= \;\int\frac{4t\,dt}{(t-1)(t-3)(t^2+1)}$

Use partial fractions: . $\frac{4t}{(t-1)(t-3)(t^2+1)}\;=\;\frac{A}{t-1} + \frac{B}{t-3} + \frac{Ct + D}{t^2+1}$

. . I got: . $A = -1,\;B = \frac{3}{5},\;C = \frac{2}{5},\;D = -\frac{4}{5}$

Integrate: . $-\!\int\frac{dt}{t-1} \;+\;\frac{3}{5}\!\int\frac{dt}{t-3} \;+ \;\frac{2}{5}\!\int\frac{t\,dt}{t^2+1} \;- \;\frac{4}{5}\!\int\frac{dt}{t^2+1}$
Something is wrong with constants.
Book gives the following constants:-1, 3/5, -2/5, 1/5

4. Hello, totalnewbie!

Something is wrong with constants.
Book gives the following constants: -1, 3/5, -2/5, 1/5

Then something is wrong with the book.

My constants check out . . . Theirs don't!

5. Originally Posted by Soroban
Hello, totalnewbie!

Then something is wrong with the book.

My constants check out . . . Theirs don't!

You have got 4tdt. It must be 2tdt.

And checking out if we have 4t instead of 2t...
We have 4t=A(t-3)(t*t+1)+B(t-1)(t*t+1)+(Ct+D)(t-1)(t-3)
Substitute your A, B, C and D.
And then take t as 2, you can see that they are not equal.
If you take t as 100, they are equal.

I dont get the point.

6. I really need help with this excercise.

7. Originally Posted by totalnewbie
$\int\frac{sinx}{cosx-2sinx+2}dx$
I found the following relations:
$\tan\frac{x}{2}=t$
$\sin x=\frac{2t}{1+t^2}$
$\cos x=\frac{1-t^2}{1+t^2}$
$dx=\frac{dt}{1+t^2}$
The above all checks out. Now the substitution and simplification is a bit
to complex to be done reliably so doing it mechanicaly what you should end
up with is shown in the attachment.

This is what soroban gets for this, but with a factor of 2 rather than 4.

The partial fraction expansion is also shown in the attachment, but this
is again different from your book

RonL