Google Play badge

Produce an invertible function from a non-invertible function by restricting the domain.


Produce an Invertible Function by Restricting the Domain

An important fact in mathematics is that a function can be perfectly valid and still fail to have an inverse function on its full domain. For example, the rule \(f(x)=x^2\) is one of the most familiar functions in algebra, yet on its full domain it does not have an inverse function. The reason is subtle but important: different inputs can produce the same output. In many cases, we can resolve this by choosing a smaller domain. That idea—keeping the same formula but limiting which inputs are allowed—is called restricting the domain, and it turns a non-invertible function into an invertible one.

Inverse functions matter whenever you want to "undo" a process. If one function takes a side length and gives area, or takes time and gives height, the inverse goes the other way. But an inverse function only works if each output comes from exactly one input. This lesson focuses on how to create that situation by carefully restricting the domain of a function that originally fails to be invertible.

Why inverses sometimes fail to exist

A function assigns each input exactly one output. But to have an inverse that is also a function, the original function must be one-to-one. That means no two different inputs give the same output. Graphically, as [Figure 1] shows, if a horizontal line crosses the graph more than once, then the function is not one-to-one.

Consider \(f(x)=x^2\). We have \(f(2)=4\) and \(f(-2)=4\). Two different inputs, \(2\) and \(-2\), produce the same output. If you tried to reverse the rule "square a number," the output \(4\) would not tell you whether the original input was \(2\) or \(-2\). That ambiguity prevents a true inverse function from existing on all real numbers.

Invertible function: a function that has an inverse function.

One-to-one function: a function in which different inputs always produce different outputs.

Domain restriction: limiting the set of allowed inputs so that a function has a desired property, such as being one-to-one.

The horizontal line test is a quick graphical check. If every horizontal line intersects the graph at most once, the function is one-to-one and therefore invertible on that domain. If some horizontal line intersects more than once, the function is not invertible on that domain.

Coordinate plane showing the graph of y=x^2 with a horizontal line intersecting the parabola at two points, illustrating failure of the horizontal line test
Figure 1: Coordinate plane showing the graph of y=x^2 with a horizontal line intersecting the parabola at two points, illustrating failure of the horizontal line test

This idea is different from the vertical line test. The vertical line test checks whether a graph represents a function at all. The horizontal line test checks whether a function has an inverse function. A graph can pass the vertical line test but fail the horizontal line test, which is exactly what happens with many familiar functions.

Restricting the domain

When a function is not one-to-one on its full domain, we can sometimes make it one-to-one by allowing only part of the original domain. This is called restricting the domain. The formula stays the same, but the allowed inputs change.

For \(f(x)=x^2\), the full domain is all real numbers. The problem comes from the symmetry of the parabola: values on the left and right sides match. If we restrict the domain to \(x\ge 0\), then every output comes from exactly one input. On this restricted domain, \(f(x)=x^2\) becomes invertible. We could also restrict the domain to \(x\le 0\), and that version would also be invertible.

Why restriction works

A function fails to have an inverse when the same output is repeated by different inputs. Restricting the domain removes the repeated part. Instead of changing the rule, you choose a branch or section of the graph where each output occurs only once.

This is a powerful idea because it lets you build a new function from an existing one. You are not inventing a new formula; you are selecting the part that behaves in a reversible way. In many applications, that restricted part is the only one that makes sense anyway.

A classic example: quadratic functions

Quadratic functions are the standard example because their graphs are parabolas. The graph makes the issue especially clear, and [Figure 2] displays the two natural choices for restricting the domain of \(f(x)=x^2\): the right branch \(x\ge 0\) and the left branch \(x\le 0\).

If we choose \(x\ge 0\), then the inverse is the familiar square-root function:

\[f^{-1}(x)=\sqrt{x}\]

If instead we choose \(x\le 0\), then the inverse becomes:

\[f^{-1}(x)=-\sqrt{x}\]

Both are correct, but they come from different restricted domains. This is why writing "the inverse of \(x^2\) is \(\pm\sqrt{x}\)" is not correct. An inverse function must assign exactly one output to each input, and \(\pm\sqrt{x}\) gives two outputs in general.

Coordinate plane with y=x^2, the right branch highlighted for x>=0 and the left branch highlighted for x<=0, showing two possible domain restrictions
Figure 2: Coordinate plane with y=x^2, the right branch highlighted for x>=0 and the left branch highlighted for x<=0, showing two possible domain restrictions

The same principle works for shifted quadratics such as \(f(x)=x^2-4\) or \(f(x)=(x-3)^2+1\). The graph may move, but it still has two symmetric sides. To make the function invertible, you choose one side of the parabola.

When finding an inverse, remember that the domain of the original function becomes the range of the inverse, and the range of the original becomes the domain of the inverse.

This swap of domain and range is essential. If a restricted quadratic has range \(y\ge -4\), then its inverse must have domain \(x\ge -4\). Forgetting this is one of the most common errors students make.

How to find the inverse after restriction

Once the domain has been restricted so the function is one-to-one, the algebraic process of finding the inverse is the same as for other invertible functions.

The standard method is:

Step 1: Write \(y=f(x)\).

Step 2: Swap \(x\) and \(y\).

Step 3: Solve for \(y\).

Step 4: Rewrite \(y\) as \(f^{-1}(x)\).

Step 5: State the domain of the inverse, using the range of the restricted original function.

For quadratics, solving often leads to a square root. At that moment, the chosen domain restriction tells you whether to take the positive or negative branch.

Solved examples

Worked example 1

Find the inverse of \(f(x)=x^2\) when the domain is restricted to \(x\ge 0\).

Step 1: Write the function with \(y\).

\(y=x^2\), with \(x\ge 0\).

Step 2: Swap \(x\) and \(y\).

\(x=y^2\).

Step 3: Solve for \(y\).

Taking square roots gives \(y=\pm\sqrt{x}\). But because the original domain is \(x\ge 0\), the outputs of the inverse must be nonnegative. So we choose \(y=\sqrt{x}\).

Step 4: Write the inverse.

\[f^{-1}(x)=\sqrt{x}\]

The original restricted function has range \(y\ge 0\), so the inverse has domain \(x\ge 0\).

This example explains why the square-root function is usually defined to have nonnegative outputs. It is the inverse of the restricted quadratic, not of the full quadratic on all real numbers.

Worked example 2

Find the inverse of \(f(x)=x^2-4\) when the domain is restricted to \(x\ge 0\).

Step 1: Write \(y=f(x)\).

\(y=x^2-4\), with \(x\ge 0\).

Step 2: Swap \(x\) and \(y\).

\(x=y^2-4\).

Step 3: Solve for \(y\).

Add \(4\): \(x+4=y^2\). Then \(y=\pm\sqrt{x+4}\). Because the original domain is \(x\ge 0\), we choose the nonnegative branch: \(y=\sqrt{x+4}\).

Step 4: Write the inverse.

\[f^{-1}(x)=\sqrt{x+4}\]

The original function has range \(y\ge -4\), so the inverse has domain \(x\ge -4\).

Notice that the shift downward by \(4\) changes the inverse domain. That happens because the minimum output of the original function is now \(-4\), not \(0\).

Worked example 3

Find the inverse of \(f(x)=x^2\) when the domain is restricted to \(x\le 0\).

Step 1: Write \(y=x^2\), with \(x\le 0\).

Step 2: Swap \(x\) and \(y\).

\(x=y^2\).

Step 3: Solve for \(y\).

\(y=\pm\sqrt{x}\). This time, because the original domain contains only nonpositive inputs, the outputs of the inverse must be nonpositive. So \(y=-\sqrt{x}\).

Step 4: Write the inverse.

\[f^{-1}(x)=-\sqrt{x}\]

The inverse still has domain \(x\ge 0\), but now its range is \(y\le 0\).

This pair of examples shows that the same original formula can produce different inverse functions depending on how the domain is restricted.

Worked example 4

Consider \(f(x)=|x|\). Explain how to make it invertible and find an inverse.

Step 1: Check whether it is invertible on all real numbers.

It is not, because \(|3|=3\) and \(|-3|=3\).

Step 2: Restrict the domain.

Choose \(x\ge 0\). On this domain, \(|x|=x\), so the function becomes \(f(x)=x\).

Step 3: Find the inverse.

If \(y=x\), then swapping variables still gives \(y=x\).

Step 4: State the inverse.

\[f^{-1}(x)=x\quad \textrm{for }x\ge 0\]

If instead the domain is restricted to \(x\le 0\), then \(|x|=-x\), and the inverse becomes \(f^{-1}(x)=-x\) for \(x\ge 0\).

Absolute value is a useful reminder that this topic is not only about parabolas. Any function with repeated outputs may need a domain restriction if you want an inverse function.

Choosing a useful restriction

Not every possible restriction is equally useful. In mathematics, one restriction is often chosen as the principal branch, meaning the standard branch used by convention. For \(x^2\), the standard choice is usually \(x\ge 0\), which gives the principal square root \(\sqrt{x}\).

In applications, the best restriction depends on context. If \(x\) represents time, negative values may not make sense. If \(x\) represents a physical length, then \(x\ge 0\) is usually required. A domain restriction is not arbitrary; it should match the situation you are modeling.

The square-root symbol \(\sqrt{x}\) is defined to mean the nonnegative square root. That convention exists because mathematicians want \(\sqrt{x}\) to represent a single value, not two values.

This convention is one reason inverse functions are so useful in advanced math, science, and engineering. A system that gives one clear answer is easier to analyze, graph, and apply.

Graphs, domains, and ranges

Inverse functions have a beautiful geometric relationship: their graphs are reflections of each other across the line \(y=x\). In the case of a restricted quadratic and its inverse, [Figure 3] shows the right half of the parabola and the square-root curve as mirror images across that line.

If the original function is \(f(x)=x^2\) with domain \(x\ge 0\), then points such as \((2,4)\) on the original graph become \((4,2)\) on the inverse graph. Swapping coordinates matches the algebraic step of swapping \(x\) and \(y\).

Coordinate plane showing y=x^2 restricted to x>=0, the line y=x, and y=sqrt(x) as the reflected inverse curve
Figure 3: Coordinate plane showing y=x^2 restricted to x>=0, the line y=x, and y=sqrt(x) as the reflected inverse curve

This graphical view also helps with domain and range. The restricted quadratic has domain \([0,\infty)\) and range \([0,\infty)\). Its inverse, \(\sqrt{x}\), also has domain \([0,\infty)\) and range \([0,\infty)\). For \(x^2-4\) with \(x\ge 0\), the range becomes \([-4,\infty)\), so the inverse domain is \([-4,\infty)\).

Later, when you study more advanced functions, this reflection idea keeps appearing. As we saw with the parabola in [Figure 2], choosing a branch of the graph is exactly what makes the reflection produce another function instead of a sideways graph that fails the vertical line test.

Original restricted functionRestricted domainRangeInverseDomain of inverse
\(x^2\)\(x\ge 0\)\(y\ge 0\)\(\sqrt{x}\)\(x\ge 0\)
\(x^2\)\(x\le 0\)\(y\ge 0\)\(-\sqrt{x}\)\(x\ge 0\)
\(x^2-4\)\(x\ge 0\)\(y\ge -4\)\(\sqrt{x+4}\)\(x\ge -4\)
\(|x|\)\(x\ge 0\)\(y\ge 0\)\(x\)\(x\ge 0\)

Table 1. Examples of non-invertible functions made invertible by restricting the domain.

Real-world applications

Restricting domains is not just a classroom trick. It appears whenever a formula describes a relationship with more than one mathematical possibility, but the real situation allows only one.

Suppose the area of a square is given by \(A=s^2\), where \(s\) is the side length. On all real numbers, \(s^2\) is not one-to-one. But in geometry, side length must satisfy \(s\ge 0\). That real-world restriction makes the function invertible, and the inverse is \(s=\sqrt{A}\). The physical meaning tells you which branch to choose.

Another example comes from projectile motion. A height model may involve a quadratic expression in time. Over a longer interval, the same height can occur twice: once on the way up and once on the way down. If you want the inverse relationship from height to time, you must restrict the domain to just the rising part or just the falling part.

Why engineers and scientists care

Many models are reversible only on part of their domain. A machine may operate only for nonnegative time, a distance may be only nonnegative, or a sensor may be calibrated on a single branch of a curve. Restricting the domain turns a complicated relation into a reliable inverse rule.

Economics and medicine use the same idea. A dose-response curve or a cost model may not be one-to-one over all possible values, but within the realistic operating range it can often be inverted meaningfully.

Common mistakes

One frequent mistake is finding an algebraic expression for the inverse without first checking whether the original function is one-to-one. If you start with a non-invertible function and skip the restriction, your "inverse" may not actually be a function.

Another common mistake is writing \(f^{-1}(x)=\pm\sqrt{x}\). That expression describes two possible numbers, not a single output. An inverse function needs exactly one output for each input, so you must choose the branch that matches the restricted domain.

A third mistake is forgetting to state the new domain and range. For example, if \(f(x)=x^2-4\) with \(x\ge 0\), then the inverse is not defined for every real number. Its domain is \(x\ge -4\), because those are exactly the outputs the original function can produce.

"An inverse function does not just undo a rule; it undoes the rule on a domain where the rule is truly reversible."

That idea is the heart of this topic. Reversibility is not only about algebraic manipulation. It is about choosing a domain on which the function behaves in a one-to-one way.

Download Primer to continue