Let y=x²+1, then dy=2xdx, so xdx=dy/2.

The integrand simplifies:

[(2sin(y)-sin(2y))/(sin(2y)+2sin(y))](dy/2)=

[(2sin(y)-2sin(y)cos(y))/(2sin(y)cos(y)+2sin(y)](dy/2)=

Cancel common factor sin(y):

(1-cos(y))/(2(1+cos(y)))dy=

Multiply by (1-cos(y))/(1-cos(y)):

(1-cos(y))²/(2(1-cos²(y)))dy=

(1-cos(y))²/(2sin²(y))dy=

(1-2cos(y)+cos²(y))/(2sin²(y))dy=

(csc²(y)/2-cot(y)csc(y)+cot²(y)/2)dy.

Derivative of cot(y) is -csc²(y).

Derivative of csc(y) is -cot(y)csc(y).

cot²(y)=csc²(y)-1.

∫(csc²(y)/2-cot(y)csc(y)+cot²(y)/2)dy=

∫(csc²(y)/2-cot(y)csc(y)+(csc²(y)-1)/2)dy=

∫(csc²(y)-cot(y)csc(y)-½)dy=

-cot(y)+csc(y)-y/2+c, where c is the constant of integration.

Replacing y with x²+1:

-cot(x²+1)+csc(x²+1)-(x²+1)/2+c or -cot(x²+1)+csc(x²+1)-x²+C (combining constants).