\(I=\int\limits^{\pi}_{-\pi}\frac{3^xcos^2x}{3^x+1}dx\)
Đặt \(x=-t\Rightarrow dx=-dt\)
\(\Rightarrow I=\int\limits^{-\pi}_{\pi}\frac{cos^2t}{3^t+1}\left(-dt\right)=\int\limits^{\pi}_{-\pi}\frac{cos^2t}{3^t+1}dt=\int\limits^{\pi}_{-\pi}\frac{cos^2x}{3^x+1}dx\)
\(\Rightarrow2I=I+I=\int\limits^{\pi}_{-\pi}\left(\frac{3^xcos^2x}{3^x+1}+\frac{cos^2x}{3^x+1}\right)dx=\int\limits^{\pi}_{-\pi}cos^2xdx=\pi\)
\(\Rightarrow I=\frac{\pi}{2}\)