Concept:
- For integrals of the form $\int \dfrac{a\sin x + b\cos x}{c\sin x + d\cos x}\,dx$, the numerator can be rewritten as a combination of the denominator and the derivative of the denominator, splitting the integral into a simple constant part and a part that integrates directly using substitution.
- Since the derivative of $\sin x + \cos x$ is $\cos x - \sin x$, the numerator $\sin x$ can be expressed using these two building blocks.
Step 1: Express $\sin x$ as a combination of $(\sin x + \cos x)$ and $(\cos x - \sin x)$.
Let $\sin x = A(\sin x + \cos x) + B(\cos x - \sin x)$.
Comparing coefficients of $\sin x$: $1 = A - B$
Comparing coefficients of $\cos x$: $0 = A + B$
Solving these together gives $A = \dfrac{1}{2}$, $B = -\dfrac{1}{2}$.
So $\sin x = \dfrac{1}{2}(\sin x + \cos x) - \dfrac{1}{2}(\cos x - \sin x)$
Step 2: Split the original integral into two parts.
$\dfrac{\sin x}{\sin x + \cos x} = \dfrac{1}{2} - \dfrac{1}{2}\cdot\dfrac{\cos x - \sin x}{\sin x + \cos x}$
$I = \dfrac{1}{2}\int_0^{\pi/2} dx \;-\; \dfrac{1}{2}\int_0^{\pi/2} \dfrac{\cos x - \sin x}{\sin x + \cos x}\,dx$
Step 3: Evaluate the first part directly.
$\dfrac{1}{2}\int_0^{\pi/2} dx = \dfrac{1}{2}\left(\dfrac{\pi}{2} - 0\right) = \dfrac{\pi}{4}$
Step 4: Evaluate the second part using substitution.
Let $u = \sin x + \cos x$, so $du = (\cos x - \sin x)\,dx$.
$\int \dfrac{\cos x - \sin x}{\sin x + \cos x}\,dx = \int \dfrac{du}{u} = \ln|u| = \ln|\sin x + \cos x|$
At $x = \pi/2$: $\sin x + \cos x = 1 + 0 = 1$, so $\ln 1 = 0$
At $x = 0$: $\sin x + \cos x = 0 + 1 = 1$, so $\ln 1 = 0$
The definite value of this part is $0 - 0 = 0$
Final Answer: $I = \dfrac{\pi}{4} - \dfrac{1}{2}(0) = \dfrac{\pi}{4}$