Ta có \(I=\int_{0}^{\frac{\pi}{2}}xdx+\int_{0}^{\frac{\pi}{2}}xcosxdx\) Tính \(I_1=\int_{0}^{\frac{\pi}{2}}xdx\) Ta có \(I_1=\frac{x^2}{2}\bigg|_0^{\frac{\pi}{2}}=\frac{\pi^2}{8}\) Tính \(I_2=\int_{0}^{\frac{\pi}{2}}xcosxdx\) Đặt \(u=x;dv=cosxdx\); Suy ra \(du=dx;v=sinx\) Khi đó \(I_2=xsinx\bigg |_0^{\frac{\pi}{2}}-\int_{0}^{\frac{\pi}{2}}sinxdx=\frac{\pi}{2}+cosx|_0^{\frac{\pi}{2}}=\frac{\pi}{2}-1\) Do đó \(I=I_1+I_2=\frac{\pi^2}{8}+\frac{\pi}{2}-1\)