When a trigonometric function has an exponent does that mean multiply itself or apply itself to the result recursively?
For example, does $\sin(x)^2$ denote $\sin(x)\sin(x)$ or does it denote $\sin(\sin(x))$? What about $\sin^2x$?
When a trigonometric function has an exponent does that mean multiply itself or apply itself to the result recursively?
For example, does $\sin(x)^2$ denote $\sin(x)\sin(x)$ or does it denote $\sin(\sin(x))$? What about $\sin^2x$?
The notation is a mess, and we’re stuck with it for purely historical reasons. As everybody has noted, $\sin^2x$ means $(\sin(x))^2$. But nobody pointed out that $\sin^{-1}x$ does not mean the reciprocal of the sine function, but rather its inverse with respect to composition. That is, for the right range of inputs, $\sin\bigl(\sin^{-1}(x)\bigr)=x$ and $\sin^{-1}\bigl(\sin(x)\bigr)=x$.
(In my own work, I have to refer to the $n$-fold composition of $f$ with itself, and (less often) the $n$-th power of $f$. I’ve chosen to write $f^{\circ n}$ for the multiple composition, and $f^n$ for the product of $f$ with itself $n$ times, but this is nonstandard. I still don’t know, when people in analytic number theory write $\log^2(x)$, which they mean.)
The currently accepted answer claims that $$ \color{blue}{\sin(x)^2} := \sin(x^2), \tag{1}$$ but in fact, possibly the most common interpretation is that $$\color{blue}{\sin(x)^2} := \left[\sin(x)\right]^2 \tag{2}$$ (the standard argument being that it is silly to move the exponent out of the parenthesis if one actually means $\sin(x^2)$).
However, I avoid writing $\text“\color{blue}{\sin(x)^2}\text”$ altogether, as I instinctively parse it as $(1)$ rather than $(2).$
For $\left[\sin(x)\right]^2,$ I prefer to write $\text“\color{violet}{\sin^2(x)}\text”,$ knowing that this is the most conventional choice, is unlikely to be interpreted as the rarely occurring function composition $\sin\left(\sin(x)\right),$ and is at least less potentially controversial than $\text“\sin^{-1}(x)\text”,$ which can be clearly and compactly rewritten as $\arcsin(x)$ or $\operatorname{cosec}(x),$ depending on the intended meaning (most likely the former).
Addendum to restore the OP's Accepted (green-ticked) Answer by PObdr (referenced above; to be clear: I disagree with its tone of definitiveness), which, together with the comments under it, have been deleted by the community:
$$ \color{blue}{\sin(x)^2} = \sin((x)^2) = \sin(x^2)\\ \color{violet}{\sin^2(x)} = (\sin(x))^2 = \sin(x)\sin(x)\\ \sin(\sin(x)) \text{ is forever alone and never simplified} $$
Xander Henderson: $\quad$ This is simply not the way that most of the mathematical community interprets $\color{blue}{\sin(x)^2}$—indeed, I only see this interpretation when grading student work, and I mark it down. This answer is simply incorrect.
me: $\quad$ @XanderHenderson Unless your required interpretation has been stressed in class, it's unfair to mark students down for being unaware that a significant subset of the mathematical community opts to understand $\text“\color{blue}{\sin(x)^2}\text”$ as the square of a function output.
After all, reading $\text“\color{blue}{\sin(x)^2}\text”$ as $\sin(x^2)$ is neither nonsensical (reading it as $\sin\cdot\sin\cdot xx$) nor outre (reading it as $\sin(\sin(x))$ ) nor more unnatural than reading $\text“t(p)^2\text”$ as $t(p^2)$ instead of $(tp)^2.$
Since $\text“\color{violet}{\sin^2(x)}\text”$ is by far the most prevalent expression for $[\sin(x)]^2,$ and since reading $\text“\color{blue}{\sin(x)^2}\text”$ as $[\sin(x)]^2$ is not clearly more logically/mathematically valid than as $\sin(x^2)$ (for example, no precedence convention says whether function application or exponentiation binds stronger), $\text“\boldsymbol{\color{blue}{\sin(x)^2}}\text”$ is actually more ambiguous than $\text“\color{violet}{\sin^2(x)}\text”.$ Certainly, there is no firm convention for interpreting $\text“\color{blue}{\sin(x)^2}\text”;$ for example, see the discussions here and here and here.
$\sin(x)^2$ means it multiplies itself, although I always thought that was weird since $(\sin(x))^5$ is already easy to write, although writing $\sin(\sin(\sin(\sin(\sin(x)))))$ is a lot harder. I remember it because I think it is weird.
The notation here is confusing and ambiguous, because the different notations developed at different times, and have strange overlaps that can cause confusion.
If $f$ is a function, then $f^n(x)$ typically means the $n$-fold composition of $f$ with itself, i.e $$ f^n(x) = \underbrace{f\circ f\circ \dotsb \circ f}_{\text{$n$ times}} =(x), $$ while $f(x)^n$ usually means the $n$-fold product of $f(x)$ with itself, i.e. $$ f(x)^n = \underbrace{f(x) \cdot f(x) \cdot \dotsb \cdot f(x)}_{\text{$n$ times}}. $$ The former notation is consistent with the understanding that a function is (or can be thought of as) an element of an algebra of functions (or something similar). For example, if $T : \mathbb{R}^n \to \mathbb{R}^n$, then $T$ can be represented by an $n\times n$ matrix, and the composition of $T$ with itself ($T\circ T$) is represented by the matrix product of $T$ with itself ($T^n$).
For the later notation, it might be helpful to think of "$f($" and "$)$" as opening and closing symbols for grouping. Then, in the G/E/MD/AS mnemonic, evaluating a function happens at the priority of grouping:
$$ \color{red}{f\bigl(} \sqrt{x+1} - x \color{red}{\bigr)}^3 $$
means "evaluate $\sqrt{x+1}-x$, then apply $f$ to that, and then cube the result". This is also the way in which most programming languages can computer algebra systems interpret the notation. For example, if fib(n) is a function in a program which returns the $n$-th Fibonacci number, then the syntax fib(4)^2 usually (depending on language) means "evaluate the Fibonacci function with an input of $4$, and then square the result.
Trigonometric and logarithmic functions have a slightly different history. These functions were commonly used and understood before the modern understanding of "function" was introduced, and before the modern notation for functions started to be used. The notation $\sin x$ developed as a shorthand for a phrase which would typically be written in English (or Latin, or whatever) as "the sine of the angle $x$". Because this notation developed independently, the notation $\sin^2 x$ for "the square of the sine of $x$" developed relatively early on. Thus the standard interpretation is that, for example, $$ \sin^2 x = [\sin x]^2 \qquad\text{and}\qquad \log^2 x = [\log x]^2. $$ Because of this, the notation $\sin^n(x)$ (for positive $n$) is rarely, if ever, ambiguous: it means the square of the output of the sine function, when applied to $x$.
However (editorializing a bit here), that does not make it good notation.
When writing trigonometric and logarithmic functions in a way that is consistent with modern usage, i.e. with parentheses enclosing the argument of the function, the default assumption should be that the function is applied to whatever is in the parentheses, and anything outside of those parentheses is evaluated later. For example, $\log(x) + 1$ unambiguously means "add one to the logarithm of $x$", and $\sin(x)x$ means "multiply $x$ by the sine of $x$" (though $x\sin(x)$ would be better notation).
Again, the function name plus parenthesis acts as an opening grouping symbol, and the closing parenthesis acts as a closing grouping symbol. As such, the default interpretation is that $\sin(x)^2$ should mean the same thing as $[\sin(x)]^2$. Note that this is consistent with the way that most computer algebra systems and programming languages work:
sin(x)^2 is interpreted by GeoGebra to mean $\sin^2(x)$;sin(x)^2 is interpreted by WolframAlpha as $\sin^2(x)$;sin(x)^2 is interpreted by Desmos as $\sin(x)^2 = [\sin(x)]^2$;sin(x)^2 is interpreted by Google's math engine as $\sin(x)^2 = [\sin(x)]^2$, though it is interesting to note that Google returns many results about $\sin(x^2)$.The notation for inverses is consistent with the use of $f^n$ to denote composition: let $\operatorname{id}$ denote the identity function, i.e. $\operatorname{id}(x) = x$ for all $x$ in the domain of $\operatorname{id}$; if $f$ and $g$ are functions such that $$ f\circ g = \operatorname{id} = g \circ f \qquad\text{that is, $(f\circ g)(x) = f(g(x)) = x$)}, $$ then $g$ is the compositional inverse of $f$; the usual notation is to write $$ g = f^{-1}. $$ Trigonometric functions sometimes use this notation for inverses, e.g. $\sin^{-1}$ is the inverse sine function, not the reciprocal of the sine function. Note, however, that alternative notation exists for inverse trigonometric functions, e.g. the inverse of the sine function is $\arcsin$ (the arcsine function).
In short:
The notation $\operatorname{trig}^n x$ for positive integers $n$ unambiguously means $[\operatorname{trig}(x)]^n$. In my opinion, this is bad notation (both for pedagogy and for clarity), but it exists and persists for historic reasons.
The notation $\operatorname{trig}^{-1} x$ unambiguously means the inverse of the given trigonometric function, applied to $x$ in the appropriate domain, but it would probably be more clear to use $\operatorname{arctrig}(x)$.
The notation $\operatorname{trig}(x)^n$ almost certainly means (and should be interpreted as, unless otherwise noted) $[\operatorname{trig}(x)]^n$. However, as noted in this discussion, there are folk who might be confused by this notation.
The most clear and unambiguous notation requires using more grouping symbols. It is almost certainly best to write $$ [\operatorname{trig}(x)]^n $$ to denote the $n$-fold product of $\operatorname{trig}(x)$ with itself.
G-d help you if you need notation for $$ \operatorname{trig}( \operatorname{trig}( \dotsb \operatorname{trig}(x) \dotsb )). $$ Fortunately, the $n$-fold composition of trigonometric functions rarely comes up, except in a few esoteric branches of mathematics (e.g. maybe dynamical systems? fractal geometry?).