<s>[INST] $\int_{0}^{\pi}(\sqrt{x^2+\sin^2x}+\cos x\sin x\ln(x+\sqrt{x^2+\sin^2x}))\mathrm{d}x=\frac{\pi^2}{2}$ with one-variable calculus solution Prove that $$\int_{0}^{\pi}(\sqrt{x^2+\sin^2x}+\cos x\sin x\ln(x+\sqrt{x^2+\sin^2x}))\mathrm{d}x=\frac{\pi^2}{2}$$
My textbook says that we need to note that the integral can be transformed into $\int_L (\sqrt{x^2+y^2}\mathrm{d}x+y\ln(\sqrt{x^2+y^2}+x)\mathrm{d}y)$, where $L: y=\sin x$, $0\leq x\leq\pi$. We denote $\sqrt{x^2+y^2}$ by $P(x,y)$, and  $y\ln(\sqrt{x^2+y^2}+x)$ by $Q(x,y)$. And then it is not hard to compute $\int_l P\mathrm{d}x+Q\mathrm{d}y$, where $l:(0\leq x\leq\pi\wedge y=0)$, as well as  $\int_{l+L} P\mathrm{d}x+Q\mathrm{d}y$ (by Green's formula), (all the directions here are omitted, but it should make no ambiguity). Hence the question is done. I think this method is hard to observe. Do we have a way merely apply theorems of one-variable calculus? I have observed that $\cos x\sin x\ln(x+\sqrt{x^2+\sin^2x})=\cos x\sin x(2\ln\sin x-\ln(x+\sqrt{x^2+\sin^2x}))$, and $\cos x\sin x\ln\sin x=(\sin x\ln\sin x)(\sin x)'$, hence its indefinite integral is computable. I do not know if this observation would help.
 [/INST] Using the integration by parts, you have
\begin{eqnarray}
&&\int(\sqrt{x^2+\sin^2x}+\cos x\sin x\ln(x+\sqrt{x^2+\sin^2x}))\mathrm{d}x\\
&=&\int\sqrt{x^2+\sin^2x}dx+\frac12\int_{0}^{\pi}\ln(x+\sqrt{x^2+\sin^2x}))\mathrm{d}\sin^2x\\
&=&\int\sqrt{x^2+\sin^2x}dx+\frac12\bigg(\sin^2x\ln(x+\sqrt{x^2+\sin^2x})-\int\frac{\sin^2x(1+\frac{x+\sin x\cos x}{\sqrt{x^2+\sin^2x}})}{x+\sqrt{x^2+\sin^2x}}\mathrm{d}x\bigg).
\end{eqnarray}
Now combining these two integrals and simplifying will give the primitive.
</s>