Definite integral evaluation of $\frac{\sin^2 x}{2^x + 1}$ 
Compute
$$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{2^x + 1} \ dx.$$

So looking at the limits I first checked whether the function is even or odd by substituting $x = -x$ but this gave me:
$$\frac{\sin^2 x}{2^x + 1} \cdot 2^x$$
so the function is clearly neither odd or even and I don't know what to infer from this. I can't think of a good substitution either.
Any help would be appreciated!
 A: You did the right thing. Using your substitution, you have
$$
I = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{2^x + 1} \ dx = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{2^x + 1} 2^x \ dx.
$$
Adding the two equivalent formulations you have
$$
2 I = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{2^x + 1} (2^x +1) \ dx
= \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}{\sin^2 x} \ dx = \int_0^{\frac{\pi}{2}} (1-\cos(2x))\ dx=\frac{\pi}{2}$$
which gives $I = \frac{\pi}{4}$ as the answer.
A: This video provides a formula that is very useful in your case, check the video for a proof: https://www.youtube.com/watch?v=xiIsPEqyTqU
$$\int_{-a}^{a} \frac{E(x)}{t^{O(x)} + 1} \ dx = \int_{0}^{a} E(x) \ dx$$
where $E(x)$ and $t$ are even functions, and $O(x)$ is an odd function. In your case: $\sin^2(x)=E(x); x = O(x)$, and so your integral simplifies to:
$$\int_{0}^{\pi/2} \sin^2(x) \ dx = \pi/4$$
A: Let $$\;I=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \dfrac{\sin^2 x}{2^x+1} dx\;.$$
By substituting $\;x\to -x\;$ we get that $$I=-\int_{\frac{\pi}{2}}^{-\frac{\pi}{2}} \dfrac{\sin^2 x}{2^{-x}+1} dx=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \dfrac{2^x\sin^2 x}{2^x+1} dx=\\=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\left(\sin^2 x -\dfrac{\sin^2 x}{2^x+1}\right)dx=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\sin^2 x\ dx-I\;.$$
Since
$$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\sin^2 x\ dx=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\dfrac{1-\cos(2x)}{2}dx=\\=\frac{x}{2}-\dfrac{\sin(2x)}{4}\bigg|_{-\frac{\pi}{2}}^{\frac{\pi}{2}}=\cfrac{\pi}{2}\;,$$
we get that $\;I=\cfrac{\pi}{2}-I\;,\;$ hence
$I=\cfrac{\pi}{4}\;.$
