If [tex]u=x^5+2[/tex], then [tex]du=5x^4\,dx[/tex], so the integral transforms to
[tex]\displaystyle \int_{x=-2}^{x=4} x^4 \cos(x^5+2) \, dx = \frac15 \int_{u=-30}^{u=1026} \cos(u) \, du[/tex]
since
[tex]x = -2 \implies u = (-2)^5 + 2 = -32 + 2 = -30[/tex]
[tex]x=4 \implies u = 4^5 + 2 = 1024 + 2 = 1026[/tex]