# Integrate $\int_{0}^{\pi/2}{\frac{x\cos\left(x\right)-\sin\left(x\right)}{\sin\left(x\right)+x^2}}dx$

$$\int_{0}^{\pi/2}{\dfrac{x\cos\left(x\right)-\sin\left(x\right)}{\sin\left(x\right)+x^2}}dx$$

I am unable to exploit the properties of definite integral, neither it seems that indefinite integration is possible.

• It came last year in of the tests of my senior. Answer given is $\arctan(2/\pi)-\pi/4$ – Zenix Nov 2 '19 at 14:53
• Doesn't seem too nice to me. Have you investigated Taylor's expansions? – Certainly not a dog Nov 2 '19 at 14:54
• I suspect it is $\sin^2x +x^2$ in the denominator of the integrand. – Omran Kouba Nov 2 '19 at 15:12

As suggested in the comments I believe you meant to write \begin{align} \int_0^{\pi/2}\frac{x\cos{(x)}-\sin{(x)}}{\sin^2{(x)}+x^2}\mathrm{d}x &=\int_0^{\pi/2}\frac{x\csc{(x)}\cot{(x)}-\csc{(x)}}{1+x^2\csc^2{(x)}}\mathrm{d}x\\ &=-\int_0^{\pi/2}\frac{\csc{(x)}-x\csc{(x)}\cot{(x)}}{1+(x\csc{(x)})^2}\mathrm{d}x\\ &=-\int_0^{\pi/2}\frac{(x\csc{(x)})'}{1+(x\csc{(x)})^2}\mathrm{d}x\\ &=-[\arctan{(x\csc{(x)})}]_0^{\pi/2}\\ &=-\arctan{\left(\frac{\pi}2\csc{\left(\frac{\pi}2\right)}\right)}+\lim_{x\to0^+}\arctan{(x\csc{(x)})}\\ &=-\arctan{\left(\frac{\pi}2\right)}+\lim_{x\to0^+}\arctan{\left(\frac1{\sin{(x)}/x}\right)}\\ &=-\arctan{\left(\frac{\pi}2\right)}+\arctan{\left(\lim_{x\to0^+}\frac1{\sin{(x)}/x}\right)}\\ &=-\arctan{\left(\frac{\pi}2\right)}+\arctan{(1)}\\ &=-\left(\frac{\pi}2-\arctan{\left(\frac2{\pi}\right)}\right)+\frac{\pi}4\\ &=\arctan{\left(\frac2{\pi}\right)}-\frac{\pi}4\\ \end{align} Where I have used the identities $$\lim_{x\to0}\frac{\sin{(x)}}x=1$$ $$\arctan{(x)}+\arctan{\left(\frac1x\right)}=\frac{\pi}2\quad\forall x\gt0$$ and the fact that both $$\arctan{(x)}$$ and $$1/x$$ are continuous at $$1$$.
• It was $sinx$ in denominator though. I think question was wrong then – Zenix Nov 2 '19 at 15:36
• @Zenix If it was actually $\sin{(x)}$ then the answer is incorrect. See here for example. – Peter Foreman Nov 2 '19 at 15:38