đặt \(x^2+2x+3=u\Rightarrow du=\left(2x+2\right)dx\)
và \(cosxdx=dv\Rightarrow v=-sinx\)
\(\int\left(x^2+2x+3\right)cosxdx=-sinx\left(x^2+2x+3\right)+2\int\left(x+1\right)sinxdx\) xét \(\int\left(x+1\right)sinxdx=\left(x+1\right)cosx-\int cosx.dx=cosx\left(x+1\right)+sinx\)
vậy \(\int\left(x^2+2x+3\right)cosxdx=-sinx\left(x^2+2x+3\right)+2cossx\left(x+1\right)+2sinx+C\)