# Ambiguity of notation: $\sin(x)^2$

Several people have told me that $\sin(x)^2 = \sin(x^2)$. However, on several computing platforms, such as the TI-84 and Wolfram|Alpha, $\sin(x)^2 = \sin^2(x)$. Can I safely conclude that the notation $\sin(x)^2$ is ambiguous and should always be avoided in favor of $\sin^2(x)$ or $\sin^2 x$? I am having trouble finding any reference through Google or in textbooks (which, I presume, avoid notation like this).

• whoever told you that $\sin(x)^2=\sin(x^2)$ is just wrong. $\sin(x)^2=\sin^2(x)=[\sin(x)]^2$. – robjohn Sep 15 '14 at 22:30
• It's likely that whoever told this to the asker meant $\sin x^2$, which can indeed be ambiguous. – Fengyang Wang Sep 16 '14 at 0:15
• @FengyangWang No, I'm definitely asking about $\sin(x)^2$. All other forms, in my opinion, are not ambiguous, although some people will (justifiably) disagree. For instance, $\sin x^2 = \sin(x^2)$. – Radon Rosborough Sep 16 '14 at 0:51
• possible duplicate of Notation for powers of trigonometric functions – Joel Bosveld Sep 16 '14 at 2:23
• Both $\sin^2(x)$ and $\sin^2x$ are more ambiguous than $\sin(x)^2$. It is just because the function $x\mapsto\sin(\sin x)$ is hardly ever of any use that those first two forms are tolerated in practice. – Marc van Leeuwen Sep 16 '14 at 6:10

No-one in their right mind would denote $\sin\left(x^2\right)$ as $\sin(x)^2$.

Why? Because the (round) brackets would become redundant. Brackets are used to remove ambiguity in algebraic operations. If you exclude the exponent $\quad ^2 \quad$ from the brackets, you're implicitly saying that the $\quad ^2 \quad$ belongs outside the brackets, and, therefore, we're taking the square of the sine, rather than the sine of the square.

In short, $$\sin(x)^2 \ \equiv[\sin(x)]^2 \ \equiv \ \sin^2(x) \ \neq \ \sin\left(x^2\right) \quad.$$

In some contexts, however, for a given function $f$, we have $$f^2(x) \ \equiv \ f\left[f(x)\right] \ \equiv \ f \circ f(x) \ \neq \ [f(x)]^2 \quad ,$$ so, if in doubt, explicitly define notation to remove all ambiguity.

• Your first line holds if it is only about a single variable. However, if x is defined as y+z you could see sin(y+z)^2 meaning sin((y+z)^2) – Dennis Jaheruddin Sep 16 '14 at 12:36
• @DennisJaheruddin Agreed. – beep-boop Sep 16 '14 at 12:39
• Just worth pointing out that many people have thought the $sin^2$ notation (meaning the square of the sine) senseless for a long time, for example Charles Babbage. I cannot understand how any right thinking person would use it, but many still do.  books.google.ie/… – Sean D Sep 16 '14 at 14:16
• As David has pointed out in the comments in the below answer, $\sin[\sin(x)]$ is less common than $[\sin(x)]^2.$ – beep-boop Sep 16 '14 at 14:34

If anything, $\sin^2(x)$ is the ambiguous notation. To some it might mean $\sin(\sin(x))$ (this is why $\sin^{-1}$ is sometimes used as arcsine), and to others it might mean $(\sin(x))^2$. I cannot think of a case where anyone would see $\sin(x)^2=\sin(x^2)$ (except when, say, $x=0$). However, we mathematicians avoid ambiguity; I typically use $(\sin(x))^2$ when I square my sines.

• I've always disliked how, unless I'm misunderstanding, sin^-1 represents a different function for inverse sine and sin^2 is just squaring the result of the function. It's always seemed a bit inconsistent. – Ashley Davies Sep 15 '14 at 23:26
• $\sin(\sin x)$ is extremely rare, whereas $(\sin x)^2$ is pretty common. As such, it makes much more sense for $\sin^2 x$ to mean the latter, even though it is, as you say, inconsistent with $\sin^{-1} x$. – David Richerby Sep 16 '14 at 0:05
• in my country $sin^{−1}x$ is never seen outside pocket calculators. To mention the inverse function of sin one would always use arcsin – phuclv Sep 16 '14 at 15:18
• Honestly, when I use $\sin^{-1}$, I'm not talking about a function; I use that to denote the preimage. – Robin Goodfellow Sep 16 '14 at 15:22
• +1, I guess that this ambiguity might even be the one that was actually meant here (since, as others have pointed out, the other one does not make any sense at all). I'd go for $sin^{2}(x) = sin(sin(x))$ in any case. – Marco13 Sep 17 '14 at 8:50

In mathematics, $\sin (x)^2 = \sin x^2 = \sin (x^2)$ because $\sin$ comes after exponentiation and multiplication in order of operations. The $sin^2$ construct was created to alleviate the pain of performing exponentiation on the result of $sin$.

In computer programming, however, $\sin(x)^2 = \sin^2 x$ because $\sin$ is a function call and the expression within the parentheses is its only parameter.

Consider, for example, how redundant it would look to write $\sin (x+1)^2$ as $\sin [(x+1)^2]$.

• What do you mean by "In computer programming, $\sin(x)^2=\sin^2 x$? Expressions such as "$\sin(x)^2$" do not appear in any programming language I'm familiar with. Squaring is typically not a primitive operation but is implemented either by explicitly multiplying a term by itself or by using a function such as pow(x,y) that computes $x^y$. There's no ambiguity in pow(sin(x),2), sin(x)*sin(x) or t=sin(x); ans=t*t. – David Richerby Sep 16 '14 at 8:41
• It's always dangerous to talk about programming languages as if they were all the same. In Python, sin(x) ** 2 is $(\sin x)^2$ since brackets are part of the function application notation. But in Haskell, sin (x) ^ 2 is $(\sin x)^2$ for a different reason (function application precedes all binary operations). Then, in J, sin (x) ^ 2 is $\sin(x^2)$ due to right-associativity. Also, esoteric languages like Unlambda will always be exceptions. – James Wood Sep 16 '14 at 9:41
• What is your justification and/or authority that "sin comes after exponentiation and multiplication in order of operations?" Is there some convention I am unaware of? Among whom? – Radon Rosborough Sep 16 '14 at 23:10