<s>[INST] Compute $I=\int_0^2(3x^2-3x+1)\cos(x^3-3x^2+4x-2)\,dx$ If the value of $I = \int\limits_0^2 {\left( {3{x^2} - 3x + 1} \right)\cos \left( {{x^3} - 3{x^2} + 4x - 2} \right)dx} $ can be expressed as $p(\sin q)$ , where $p,q\in \mathbb N$, then $p+q-1=$?
My approach is as follow ${x^3} - 3{x^2} + 4x - 2 = {x^3} - {x^2} - 2\left( {{x^2} - 2x + 2} \right) \Rightarrow {x^3} - 3{x^2} + 4x - 2 = {x^2}\left( {x - 1} \right) - 2{\left( {x - 1} \right)^2}$
${x^3} - 3{x^2} + 4x - 2 = \left( {x - 1} \right)\left( {{x^2} - 2\left( {x - 1} \right)} \right) \Rightarrow {x^3} - 3{x^2} + 4x - 2 = \left( {x - 1} \right)\underbrace {\left( {{x^2} - 2x + 2} \right)}_{ > 0}$
Unable to proceed as cannot find the substitution of ${x^3} - 3{x^2} + 4x - 2$
 [/INST] Let $y=x-1$, then $3x^2 - 3x + 1=3y^2+3y+1$, and $x^3-3x^2+4x-2=y^3+y$. Hence
$$I=\int_0^2(3x^2-3x+1)\cos(x^3-3x^2+4x-2)\,dx=\int_{-1}^1(3y^2+3y+1)\cos(y^3+y)\,dy.$$
Since $\frac{d}{dy}(y^3+y)=3y^2+1$, we have
$$\int_{-1}^1(3y^2+1)\cos(y^3+y)\,dy=\sin(y^3+y)\Big|_{-1}^1=2\sin 2.$$
Since $3y\cos(y^3+y)$ is an odd function in $y$, we have
$$\int_{-1}^13y\cos(y^3+y)\,dy=0.$$
Therefore, $I=2\sin 2.$
</s>