Here, you actually have three functions, so you have to apply the chain rule twice.
We have f(g(h(x))), where
h(x) = x^5
g(x) = cot(x)
f(x) = x^7
When applying the chain rule, the approach is from "outside to inside," in that we start from the outer most function and systematically go towards the innermost function. Remember, when doing the chain rule, each step is distinct.
You have: 7(-csc^2)^6...
You were correct in taking the derivative of f(x) = x^7 first; however, you need to let everything inside f(x) remain untouched during this step. Meaning, for f(g(h(x)), we leave g(h(x)) untouched.
So what you should have had is: 7cot^6(x^5)...
Try to do the rest by yourself.