Use the substitution u=tan(x/2)
2du=sec^2(x/2) dx
dx=2du/(1+u^2)
2*Int (1-u^2)/[(1+u^2)(1+2u-u^2)] du
-(u^2-2u)+1=-(u-1)^2+2=-(u-1+sqrt(2))(u-1-sqrt(2)), thus:
2*Int (1-u^2)/[(1+u^2)(u-1+sqrt(2))(u-1-sqrt(2)] du
Partial fractions:
(1-u^2)/[(1+u^2)(u-1+sqrt(2))(u-1-sqrt(2)]
=
A/(u-1-sqrt(2)) + B/(u-1+sqrt(2)) + (Cu+D)/(1+u^2)
You know what? I think I'll let you solve that. It is solvable. Even if you end up with E/(1+u^2) - use the substitution u=tan(v) to get Int Ecos^2(v) (and remember the double-angle formula).
I looks like you'll to get some mix of the cosine of inverse tan + the log of tangents, and remember that even once you get an answer in u, you still have to sub in u=tan(@/2).
If they ask this in an exam, I'll eat my keyboard.