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
 A: $$\mathcal{J}=\int_0^{\frac{\pi}{4}}\frac{1+\cos x-x^{2}}{(1+x\sin x)\sqrt {1-x^{2}}}\,dx=\int_0^{\frac{\pi}{4}} \color{red}{\frac{1+x\sin{x}}{\cos{x}\sqrt{1-x^2}}} \cdot \color{blue}{\frac{\cos{x} \left(1+\cos x-x^{2}\right)}{(1+x\sin x)^2}\,dx}$$
If $\displaystyle t=\frac{\sin{x}+x}{1+x\sin{x}} \text{ then }\color{blue}{dt=\frac{\cos{x}\left(1+\cos{x}-x^2\right)}{\left(1+x\sin{x}\right)^2} dx}$, and:
\begin{align*}
\color{red}{\frac{1+x\sin{x}}{\cos{x}\sqrt{1-x^2}}} &= \frac{1+x\sin{x}}{\sqrt{(1-\sin^2{x})(1-x^2)}}\\
&= \frac{1+x\sin{x}}{\sqrt{\left(1+x\sin{x}\right)^2-\left(\sin{x}+x\right)^2}}\\
&= \frac{1}{\sqrt{1-\left(\frac{\sin{x}+x}{1+x\sin{x}}\right)^2}} \\
&= \color{red}{\frac{1}{\sqrt{1-t^2}} }
\end{align*}
Putting this together,
\begin{align*}
\mathcal{J}&=\int_0^{\frac{\pi}{4}} \color{red}{\frac{1+x\sin{x}}{\cos{x}\sqrt{1-x^2}}} \cdot \color{blue}{\frac{\cos{x} \left(1+\cos x-x^{2}\right)}{(1+x\sin x)^2}\,dx} \\&=\int_0^{\frac{4+\pi \sqrt{2}}{\pi + 4\sqrt{2}}} \frac{dt}{\sqrt{1-t^2}}  \\
&= \color{green}{\boxed{\arcsin{\left(\frac{4+\pi \sqrt{2}}{\pi + 4\sqrt{2}}\right)}}}
\end{align*}
A: 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}
A: As  Simply Beautiful Art commented, it would be very surprising to find a closed form for this integral.
So, either numerical integration or series expansions built at $x=0$. The latest would give
$$\frac{1+\cos x-x^{2}}{(1+x\sin x)\sqrt {1-x^{2}}}=2-\frac{5 x^2}{2}+\frac{23 x^4}{8}-\frac{2323 x^6}{720}+\frac{17113
   x^8}{4480}-\frac{5186177 x^{10}}{1209600}+O\left(x^{12}\right)$$ which would lead to something which evaluates as $1.27486$ (which is not very good).
Pushing the expansion up to $O\left(x^{24}\right)$ would give $1.28486$ (a lot of effort for a difference of 0.01 only !).
