I think a huge part of this is to use double angle identities and power reduction formulas. Let me know if I did anything wrong.
##\int_{0}^{2 \pi} \left[ f\left(x\right) \cos x \right] \left[ f\left(x\right) \sin x \right]' \, dx##
##= \int_{0}^{2 \pi} \left[ f\left(x\right) \cos x \right] \left[ f'\left(x\right) \sin x + f\left(x\right) \cos x\right] \, dx##
## = \int_{0}^{2 \pi} f\left(x \right) f' \left(x \right) \cos x \sin x + f^2 \left(x\right) \cos^2 x \,dx##
I'm going to use a double identity ##\sin 2x = 2 \sin x \cos x## and power reduction formula ##\cos^2 x = \frac{1 + \cos 2x}{2}##
## = \int_{0}^{2 \pi} f\left(x \right) f' \left(x \right) \frac{\sin 2x}{2} + f^2 \left(x\right) \frac{1 + \cos 2x}{2} \,dx##
## = \frac{1}{2} \int_{0}^{2 \pi} \left(f'\left(x\right) f\left(x\right) \sin 2x + f^2 \left(x\right) \cos 2x\right) \,dx + \frac{1}{2} \int_{0}^{2 \pi} f^2\left(x\right)\,dx##
Recognize the first integrand (rather the first two) as a derivative of ##\frac{1}{4} f^2 \left( x \right) \sin 2x## by the product rule
##= \frac{1}{4} \int_{0}^{2 \pi} \frac{d}{dx} \left(f^2 \sin 2x \right)\,dx + \frac{1}{2} \int_{0}^{2 \pi} f^2 \left(x \right) \, dx##
Use the fundamental theorem of calculus on the first integral
## = \frac{1}{4} \left. f^2 \left(x\right) \sin 2x \right|_{0}^{2 \pi} + \frac{1}{2} \int_{0}^{2 \pi} f^2 \left(x \right) \, dx##
## = 0 + \frac{1}{2} \int_{0}^{2 \pi} f^2 \left(x \right) \, dx##
##= \frac{1}{2} \int_{0}^{2 \pi} f^2 \left(x \right) \, dx##