Solve the following trigonometric integral Calculate:
$$\int _{0}^{\pi }\cos(x)\log(\sin^2 (x)+1)dx$$
 A: Behold the power of symmetry:
$$\cos(\pi - x) = - \cos x\quad\text{and} \quad \sin (\pi - x) = \sin x,$$
therefore
\begin{align}
\int_0^\pi \cos x \log (\sin^2 x + 1) \,dx &= \int_0^\pi \cos (\pi - u)\log (\sin^2(\pi - u) + 1)\,du\\
&= - \int_0^\pi \cos u\log (\sin^2 u + 1)\,du,
\end{align}
hence the integral evaluates to $0$.
A: $$\int\cos x\ln(1+\sin^2x)\ dx$$
$$=\ln(1+\sin^2x)\int\cos x\ dx-\int\left(\dfrac{d\ \ln(1+\sin^2x)}{dx}\int\cos x\ dx\right)dx$$
$$=\sin x\cdot\ln(1+\sin^2x)-\int\dfrac{2\sin^2x\cos x}{1+\sin^2x}dx$$
$$\int\dfrac{2\sin^2x\cos x}{1+\sin^2x}dx=\int\dfrac{2(1+\sin^2x-1)\cos x}{1+\sin^2x}dx=2\int\cos x\ dx-2\int\dfrac{\cos x}{1+\sin^2x}dx$$
Set $\sin x=u$ for the last integral
A: HINT: Substitute $y=\sin(x), y' = \cos(x)$. Then use $w^2+1 = (1+iw)(1-iw)$ and logarithm laws. The integral over logarithm is easy to find in integral tables.
A: $$\int_0^\pi \cos(x) \log(\sin^2(x)+1)dx$$
The first thing we want to do is to remove the $\log$ from the integral. Performing integration by parts we set $u=\log(\sin^2(x)+1)$ and $dv=\cos(x)dx$ to find $du = \frac{2\sin(x)\cos(x)}{\sin^2(x)+1} dx$ and $v = \sin(x)$.
Thus the integral transforms to $$\left.\sin(x)\log(\sin^2(x)+1)\right|_0^\pi - \int_0^\pi \frac{2\sin^2(x)\cos(x)}{\sin^2(x)+1} dx=0- \int_0^\pi \frac{2\sin^2(x)\cos(x)}{\sin^2(x)+1} dx$$
Now let us shift the integral by $\pi/2$, replace $x=u+\pi/2$ to find:
$$-\int_0^\pi \frac{2\sin^2(x)\cos(x)}{\sin^2(x)+1} dx = -\int_{-\pi/2}^{\pi/2} \frac{2\sin^2(u+\pi/2)\cos(u+\pi/2)}{\sin^2(u+\pi/2)+1} dx = \int_{-\pi/2}^{\pi/2} \frac{2\cos^2(u)\sin(u)}{\cos^2(u)+1} dx$$
Now notice that $\frac{2\cos^2(x)}{\cos^2(x)+1}$ is even and $\sin(x)$ is odd, thus their product is odd. The integration is happening over a symmetric interval, so $$\int_{-\pi/2}^{\pi/2} \frac{2\cos^2(u)\sin(u)}{\cos^2(u)+1} dx=0.$$
A: This answer is in the same vein as Daniel Fischer's, but presented differently.
Make the substitution $u = x - \pi/2$. Then the integral becomes
$$-\int_{-\pi/2}^{\pi/2} \sin u \log(1 + \cos^2 u) \, du,$$
which is the integral of an odd function over $[-\pi/2,\pi/2]$. Therefore the integral is zero.
