notesonly.in

One notebook for every subject — open it anywhere.

Log in

Domain Codomain and Range: Explained with Examples

The domain of a function is the set of all allowed inputs. The codomain is the set of allowed outputs declared when the function is introduced. The range is the set of outputs the function actually produces.

The distinction matters because many errors come from mixing them up. A function can be declared with a generous codomain but only ever reach part of it, and knowing the true range tells you what answers are even possible.

Key Concepts

  • Domain: every input value the function accepts; for f: A to B, the domain is A.
  • Codomain: the declared target set B; outputs must come from B, but need not cover all of it.
  • Range (image): the set of values f(x) actually takes as x runs over the domain; always a subset of the codomain.
  • Natural domain: when no domain is stated, the largest set of real numbers for which the formula makes sense.

How It Works

  1. Find the domain by excluding trouble: no division by zero, no square roots (or even roots) of negative numbers, no logarithms of non-positive numbers.
  2. Read the codomain from the function's declaration, for example "f: R to R" declares codomain R.
  3. Find the range by asking which codomain values actually occur: solve y = f(x) or study the minimum and maximum of the formula.
  4. Confirm the range sits inside the codomain; if a value is in the range but outside the declared codomain, the declaration was wrong.

Worked Example

Find the domain, codomain and range of f(x) = 1/x, declared as f: R minus {0} to R.

  1. Domain: x = 0 would divide by zero, so the domain is all real numbers except 0, as declared.
  2. Codomain: declared as R, all real numbers.
  3. Range: can 1/x equal 0? The equation 1/x = 0 has no solution, so 0 is never an output. For any other real y, x = 1/y gives f(x) = y, so every non-zero real occurs.
  4. Range = R minus {0}, a proper subset of the codomain R.

Common Misconceptions

  • "Codomain and range are the same thing." The codomain is declared; the range is earned. Here the codomain is all of R but the range misses 0.
  • "The domain is always all real numbers." Formulas like 1/x and square root of x exclude some inputs, so the domain must be found, not assumed.
  • "Every codomain element must be hit." Only "onto" functions do that; ordinary functions may leave parts of the codomain untouched.

Real-World Applications

  • Software APIs: input validation enforces the domain, and the documented return type is the codomain.
  • Graphing: knowing the range tells you how tall to draw the axes before plotting a single point.
  • Physics models: a formula for kinetic energy has range from 0 upward — negative energy values are impossible outputs.

Domain is what goes in, codomain is where outputs are allowed to land, and range is where they actually land. Find the domain by excluding impossible inputs, and find the range by checking which outputs really occur.