# Solve the following trigonometric integral [closed]

Calculate:

$$\int _{0}^{\pi }\cos(x)\log(\sin^2 (x)+1)dx$$

-

## closed as off-topic by heropup, Claude Leibovici, probablyme, user26857, G. SassatelliFeb 6 at 9:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – heropup, Claude Leibovici, probablyme, user26857, G. Sassatelli
If this question can be reworded to fit the rules in the help center, please edit the question.

Make the substitution $u = \pi - x$ and see what follows. No complicated calculations necessary. – Daniel Fischer Feb 5 at 16:47

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$.

-
nice..............+1 – Bhaskara-III Feb 5 at 18:12
You were inspired by Daniel Fischer's comment. ;-)) +1 – Dr. MV Feb 5 at 19:55

$$\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

-

$$\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.$$

-

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.

-

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.

-