How to interpret $\cos(n\pi)^2$ I am stuck in an elementary problem which somehow makes me confused.

If it is written $$\cos(n\pi)^2$$
What does this mean?

Is it $(\cos{(n\pi)}) \cdot (\cos{(n\pi)})$, or $\cos{(n^2\pi^2)}$ ???
Because if it is $(\cos{(n\pi)}) \cdot (\cos{(n\pi)})$, I usually write it as $\cos^2{(n\pi)}$.
How to write it internationally?
I am confused, please help. And how to internationally write the other one?
Thank you in advance
 A: I agree with JasonDeVito and disagree with RyanG. I say function application binds more tightly than exponents or products.  Thus $f(x)^2$ means $\big(f(x)\big)^2$, even though $2(x)^2$ means $2\big((x)^2\big)$.
Trig functions and logs have some legacy notational rules---such as writing $\sin x$ for $\sin(x)$, or writing $\sin^2(x)$ for $\sin(x)^2$.  Expecting your readers to know those legacy rules should be discouraged.
A: *

*My knee-jerk reading of $$\cos(nx)^2$$ is $$\cos\big((nx)^2\big)$$ instead of
$$\big(\cos(nx)\big)^2,$$ just like how everyone reads $$\cos x^2$$
as $$\cos (x^2)$$ instead of as $$(\cos x)^2.$$

*However, a common opposing position is that since cosine as a
function, its input is specified entirely within the parenthesis, and thus the function input in the expression $$\cos(nx)^2$$ is
simply $\:nx\:,$ and thus  $$\cos(nx)^2$$ is to be interpreted as
$$\big(\cos(nx)\big)^2.$$
So the short answer is, one must rely on context to disambiguate $\cos(nx)^2.$ Of course, the writer is best to always stick to $\cos^2(nx)$ and $\cos\big((nx)^2\big).$
(Because $\big(\cos(x)\big)^2$ occurs too frequently to be worth this clunkiness, just as displaying the curly brackets in $P\big(\{HHT,HTH,HHH\}\big)$ isn't worth the hassle.)
Let's not get started on disambiguating $\cos^2(nx)$ between squaring the function and composing the function (in the vein of “does $\cos^{-1}(x)$ mean the multiplicative inverse $\big(\cos(x)\big)^{-1}$ or the inverse function $\arccos(x)?$”).
