Solution:
Key idea: The general property ∫ a b f ( x ) d x = ∫ a b f ( a + b − x ) d x \displaystyle\int_a^b f(x)\,dx = \int_a^b f(a+b-x)\,dx ∫ a b f ( x ) d x = ∫ a b f ( a + b − x ) d x lets us replace x x x by a + b − x a + b - x a + b − x . Here the limits π 4 \dfrac{\pi}{4} 4 π and 3 π 4 \dfrac{3\pi}{4} 4 3 π add up to π \pi π , and sin ( π − x ) = sin x \sin(\pi - x) = \sin x sin ( π − x ) = sin x , so the swap removes the factor x x x .
Step 1 — Apply the property.
Let I I I be the given integral. We replace x x x by π − x \pi - x π − x .
I = ∫ π / 4 3 π / 4 π − x 1 + sin x d x = π ∫ π / 4 3 π / 4 d x 1 + sin x − I \begin{aligned}
I &= \int_{\pi/4}^{3\pi/4}\dfrac{\pi - x}{1+\sin x}\,dx \\
&= \pi\int_{\pi/4}^{3\pi/4}\dfrac{dx}{1+\sin x} - I
\end{aligned} I = ∫ π /4 3 π /4 1 + sin x π − x d x = π ∫ π /4 3 π /4 1 + sin x d x − I
Step 2 — Solve for I I I .
We move I I I to the left side.
2 I = π ∫ π / 4 3 π / 4 d x 1 + sin x 2I = \pi\int_{\pi/4}^{3\pi/4}\dfrac{dx}{1+\sin x} 2 I = π ∫ π /4 3 π /4 1 + sin x d x
Step 3 — Find an antiderivative of 1 1 + sin x \dfrac{1}{1+\sin x} 1 + sin x 1 .
We check by differentiation, using sin 2 x + cos 2 x = 1 \sin^2 x + \cos^2 x = 1 sin 2 x + cos 2 x = 1 .
d d x ( − cos x 1 + sin x ) = sin x + sin 2 x + cos 2 x ( 1 + sin x ) 2 = 1 1 + sin x \begin{aligned}
\dfrac{d}{dx}\left(-\dfrac{\cos x}{1+\sin x}\right) &= \dfrac{\sin x + \sin^2 x + \cos^2 x}{(1+\sin x)^2} \\
&= \dfrac{1}{1+\sin x}
\end{aligned} d x d ( − 1 + sin x cos x ) = ( 1 + sin x ) 2 sin x + sin 2 x + cos 2 x = 1 + sin x 1
Step 4 — Value at the upper limit.
At x = 3 π 4 x = \dfrac{3\pi}{4} x = 4 3 π , cos x \cos x cos x is − 2 2 -\dfrac{\sqrt{2}}{2} − 2 2 and sin x \sin x sin x is 2 2 \dfrac{\sqrt{2}}{2} 2 2 . We multiply the top and bottom by 2 − 2 2 - \sqrt{2} 2 − 2 to rationalise.
− cos x 1 + sin x = 2 2 1 + 2 2 = 2 2 + 2 = 2 ( 2 − 2 ) 2 = 2 − 1 \begin{aligned}
-\dfrac{\cos x}{1+\sin x} &= \dfrac{\frac{\sqrt{2}}{2}}{1+\frac{\sqrt{2}}{2}} \\
&= \dfrac{\sqrt{2}}{2+\sqrt{2}} \\
&= \dfrac{\sqrt{2}(2-\sqrt{2})}{2} \\
&= \sqrt{2}-1
\end{aligned} − 1 + sin x cos x = 1 + 2 2 2 2 = 2 + 2 2 = 2 2 ( 2 − 2 ) = 2 − 1
Step 5 — Value at the lower limit.
At x = π 4 x = \dfrac{\pi}{4} x = 4 π , cos x \cos x cos x is + 2 2 +\dfrac{\sqrt{2}}{2} + 2 2 and sin x \sin x sin x is again 2 2 \dfrac{\sqrt{2}}{2} 2 2 , so only the sign changes.
− cos x 1 + sin x = − ( 2 − 1 ) -\dfrac{\cos x}{1+\sin x} = -(\sqrt{2}-1) − 1 + sin x cos x = − ( 2 − 1 )
Step 6 — Finish.
We subtract the lower value from the upper value and divide by 2.
2 I = π [ ( 2 − 1 ) + ( 2 − 1 ) ] = 2 π ( 2 − 1 ) \begin{aligned}
2I &= \pi\big[(\sqrt{2}-1) + (\sqrt{2}-1)\big] \\
&= 2\pi(\sqrt{2}-1)
\end{aligned} 2 I = π [ ( 2 − 1 ) + ( 2 − 1 ) ] = 2 π ( 2 − 1 )
I = π ( 2 − 1 ) I = \pi(\sqrt{2}-1) I = π ( 2 − 1 )
Therefore, ∫ π / 4 3 π / 4 x 1 + sin x d x = π ( 2 − 1 ) \displaystyle\int_{\pi/4}^{3\pi/4}\dfrac{x}{1+\sin x}\,dx = \pi(\sqrt{2}-1) ∫ π /4 3 π /4 1 + sin x x d x = π ( 2 − 1 ) , as required.