It has been said many times that the notation for exponentiated or inverted trig functions, e.g.:
$$\sin^2(x), \tan^{-1}(x), \csc^3(x)$$
is confusing, ugly, and terrible in general, but nevertheless standard. So is it more common to write: $$f'^2(x)\text{ or }f'(x)^2$$ To differentiate and then square a function $f$?
In your example, you use superscripts to mean two different things. In $\sin^2$ and $\csc^3$, the superscripts refer to iterated multiplication (powers), whereas in $\tan^{-1}$, the superscript refers to iterated composition (inverse for $-1$). While this is not ambiguous for trig functions as there is an established convention of positive superscripts referring to powers and using $-1$ for the inverse, this is not the case more generally, where $f^n$ could refer to a power of $f$ or an iterated function. For that reason, it is clearer to write $f^\prime(x)^2$ to indicate the square of the derivative of $f$.