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).
-
37whoever 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
-
3It's likely that whoever told this to the asker meant $\sin x^2$, which can indeed be ambiguous. – Fengyang Wang Sep 16 '14 at 00:15
-
1@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)$. – Resigned June 2023 Sep 16 '14 at 00:51
-
@JoelBosveld I don't think so. I am asking about $\sin(x)^2$, specifically. They are asking about $\sin^2 x$. – Resigned June 2023 Sep 16 '14 at 02:33
-
2Both $\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 06:10
-
I've always avoided writing “ $\sin(x)^2$ ” because I tend to first-parse it as $\sin(x^2)$ before settling on $[\sin(x)]^2$ as per the common interpretation. – ryang Mar 12 '21 at 06:43
3 Answers
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.
- 11,595
-
2Your first line holds if it is only about a single variable. However, if
xis defined asy+zyou could seesin(y+z)^2meaningsin((y+z)^2)– Dennis Jaheruddin Sep 16 '14 at 12:36 -
-
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[0]. I cannot understand how any right thinking person would use it, but many still do.
[0] http://books.google.ie/books?id=gkWunaISTsgC&lpg=PA171&ots=fC_q8JHZBU&dq=babbage%20sin&pg=PA171#v=onepage&q=babbage%20sin&f=false
– 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.
- 2,821
-
4I'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
-
9$\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 00:05
-
1in 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
-
1Honestly, 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 08: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]$.
- 36,777
- 9
-
1What 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 inpow(sin(x),2),sin(x)*sin(x)ort=sin(x); ans=t*t. – David Richerby Sep 16 '14 at 08:41 -
5It's always dangerous to talk about programming languages as if they were all the same. In Python,
sin(x) ** 2is $(\sin x)^2$ since brackets are part of the function application notation. But in Haskell,sin (x) ^ 2is $(\sin x)^2$ for a different reason (function application precedes all binary operations). Then, in J,sin (x) ^ 2is $\sin(x^2)$ due to right-associativity.Also, esoteric languages like Unlambda will always be exceptions.
– mudri Sep 16 '14 at 09:41 -
1What 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? – Resigned June 2023 Sep 16 '14 at 23:10
-