Compute $\int_0^1\frac{f(x)}{f(x)+f(1-x)}dx$ and $\int_{-\pi}^{\pi}\frac{1}{1+e^{\sin (x)}}\,dx$? Problem
a) $f:[0,1]\rightarrow\Bbb{R}$ is an positive continuous function. Find the value of the intgral: 
$$\int_0^1\frac{f(x)}{f(x)+f(1-x)}dx$$
b) And compute $$\int_{-\pi}^{\pi}\frac{1}{1+e^{\sin (x)}}\,dx$$ 
(Hint for task b: Let $f(x)=e^{-\frac{1}{2}\sin (2\pi x-\pi)}$ in task a and use the substisution $u=2\pi*x-\pi$.)
My Work
a) I have realized that $f(1-x)=f(a+b-x)$, but i don`t know how to proceed.
b) I tried to use the hint, I still don't understand how to solve the problem. This is what I end up with: 
$$\int\frac{e^{-\frac{1}{2}\sin u}}{e^{-\frac{1}{2}\sin u}+e^{\frac{1}{2}\sin u}} $$
Any help is welcome.
 A: HINT:
Show by making the substitution $x\mapsto-x$ that 
$$\int_{-\pi}^0 \frac1{1+e^{\sin(x)}}\,dx=\int_0^\pi \frac{e^{\sin(x)}}{1+e^{\sin(x)}}\,dx$$
Can you finish now?
A: Replace $x$ with $-z$ and observe that$$\begin{align*}\int\limits_{-\pi}^{\pi}\frac {\mathrm dx}{1+e^{\sin x}} & =\int\limits_{-\pi}^{\pi}\frac {\mathrm dz}{1+e^{-\sin z}}\\ & =\int\limits_{-\pi}^{\pi}\mathrm dz\,\frac {e^{\sin z}}{1+e^{\sin z}}\end{align*}$$Calling the integral $I$ and add the two forms together to get$$\begin{align*}2I & =\int\limits_{-\pi}^{\pi}\mathrm dx\\ & =2\pi\end{align*}$$Thus$$\int\limits_{-\pi}^{\pi}\frac {\mathrm dx}{1+e^{\sin x}}\color{blue}{=\pi}$$

To answer your first question, the integral can be evaluated using a similar trick as above. Make the substitution $x=1-z$ and observe that$$\mathfrak{I}=\int\limits_0^1\mathrm dx\,\frac {f(x)}{f(x)+f(1-x)}=\int\limits_0^1\mathrm dz\,\frac {f(1-z)}{f(1-z)+f(z)}$$Since $z$ is a dummy variable in the second integral, we can combine the two integrals together to get$$\begin{align*}\mathfrak{I} & =\frac 12\int\limits_0^1\mathrm dx\,\frac {f(x)+f(1-x)}{f(1-x)+f(x)}\\ & =\frac 12\end{align*}$$
A: Hint:
$$I=\int_a^bf(x)dx=\int_a^bf(a+b-x)dx$$
and $$2I=\int_a^bf(x)+f(a+b-x)dx$$
A: This is a "look why i know" answer (instead of a "look what i know" one, which is usually simpler). The hint i always give is to plot the function. A raw plot as the one below is enough:
? plot(x=-Pi,Pi, 1/(1+exp(sin(x))))

0.7309975 |'''''''''''_x""""xx_''''''''''''''''''''''''''''''''''''''''''|
          |         _"         x_                                        |
          |       _"             x                                       |
          |      _                "                                      |
          |     x                  "                                     |
          |    x                    "_                                   |
          |   x                                                          |
          |  x                        "                                  |
          | _                          "                                 |
          |_                            "                                |
          _                              x                               _
          |                               x                              |
          |                                _                            "|
          |                                 _                          " |
          |                                  _                        x  |
          |                                                          x   |
          |                                   "_                    x    |
          |                                     _                  x     |
          |                                      _                "      |
          |                                       x             _"       |
          |                                        "x         _"         |
0.2690025 |.........................................."xx____x"...........|
          -3.141593                                               3.141593
? 

We collect from it the information that for $f:[-\pi,\pi]\to\Bbb R$, $f(x)=1/(1+\exp\sin x)$ we have $f(\pm\pi)=1/(1+\exp0)=1/2$ and that "with respect to the $1/2$ shift on the $y$-axis" we (may) get an odd function. So let us set  $g(x)=f(x) - 1/2$, and see if it is an odd function, $g(-x)=-g(x)$, which may be a surprise first. So we compute 
$$
\begin{aligned}
g(x) 
&= \frac 1{1+e^{\sin x}}-\frac 12
\\
&= \frac 12\cdot \frac {1-e^{\sin x}}{1+e^{\sin x}}\ ,
\\[2mm]
&\qquad\text{and}
\\[2mm]
g(-x)
&= \frac 12\cdot \frac {1-e^{-\sin x}}{1+e^{-\sin x}}
\\
&= \frac 12
\cdot \frac {e^{\sin x}-1}{e^{\sin x}+1}
\cdot \frac {e^{-\sin x}}{e^{-\sin x}}
\\
&= \frac 12
\cdot \frac {e^{\sin x}-1}{e^{\sin x}+1}
\\
&=-g(x)\ .
\end{aligned}
$$
Now for the symmetric interval (w.r.t. the origin) $J=[-\pi,\pi]$ we can relate $\int_Jf$ and $\int_J g=0$ easily.
