How to evaluate this definite integral-$\int_\pi^{2\pi}\frac{(x^2+2)(\cos x)}{x^3}dx$?

Evaluate-

$$\int_\pi^{2\pi}\frac{(x^2+2)(\cos x)}{x^3}dx$$

Separating the function as $$\frac{\cos x}{x}+\frac{2\cos x}{x^3}$$ and evaluating the indefinite integral and putting the limits does give an answer.

But is there any other more elegant way out?

Thanks for any help!

Use integration by parts twice on $$\int\ \frac{1}{x}\cdot \cos\ x\ dx$$ so that we can rule out $$\frac{2\cos\ x}{x^3}$$

The indefinite integral,

$$I = \int(\frac{\cos x}{x}+\frac{2\cos x }{x^3})dx = \int(\frac{\cos x}{x})dx+\int(\frac{2\cos x}{x^3})dx$$

$$I_1 = \int(\frac{\cos x}{x})dx$$

Let $$u= \frac{1}{x}, dv = \cos x dx$$

$$du = -\frac{1}{x^2}dx, v = \sin x$$

$$I_1 = uv - \int vdu = \sin x\cdot\frac{1}{x}-\int{-\frac{1}{x^2}\cdot\sin xdx} +c$$

$$I_1 = \frac{\sin x}{x} + \int\frac{1}{x^2}\cdot\sin xdx+c$$

$$I_2 = \int(\frac{2\cos x}{x^3})dx$$

Let $$u = \cos x , dv = \frac{2}{x^3}dx$$

$$du = -\sin x dx, v = -\frac{1}{x^2}$$

$$I_2 = uv - \int vdu = -\frac{1}{x^2}\cos x - \int\frac{1}{x^2}\cdot\sin x dx+c'$$

$$I_2 = -\frac{\cos x}{x^2} - \int\frac{1}{x^2}\cdot\sin xdx+c'$$

$$I=I_1+I_2 = \frac{\sin x}{x} -\frac{\cos x}{x^2} +C$$

Now substitute the limits and find the answer.

Using chain rule for the first integral,

$$\int \frac{1}{x}\cos x\,dx = \frac{1}{x}\sin x + \int \frac{1}{x^2}\sin x\, dx$$

Use the chain rule again for the integral on RHS.

$$\int \frac{1}{x}\cos x\,dx = \frac{1}{x}\sin x + \frac{1}{x^2}(-\cos x) - \int \frac{-2}{x^3}(-\cos x) dx$$

With some manipulation,

$$\int \frac{1}{x}\cos x\,dx + \int \frac{2}{x^3}\cos x\, dx = \frac{\sin x}{x} - \frac{\cos x}{x^2}$$

Edit
I noticed that similar answers were posted while I was typing my answer.