(i) Let \[
I=\int_0^a\frac{f(x)}{f(x)+f(a-x)}\,dx.
\] Use a substitution to show that \[
I=\int_0^a\frac{f(a-x)}{f(x)+f(a-x)}\,dx,
\] and hence evaluate \(I\) in terms of \(a\).
Use this result to evaluate the integrals \[
\int_0^1\frac{\ln(x+1)}{\ln(2+x-x^2)}\,dx
\] and \[
\int_0^{\pi/2}\frac{\sin x}{\sin(x+\frac14\pi)}\,dx.
\]
(ii) Evaluate \[
\int_{1/2}^{2}
\frac{\sin x}{x\bigl(\sin x+\sin(1/x)\bigr)}\,dx.
\]