3

Notation question: Is $-1^2$ equal to $1$ (because it's $(-1)^2$, as seems obvious) or $-1$ (because it's $-(1^2)$). E.g., is the $-1$ a single thing (token or whatever) in the equation? Similarly, let $x$ be $1$. Is $-x^2$ $1$ or $-1$?

I believe $-1^2$ is $1$ because "$-1$" is a single thing (a negative number), but that $-x^2$ where $x$ is $1$ is $-1$ because it's $-(x^2)$, the "$-x$" is not a single thing and exponeniation happens before negation.

Am I correct or incorrect? Or correct, but for the wrong reason?

This may seem incredibly odd to ask, but I'm suddenly unsure of something I've been sure of for more than four decades. Why would I question it? Because in JavaScript, -1 is not a numeric literal, it's a unary - operator followed by a numeric literal for the number 1, and this had pretty major ramifications for adding an exponentiation operator to the language, because the unary - has very high precedence. But I'm sure...ish that $-1$ in math notation is a literal number (and that exponentiation happens before negation).

  • 3
    This is purely anecdotal, but I've always read $-1^2$ as $-(1^2)$. – axblount Dec 05 '18 at 15:33
  • 3
    In analysis (such as power series expansions of trigonometric functions) you will see a lot of expressions involving $(-1)^n$. It is invariably always written this way, because $-1^n$ would mean something different (and trivial). – hmakholm left over Monica Dec 05 '18 at 15:40

2 Answers2

5

The exponent binds first, so $-1^2 = -1\cdot 1 = -1.$

ncmathsadist
  • 49,383
1

You’re confusing $(-1)^2$ with $-1^2$. Recall that exponents have the priority, so you get

$$-1^2 = -(1)^2 = -1\cdot 1 = -1$$

On the other hand, for $(-1)^2$, you get

$$(-1)^2 = (-1)\cdot(-1) = +1$$

The same idea applies to all negative numbers raised to an even power. If the whole negative number is in parentheses, your answer becomes positive, but if the number is not within parentheses, the exponent comes first so the answer becomes negative.

KM101
  • 7,176
  • 2
    I remembered that exponents had priority. My confusion was whether $-1$ is a single token (as we'd put it in programming), a number; or two tokens, negation and a number. I got myself in a right confused state over it. But of course, for years I've been reading things like $-2^{32} - 1$ correctly. Off day. :-) – T.J. Crowder Dec 05 '18 at 15:43
  • (sigh... $-2^{32} + 1$ I mean...) – T.J. Crowder Dec 05 '18 at 15:55
  • 2
    @T.J.Crowder - that confuses a lot of people! Thinking about it as a single token seems most natural at first, but you figured out in the question exactly why we don't do that: because we want $-x^2$ and $x^2$ to be different. – Deusovi Dec 05 '18 at 17:53