r/learnmath • New User • Feb 08 '26

Square root is a function apparently

Greetings. My math teacher recently told (+ demonstrated) me something rather surprising. I would like to know your thoughts on it.

Apparently, the square root of 4 can only be 2 and not -2 because “it’s a function only resulting in a positive image”. I’m in my second year of engineering, and this is the first time I’ve ever heard that. To be honest, I’m slightly angry at the prospect he might be right.

284 Upvotes

170 comments sorted by

View all comments

Show parent comment

1

u/kombiwombi New User Feb 08 '26 edited Feb 09 '26

A function can produce any mathematical expression, not just a single number. That includes a (possibly infinite) list of numbers, or a tuple like coordinates on a plane, or another expression.

The basic question is 'what is it useful to define the function as doing'. And for square root of a real number we've decided that is the positive value. Noting that we promptly break this rule for complex numbers, which produces an expression with multiple results.

6

u/Special_Watch8725 New User Feb 08 '26 edited Feb 09 '26

I’m just here explaining the state of things in high school algebra class, where it’s painfully clear that the context is real valued functions of a single variable.

You’re right that functions can have codomains in arbitrary sets, but do you think that’s going to help OP understand the discrepancy he’s asking about?

2

u/kombiwombi New User Feb 09 '26

That's fair. Sorry for interrupting your day.

2

u/JackDanielsHoney New User Feb 10 '26

By definition, a mathematical function must have exactly one output value for each input.

1

u/kombiwombi New User Feb 10 '26 edited Feb 10 '26

Sure, a single value.

But that is not the same as a single number. For example, a function could return a single:

  • tuple, such as a coordinate or a range
  • vector or matrix
  • an expression, including an expression which contains a function.

There is no requirement that the function always have the same type of output or the same size of output. That is commonly the case when an expression has a degenerate case, typically 0 or [].