A function of the form shown in the question is called a composite function, it is a 'function of a function'. It can be differentiated by expanding the brackets and differentiating each term individually but this can get messy very quickly, especially if the value of n is greater than 2. Alternatively, the chain rule can be used to differentiate such a function. Lets use an example of y=(2x-5)^4.
The chain rule is: dy/dx=du/dx*dy/du. Hence, we need to obtain an expression for u. In this case u=2x-5 meaning that y=u^4. The expressions for u and y can be differentiated respectively to obtain du/dx and dy/du using basic differentiation. du/dx=2; dy/du=4u^3. dy/dx can be obtained by multiplying these together and substituting the original expression for u back in.
dy/dx=8u^3=8(2x-5)^3