<s>[INST] Some problems with evaluating $\int_0^{\pi}\ln(\sin x+\sqrt{1+\sin^2x})dx$ I'm trying to evaluate
$$\int_{0}^{\pi}\ln\left(\sin\left(x\right) + \sqrt{\,1 + \sin^{2}\left(x\right)\,}\,\right)\,{\rm d}x .
$$
I tried to evaluate it by making the substitution $u =\sin x$, but I faced a problem. 
Since $\sin\left(\pi\right) = \sin\left(0\right) = 0$, the integral is equal to $0$. But by plotting the integrand, the integral seems to have a real non-zero value. 
To avoid this problem I expressed the integral as  $ \displaystyle 2\int_{0}^{\pi/2} \ln\left(\sin\left(x\right) + \sqrt{\,1 + \sin^{2}\left(x\right)\,}\,\right)\,{\rm d}x $. Then I tried letting  $u = \sin x$.
How do you explain that the integral has a real non-zero value but by some substitution it's equal to zero?
And how does one evaluate the integral?
 [/INST] Using the Taylor expansion of $\text{arcsinh} (x)$ at $x=0$,
$$ \begin{align} \int_{0}^{\pi} \ln (\sin x + \sqrt{1+ \sin^{2} x}) \ dx &= \int_{0}^{\pi} \text{arcsinh}(\sin x) \ dx \\ &= 2 \int_{0}^{\pi/2} \text{arcsinh}(\sin x) \ dx \\ &= 2 \int_{0}^{\pi /2} \sum_{n=0}^{\infty} (-1)^{n} \binom{2n}{n} \frac{\sin^{2n+1}x}{2^{2n}(2n+1)} \ dx \\ &= 2 \sum_{n=0}^{\infty} (-1)^{n} \binom{2n}{n} \frac{1}{2^{2n}(2n+1)} \int_{0}^{\pi/2} \sin^{2n+1}(x) \ dx \\ &= 2 \sum_{n=0}^{\infty} (-1)^{n} \binom{2n}{n} \frac{1}{2^{2n}(2n+1)} \frac{1}{2n+1}\frac{2^{2n}}{\binom{2n}{n}} \tag{1}  \\ &=2 \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^{2}} = 2 G  \end{align}$$
where $G$ is Catalan's constant.
$(1)$ 
The integral $ \displaystyle \int_{0}^{\pi /2} \sin^{2n+1} x \ dx $ can be evaluated by relating it to the beta function and then using the gamma duplication formula.
Specifically, 
$$ \begin{align} \int_{0}^{\pi /2} \sin^{2n+1} x \ dx &= \int_{0}^{\pi/2} \sin^{2(n+1)-1} (x) \cos^{2(1/2)-1} (x) \ dx \\ &= \frac{1}{2} B \left(n+1,\frac{1}{2} \right) \\ &= \frac{1}{2} \frac{\Gamma(n+1) \Gamma(\frac{1}{2})}{\Gamma(n+\frac{3}{2})} = \frac{1}{2} \frac{\Gamma(n+1) \Gamma(\frac{1}{2})}{(n+\frac{1}{2})\Gamma(n+\frac{1}{2})} \\ &= \frac{\Gamma(n+1) \Gamma(\frac{1}{2})}{2n+1} \frac{2^{2n-1} \Gamma(n)}{\Gamma(2n) \Gamma(1/2)} \frac{2n}{2n} \\ &= \frac{1}{2n+1} 2^{2n} \frac{\Gamma(n+1) \Gamma(n+1)}{\Gamma(2n+1)} \\ &= \frac{1}{2n+1} \frac{2^{2n}}{\binom{2n}{n}} . \end{align} $$
</s>