# Write the equation of a function with domain and range given, how to do that?

## The domain is $\left\{- 5 \le x \le 5\right\}$ The range is $\left\{0 \le y \le 5\right\}$ How to do I determine the equation with these two things given?

Mar 16, 2016

$f \left(x\right) = \sqrt{25 - {x}^{2}}$

#### Explanation:

One method is to construct a semicircle of radius $5$, centered at the origin.

The equation for a circle centered at $\left({x}_{0} , {y}_{0}\right)$ with radius $r$ is given by ${\left(x - {x}_{0}\right)}^{2} + {\left(y - {y}_{0}\right)}^{2} = {r}^{2}$.
Substituting in $\left(0 , 0\right)$ and $r = 5$ we obtain ${x}^{2} + {y}^{2} = 25$ or ${y}^{2} = 25 - {x}^{2}$
Taking the principal root of both sides gives $y = \sqrt{25 - {x}^{2}}$, which fulfills the desired conditions.

graph{sqrt(25-x^2) [-10.29, 9.71, -2.84, 7.16]}

Note that the above only has a domain of $\left[- 5 , 5\right]$ if we restrict ourselves to the real numbers $\mathbb{R}$. If we allow for complex numbers $\mathbb{C}$, the domain becomes all of $\mathbb{C}$.

By the same token, however, we can simply define a function with the restricted domain $\left[- 5 , 5\right]$ and in that manner create infinitely many functions which fulfill the given conditions.

For example, we can define $f$ as a function from $\left[- 5 , 5\right]$ to $\mathbb{R}$ where $f \left(x\right) = \frac{1}{2} x + \frac{5}{2}$. Then the domain of $f$ is, by definition, $\left[- 5 , 5\right]$ and the range is $\left[0 , 5\right]$

If we are allowed to restrict our domain, then with a little manipulation, we can construct polynomials of degree $n$, exponential functions, logarithmic functions, trigonometric functions, and others which do not fall into any of those categories, all of which have domain $\left[- 5 , 5\right]$ and range $\left[0 , 5\right]$