Answer
$$
f(x) =\frac{\cos x}{x^{n}}=x^{-n} \cos x
$$
we can find
$$
\begin{aligned} f^{\prime}(x) &=-x^{-n} \sin x-n x^{-n-1} \cos x \\ &=-x^{-n-1}(x \sin x+n \cos x) \\ &=-\frac{x \sin x+n \cos x}{x^{n+1}} \end{aligned}
$$
If $ n=1 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+\cos x}{x^{2}}
$$
If $ n=2 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+2 \cos x}{x^{3}}
$$
If $ n=3 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+3 \cos x}{x^{4}}
$$
If $ n=4 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+4 \cos x}{x^{5}}
$$
For general n, a general rule for $f^{\prime}(x) $ in terms of n is :
$$
f^{\prime}(x)=-\frac{x \sin x+n \cos x}{x^{n+1}}
$$
Work Step by Step
$$
f(x) =\frac{\cos x}{x^{n}}=x^{-n} \cos x
$$
we can find
$$
\begin{aligned} f^{\prime}(x) &=-x^{-n} \sin x-n x^{-n-1} \cos x \\ &=-x^{-n-1}(x \sin x+n \cos x) \\ &=-\frac{x \sin x+n \cos x}{x^{n+1}} \end{aligned}
$$
If $ n=1 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+\cos x}{x^{2}}
$$
If $ n=2 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+2 \cos x}{x^{3}}
$$
If $ n=3 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+3 \cos x}{x^{4}}
$$
If $ n=4 $ then we have:
$$
f^{\prime}(x)=-\frac{x \sin x+4 \cos x}{x^{5}}
$$
For general n, a general rule for $f^{\prime}(x) $ in terms of n is :
$$
f^{\prime}(x)=-\frac{x \sin x+n \cos x}{x^{n+1}}
$$