Ordering Products, Powers, and Parameters of Trigonometric Functions
Date: 10/31/2010 at 21:11:03 From: Jim Subject: Order of operations I am tying to clarify the order of operations as it applies to trigonometric functions. I want to know what the correct order of operations is for an expression like sin2x. When do we know that the multiplication is implied? When my textbook says sin2x, I know that it means sin(2x). But often the parentheses are missing. Is it then correct to assume that the multiplication is always implied to be in parentheses? If that's true, wouldn't that imply that sinxcosy would have to be read as sin(xcosy)? (I've seen that written in my textbook too, but I know I am supposed to interpret that as (sinx)(cosy).) I know that grouping symbols should always be included to avoid ambiguity; but when there are none, what is the correct way to interpret these expressions?
Date: 10/31/2010 at 23:20:32 From: Doctor Peterson Subject: Re: Order of operations Hi, Jim. I've pondered this a number of times, and my own conclusion is that there are no actual rules. What we are looking at here is a language that has developed not by deliberate design, but organically -- with agreement among its users -- just as any natural language evolves. Linguists can study a language to figure out its rules, but there are essentially reverse-engineering something that exists without explicit rules. You can see some of that development in the order of operations here: History of the Order of Operations http://mathforum.org/library/drmath/view/52582.html The language of trigonometry is especially hard to explain logically. I just looked through Cajori's _History of Mathematical Notations_, and the variety of early forms is remarkable. In particular, he shows how much inconsistency there was in writing (sin(x))^2 Some would write it as sin x^2 Others would render it as (sin x)^2 And still others would denote it as sin^2 x That last way is the usual one today, despite long-acknowledged difficulties. Specifically, it could be taken to mean sin(sin(x)) -- a repeated application of the sine function. But Cajori points out "As functions of the last type [sin(sin x)] do not ordinarily present themselves, the danger of misinterpretation is very much less than in case of log^2 x, where log x * log x and log(log x) are of frequent occurrence in analysis." What he's saying is that this abbreviated notation is used because it is sufficient to distinguish commonly used forms from one another: experience tells us that someone wouldn't mean sin(sin(x)). I think that basic rule of common sense lies behind the laxness in the use of other forms, such as the second and third examples you mention: sin 2x means sin(2x) sin x cos y means sin(x)cos(y) These mean what they do simply because we know enough NOT to expect that sin 2x would mean sin(2)*x sin x cos y would mean sin(x*cos(y)) There is perhaps also a bit of typographical consideration: the spacing generally suggests that 2x belongs as a unit, as do sinx and cosy in the second example. So it may be possible to examine all usages linguistically and come up with some rules -- for example, "multiplication precedes trig functions except where another trig function would be a factor." But what we really do in reading these expressions is to use common sense based on mathematical experience. Does that help at all? - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/
Date: 11/01/2010 at 00:50:07 From: Jim Subject: Thank you (Order of operations) This helps a lot. I appreciate knowing that this is not as cut and dried as I thought it must be. Thanks for the very clear explanation -- I really appreciate it! Jim
Date: 11/01/2010 at 11:29:36 From: Doctor Peterson Subject: Re: Thank you (Order of operations) Hi, Jim. I just checked for what others might have said about this, and found the following conversation, which was not archived. ===================================================================== Dear Doctor Math, Are there rules (relating to order of operations maybe) that set guidelines for using parentheses with trig functions? For example, we are told to write the derivative of ... sin(4x^2 - 2) ... as 8x cos(4x^2) This leaves no ambiguity as to whether ... cos(4x^2 - 2) is multiplied by 8x ... or just 4x^2 - 2 is multiplied by 8x Positioning the 8x term in front helps avoid confusion about where one expression ends and another one begins. But mathematically, and conventionally, what would this mean? cos(4x^2 - 2)(8x) Personally, I would take it to mean [cos(4x^2 - 2)] (8x) If I wanted to convey "take the cosine of the whole quantity," I would write cos[(4x^2-2)(8x)] I understand it's best to use parentheses and brackets to erase any doubt, but would it be wrong to write cos(a) (b) when you mean (b)cos(a)? When no parentheses are used -- for example, with sin 2x -- I know we usually take this to mean sin(2x). So that's something else to think about! Bev
Hi Bev, Good question! You've caught us mathematicians with our pants down. I think it's mostly out of laziness that we even write things like this "sin x" Almost every other function other than the trigonometric (and possibly logarithmic) ones requires that there be parentheses around the parameter(s). Once you admit the legality of a form like "sin 2x," you've opened a can of worms. Even something like this ... f(x) = sin x + cos x ... could then mean this, right? f(x) = sin(x + cos(x)) This is going to sound awful, but I have seen this sloppy usage so often that I just "know" what's intended. We mathematicians simply do a lot of "assumed grouping." For example, no professional mathematician would ever write a product this way: x2 She'd always write it like this: 2x In the same way, I'd never write ... sin x 2 ... or even (sin x)2 I'd move the 2 in front, to make it this ... 2 sin x ... or this: 2 sin(x) Likewise, interpreting this ... sin 2x ... as "the sine of 2, multiplied by x" would be very unusual, since first off, we'd almost surely put the "x" in front of the "sin 2"; and second, unless there's a "degree" symbol after the "2," it would be incredibly unlikely that you'd be taking the sine of 2 radians. Most computer languages require parentheses for the trig functions (well, any functions), because they have to be precise. If you do put parentheses after sin, cos, et cetera, then there's no doubt that the contents of those parentheses represent exactly the parameter to the function. So for your example of "cos(4x^2 - 2)(8x)", every mathematician in the world would interpret this as the cosine of 4x^2 - 2, with that result then multiplied by 8x. I'm sorry there's not a clean, clear answer, but that's the way it is: an ugly skeleton in the mathematician's closet. - Doctor Tom, The Math Forum http://mathforum.org/dr.math/ ===================================================================== So, Dr. Tom more or less agrees with me, but says it in ways that complement my explanations. - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.