Question:
$\int_{0}^{\frac{\pi}{4}}\left(2 \sec ^{2} x+x^{3}+2\right) d x$
Solution:
Let $I=\int_{0}^{\frac{\pi}{4}}\left(2 \sec ^{2} x+x^{3}+2\right) d x$
$\int\left(2 \sec ^{2} x+x^{3}+2\right) d x=2 \tan x+\frac{x^{4}}{4}+2 x=\mathrm{F}(x)$
By second fundamental theorem of calculus, we obtain
$I=\mathrm{F}\left(\frac{\pi}{4}\right)-\mathrm{F}(0)$
$=\left\{\left(2 \tan \frac{\pi}{4}+\frac{1}{4}\left(\frac{\pi}{4}\right)^{4}+2\left(\frac{\pi}{4}\right)\right)-(2 \tan 0+0+0)\right\}$
$=2 \tan \frac{\pi}{4}+\frac{\pi^{4}}{4^{5}}+\frac{\pi}{2}$
$=2+\frac{\pi}{2}+\frac{\pi^{4}}{1024}$