\(\int\left(cos^3x-1\right)cos^2xdx=\int\left(cos^5x-cos^2x\right)dx\)
\(=\int cos^4x.cosxdx-\int\left(\dfrac{1}{2}+\dfrac{1}{2}cos2x\right)dx\)
\(=\int\left(1-sin^2x\right)^2.d\left(sinx\right)-\int\left(\dfrac{1}{2}+\dfrac{1}{2}cos2x\right)dx\)
\(=\int\left(sin^4x-2sin^2x+1\right)d\left(sinx\right)-\int\left(\dfrac{1}{2}+\dfrac{1}{2}cos2x\right)dx\)
\(=\dfrac{sin^5x}{5}-\dfrac{2sin^3x}{3}+sinx-\dfrac{1}{2}x-\dfrac{1}{4}sin2x+C\)