Finding the domain and range of a function is a process that can often be done with algebra or with the aid of graphical means.
Formally, a function is a relation between a set of inputs (called the domain) that generate a particular set of outputs (called the range). For example, has a domain of all real numbers (since any value of is possible) and a range of 0 and positive numbers (since the output cannot be negative).
In practice, domain is most commonly restricted by either a) division by zero or b) invalid input of square roots and logarithms.
For example, cannot have an input of 0, since this causes the denominator to be 0. Hence the domain is all real numbers but 0.
If we assume real numbers only, has a domain of 0 and positive numbers, since taking the square root of a negative number is not possible in real numbers (although it is possible in complex numbers).
The variety of circumstances range is restricted is larger than with the domain. Here is an example:
the horizontal line at has only an output of so that is the range. If a line is not horizontal, the range is all real numbers. We can justify this algebraically by starting at the form and finding the inverse: swapping the and gets and isolating the gets division by zero only happens when (that is, the original graph is a horizontal line!).