<s>[INST] Evaluate $\int_0^{\frac{\pi}{4}}\frac{1+\cos x-x^{2}}{(1+x\sin x)\sqrt {1-x^{2}}}\,dx$ Find:
$$\int_0^{\frac{\pi}{4}}\frac{1+\cos x-x^{2}}{(1+x\sin x)\sqrt {1-x^{2}}}\,dx$$
I don't know how I starte & evaluate this integral
Wolfram alpha give $=1,28553$
My problem whene I use $t=\cos x$ I get $\arccos x$
Same problem with $t=\sin x$
If any one have idea please help me
 [/INST] Let $x=\sin t$ and $a= \sin^{-1}\frac\pi4$
$$I=\int_0^{\frac{\pi}{4}}\frac{1+\cos x-x^{2}}{(1+x\sin x)\sqrt {1-x^{2}}}\,dx = \int_0^a \frac{\cos ^2 t+\cos (\sin t)}{1+\sin t \sin (\sin t)} \, dt
$$
Use the shorthand $t_\pm=\frac 12 (t \pm {\sin t})$ to express the denominator and the numerator as
\begin{align}
1+ \sin t \sin (\sin t)&=1+\frac12[\cos(t-\sin t) - \cos(t+\sin t)]\\
&= \sin^2t_+  + \cos^2t_-\\
 \cos ^2t+\cos (\sin t)&=\cos t\cos(t_+ + t_-) + \cos(t_+ - t_-)
\\ &= 2 \cos t_- (\sin t_+)’ - 2\sin t_+ (\cos t_-)’
\end{align}
Then
\begin{align}
I& =2\int_0^a \frac {\cos t_- d(\sin t_+)-\sin t_+ d(\cos t_-)}{ \sin^2t_+  + \cos^2t_-}\\
& =-2\int_0^a \frac {d\left(\frac{\cos t_-}{\sin t_+}\right) }{ 1 + \left(\frac{\cos t_-}{\sin t_+}\right)^2} 
=2\cot ^{-1} \frac{\cos \left( \frac a2-\frac\pi8\right) }{\sin \left( \frac a2+\frac\pi8\right) }=1.28553
\end{align}
</s>