Given a continuous function $f:[0,1] \to \mathbb {R}$
Prove that $$\int^{\pi/2}_0 f(\cos x)dx = \int^{\pi/2}_0 f(\sin x) dx$$
Calculate $$I= \int^{\pi/2}_0 \frac{\sin^2 x + \sin x}{1 + \sin x + \cos x} dx$$
The 1st was solved by letting $g:[0,1] \to \mathbb{R}$ such that $g(x) = f(\sin x)$ and proving that $\int^{\pi/2}_0 g(x) dx = \int^{\pi/2}_0 g(\pi /2 -x) dx$ using a substitution.
My question: Can I calculate $I$ using the first lemma? I know that by using other methods the integral turns out to be $I = \bigg [(x-\sin x - \cos x)/2 \bigg |^{\pi/2}_0 \bigg ] = \pi/4 $
Finally, note that $I= \int^{\pi/2}_0 \frac{\sin^2 x + \sin x}{1 + \sin x + \cos x} dx =\int^{\pi/2}_0 \frac{\cos^2 x + \cos x}{1 + \cos x + \sin x} dx $