0

I know this has been discussed before (Why is $-5^2=-25$?) but this makes no sense in my head, maybe someone can clarify.

To me $-5^2$ means the number $-5$ (a number in $\mathbb R$), squared. It's not $0 - 5^2$ where $-$ is an operation.

Put in other words:

$x^2$ with $x=-5$

How come $-5^2$ is then interpreted as $5$ squared then negated.


EDIT: Adding some additonal info since it seems the point wasn't conveyed enough.

I understand the operator precedence. And if this was a question of $2-5^2$, it would be obvious, it's 2 minus 5squared.

But what I don't get is why the convention states that -5 is not a number (5 in the negative $\mathbb R$ axis), but a "magical" 0-5.

I don't know, in my programming brain it just doesn't make sense :)

Xavier
  • 35
  • 6
    Because the convention is that $-5^2 = - (5^2)$. Look up PEMDAS. – copper.hat Nov 16 '22 at 02:55
  • 2
    You might be interested to learn about order of operations, and in particular about the unary minus operator. It may mean what you said to you, but that violates the conventions for order of operations. – Lee Mosher Nov 16 '22 at 02:56
  • 10
    "To me -5^2 means the number -5 (a number in R), squared" Unfortunately, that's not what it means to the rest of the world. There is a standard convention for order of operations here; what you're describing would be written as "$(-5)^2$." You can prefer a different convention for order of operations, but c'est la vie. – Noah Schweber Nov 16 '22 at 02:56
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 16 '22 at 02:56
  • 1
    For everybody else, $-5^2$ is $-x^2$ with $x=5$. On the other hand, $x^2$ with $x=-5$ is written as $(-5)^2$. – azif00 Nov 16 '22 at 02:59
  • 6
    If you want to communicate with other mathematicians, you'll have to adopt this convention. $-5^2$ could be $(-5)^2$ or $-(5^2).$ Mathematicians and scientists have decided on one of those. Neither meaning is "correct" logically, it is a communication convention, so we don't always have parentheses everywhere. – Thomas Andrews Nov 16 '22 at 02:59
  • Why is $3+2\times 4$ equal to $11$ and not $20$? It's because when we have multiple operations being performed in the same expression, we have rules of "precedence" that say how to evaluate the whole expression. For $3+2\times 4$ we do the multiplication first even though it comes second when reading left to right. Likewise in $-5^2$ we do the squaring first and the sign-change second. If we did it your way then someone inevitably would complain, "To me it means the negative of the square of the number $5$." If we ever want to write $-5^2$ in math, someone had to lose that argument. – David K Nov 16 '22 at 03:46

3 Answers3

5

You seem to be considering $-5$ as an elementary expression, and separate from the subtraction operation $0 - 5$. Most mathematicians would actually consider $-$ to be primarily a unary operation which transforms one number into another one. In particular, $-5$ denotes the solution to the equation $5 + x = 0$. Thus, $-5$ is neither a shorthand for $0 - 5$ nor ane elementary expression, but rather a unary operation applied to an input.

That we read $-5^2$ as $-(5^2)$ rather than $(-5)^2$ is just convention.

On a side note, subtraction can then be seen as just a shorthand rather than a primary operation. The expression $0 - 5$ is an abbreviation for $0 + (-5)$.

Arno
  • 3,788
  • 1
    Minor point "substraction" should be "subtraction". – badjohn Nov 16 '22 at 11:30
  • 1
    @badjohn Thanks, fixed. – Arno Nov 16 '22 at 11:44
  • "That we read −52 as −(52) rather than −(52) is just convention." you wrote the same thing in both cases. – Xavier Nov 16 '22 at 17:16
  • That's actually my question, why is -5 considered an unary operation, instead of what it is, the real number negative 5. I don't see how -5 and the OPERATION 0 - 5 (notice the spacing) are the same thing.

    Basically the "convention" doesn't really allow us to represent the full R domain in plain numbers?

    – Xavier Nov 16 '22 at 17:17
  • @Xavier $-5$ is not an operation. It is the result of applying the unary operation $-$ to the number $5$. – Arno Nov 16 '22 at 17:20
  • 1
    I think the core issue here is the distinction between a number and the description of a number. The numbers exist regardless of what symbols we use to describe them. The digit $5$ happens to serve as a concise name of a particular number, but if you start putting other symbols next to it you can end up with something that doesn't really involve the number "five" in any particularly significant way; for example if we write $53.$ The expression $-5$ describes a number, but so do $\sqrt{5},$ $\ln 5,$ and $1 + \sqrt5.$ ... – David K Nov 16 '22 at 18:09
  • 2
    ... It turns out most real numbers cannot be described at all, and most of those that can be described cannot be described without invoking operations on other numbers. So the fact that we say $-5$ is an expression consisting of an operation (negation) applied to the number $5$, rather than an atomic name of a real number that can be dropped into any expression without needing parentheses in order to maintain the desired order of operations, is more the rule than the exception. – David K Nov 16 '22 at 18:14
4

Think about, for instance, $3 - x^2$ when $x = 5$. What do you think its value should be?

  • 3
    This answer doesn't make much sense for me, in regards to the question. OP specifically means that the "-" in "-5" belongs to the number; but the "-" in "3-5" is an operator which does not belong to the number (i.e., the latter is "3-(+5)", while the first is not "-(+5)"). By the same argumentation, OP interprets "-5^2" as "(-5)^2" instead of "-(5^2)", which is perfectly logical and consistent if you interpret the "-" as a non-operator here. – AnoE Nov 16 '22 at 11:02
3

It is about the order of operations. When we write $(-x)^2$, what it means is $(-1)^{2}(x)^2$. Hence, it equal to $x^2$. On the other hand, $-x^2$ means $(-1)(x^2)$. Therefore, when we write $(-5)^2$, it mean $(-1)(5^2)$ = $-25$.

  • This seems to be more of an elaboration of OP's problem description than an answer to his "why" question (he seems to be pretty aware that that's how it works). I guess he is looking for the reasoning behind that. – AnoE Nov 16 '22 at 11:06
  • @AnoE: I find that this elaboration actually explains the issue, by showing what the - in $-5$ mean – WoJ Nov 16 '22 at 11:30
  • It doesn't really make sense to me to claim that $(-x)^2$ means $(-1)^2(x)^2$. It happens to be equal, but that is because exponentiation distributes over products. But $(-x)^2$ means first applying the additive inverse to $x$, and then squaring the result. – Arno Nov 16 '22 at 15:57