$ \int \sin 3x/(\sin x + \cos x)dx=1$ or $1-π/4$

definite integralsintegrationtrigonometric-integralstrigonometry

This question is from Cengage book

Q. $$ \int \sin 3x/(\sin x + \cos x)dx$$

The solution provided in the book is as follows:

Sol:

$I={\int_0^{\frac{\pi}{2}} \frac{\sin 3 x-\sin x}{\sin x+\cos x} d x (I1)}+{\int_0^{\frac{\pi}{2}} \frac{\sin x}{\sin x+\cos x} d x (I2)}$

$$
\begin{array}{l}
I_2=\int_0^{\frac{\pi}{2}} \frac{\sin x}{\sin x+\cos x} d x \\\\
I_2=\int_0^{\frac{\pi}{2}} \frac{\cos x}{\cos x+\sin x} d x
\end{array}
$$

Adding,we get
$$
2 I_2=\frac{\pi}{2}
$$

$$
\begin{aligned}
I_2 & =\frac{\pi}{4} \\\\
I_1 & =\int_0^{\frac{\pi}{2}} \frac{2(\cos 2 x) \sin x}{\sin x+\cos x} d x \\\\
& =2 \int_0^{\frac{\pi}{2}} \sin x(\cos x-\sin x) d x \\\\
& =\int_0^{\frac{\pi}{2}} \sin 2 x d x-\int_0^{\frac{\pi}{2}} 2 \sin ^2 x d x \\\\
& =\left[-\frac{\cos 2 x}{2}\right]_0^{\frac{\pi}{2}}-\int_0^{\frac{\pi}{2}}(1-\cos 2 x) d x\\\\
& =1-\frac{1}{2}\left[x-\frac{\sin 2 x}{2}\right]_0^{\frac{\pi}{2}} \\\\
& =1-\frac{\pi}{4}
\end{aligned}
$$

Therefore, $I=1$

My solution is as Follows:

We know that,
$$
\begin{array}{l}
\sin 3x = 3\sin x – 4\sin^3 x\\\\
I=\int_0^{\pi / 2} \frac{\sin 3 x}{\sin x+\cos x} d x\\\\
\therefore I=\int_0^{\pi / 2} \frac{3 \sin x-4 \sin ^3 x}{\sin x+\cos x}-(i) \\\\
\therefore I=\int_0^{\pi / 2} \frac{3 \cos x-4 \cos ^3 x}{\sin x+\cos x}-\text { (ii) }
\end{array}
$$

Adding (i) and (ii)
$$
\begin{aligned}
2 I & =\int_0^{\pi / 2} \frac{3(\sin x+\cos x)-4\left(\sin x-\sin x \cos ^2 x+\cos x-\cos x \sin ^2 x\right)}{\sin x+\cos x} \\\\
2 I & =4 \int_0^{\pi / 2} \sin x \cos x d x-\int_0^{\pi / 2} 1 \cdot d x \\\\
2 I & =2-\frac{\pi}{2} \\\\
I & =1-\frac{\pi}{4} \approx 0.2146018366
\end{aligned}
$$

I also checked it in online calculator and it gives the following result,

\begin{gathered}
\int \frac{\sin (3 x)}{\sin (x)+\cos (x)} \mathrm{d} x \\
=-\frac{\ln (|\tan (x)+1|)}{2}+\frac{\ln \left(\tan ^2(x)+1\right)}{4}-\frac{\operatorname{ar}}{\text { Rewrite/simplify: }} \\
=-\frac{\ln (|\tan (x)+1|)+\ln (|\cos (x)|)-\sin (2 x)-}{2}
\end{gathered}

Note: The result is too wide for the screen. Scroll horizontally to see everything!

DEFINITE INTEGRAL:
$$
\begin{aligned}
& \int_0^{\frac{\pi}{2}} \boldsymbol{f}(\boldsymbol{x}) \mathbf{d} \boldsymbol{x}= \\
& \frac{2 \ln (2)-2 \ln (-2)-\pi+4}{4}+\frac{\ln (-1)}{2}
\end{aligned}
$$

Approximation:
0.2146018366025517

Which matches my answer but I can't find any mistake in any of the solutions. Is my solution wrong?

Thanks in advance.

Best Answer

There is a mistake in the fifth line of the calculation of $I_1$: $$ \int_0^{\frac{\pi}{2}}(1-\cos 2 x)\, d x = \left[x-\frac{\sin 2x}{2}\right]_0^{\frac{\pi}{2}}=\frac{\pi}{2}. $$ Therefore, $I_1=1-\frac{\pi}{2}$, hence $I_1+I_2=1-\frac{\pi}{4}$.