Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can't figure out the difference between them. I have read wiki article about codomains and images, but what is the difference? It seems confusing the examples part in codomain article. How can we claim this:

$f: \mathbb R \to \mathbb R$,

where $f(x) = x^2$? This function will never assume negative number, so why the codomain is R? After all, the authors might have gone even further and claim that codomain is the set of complex numbers!

share|cite|improve this question
closely related:… – t.b. Jan 8 '12 at 14:48
up vote 10 down vote accepted

You cannot read off the codomain from the formula $f(x)=x^2$.

Domain and codomain really are part of the data which comes with a function. This means that you cannot just say

"Let $f$ be the function $x\mapsto x^2$."

Instead, you always have to specify domain and codomain first, as in

"Let $f$ be the function from $\mathbb R$ to $\mathbb R$ mapping $x$ to $x^2$."

Or, as you mentioned, it could be

"Let $f$ be the function from $\mathbb R$ to $\mathbb C$ mapping $x$ to $x^2$."


"Let $f$ be the function from $\mathbb C$ to $\mathbb C$ mapping $x$ to $x^2$."

This will really be different functions.

Of, course, if you want to define a function $f\colon X\to Y$ you have to make sure that $f(x)$ actually is an element in $Y$. Therefore,

"Let $f$ be the function from $\mathbb C$ to $\mathbb R$ mapping $x$ to $x^2$."

does not define a function.

The image of a function $f\colon X\to Y$ is, by the way, the subset of $Y$ consisting of all element $y\in Y$ for which there exists an element $x\in X$ with $f(x)=y$.

share|cite|improve this answer
Thanks a lot, Rasmus! But isn't square of complex number a rational number? – Zapadlo Jan 8 '12 at 15:13
@Zapadlo: No, it's not. The answer is also no, if you meant real instead of positive. The square of $1+i$, for instance, is not a real number. – Rasmus Jan 8 '12 at 16:04
(replace real with rational in my previous comment) – Rasmus Jan 8 '12 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.