What you'll learn
- How to combine two functions to form a composite function.
- How to find and use an inverse function.
- Why domains and ranges matter, especially when a function is not one-to-one.
- How the graphs of a function and its inverse are related.
Function basics
A function is a rule that assigns exactly one output to each permitted input. If the function is called fff, then f(x)f(x)f(x) means the output produced when the input is xxx.
For example, if f(x)=3x−2f(x)=3x-2f(x)=3x−2, then f(5)=3(5)−2=13f(5)=3(5)-2=13f(5)=3(5)−2=13.
Domain and range
The domain of a function is the set of permitted input values. The range is the set of output values the function can produce.
The domain may be stated explicitly, such as x≥0x\geq 0x≥0, or implied by the formula. For example, the domain of f(x)=x−2f(x)=\sqrt{x-2}f(x)=x−2 must satisfy x≥2x\geq 2x≥2.
Finding a domain and range
Let f(x)=x−2+1f(x)=\sqrt{x-2}+1f(x)=x−2+1.
- For the square root to be defined, its contents must be non-negative:
Therefore, the domain is x≥2x\geq 2x≥2.
- Since x−2≥0\sqrt{x-2}\geq 0x−2≥0, adding one gives
- Every value greater than or equal to one can be produced, so the range is f(x)≥1f(x)\geq 1f(x)≥1.
Composite functions
A composite function is formed by applying one function and then applying another function to the result.
Composite function notation
The notation fg(x)fg(x)fg(x) means f(g(x))f(g(x))f(g(x)): apply ggg first, then apply fff. It may also be written as (f∘g)(x)(f\circ g)(x)(f∘g)(x).
The order is important. In general,
fg(x)≠gf(x). fg(x)\neq gf(x). fg(x)=gf(x).Think of the function written closest to xxx as the one acting first.
Finding composite functions
Let
f(x)=2x+3,g(x)=x2−1. f(x)=2x+3,\qquad g(x)=x^2-1. f(x)=2x+3,g(x)=x2−1.Find fg(x)fg(x)fg(x) and gf(x)gf(x)gf(x).
- For fg(x)=f(g(x))fg(x)=f(g(x))fg(x)=f(g(x)), substitute the whole expression g(x)=x2−1g(x)=x^2-1g(x)=x2−1 in place of the input of fff:
- Simplify:
- For gf(x)=g(f(x))gf(x)=g(f(x))gf(x)=g(f(x)), substitute f(x)=2x+3f(x)=2x+3f(x)=2x+3 into ggg:
- Expand and simplify:
The two composites are different, confirming that the order matters.
Substituting only for one occurrence of x
When forming a composite, replace every occurrence of the input variable with the entire inner function. Use brackets before expanding.
Evaluating a composite at a particular input
You can find a numerical value by working from the inside out. It is often quicker to calculate the inner output first rather than finding a full algebraic expression.
Evaluating a composite function
Let f(x)=1x+1f(x)=\frac{1}{x+1}f(x)=x+11 and g(x)=3x−2g(x)=3x-2g(x)=3x−2. Find fg(4)fg(4)fg(4).
- Apply the inner function first:
- Use this result as the input to fff:
- Therefore,
Domains of composite functions
For fg(x)fg(x)fg(x) to be defined:
- xxx must belong to the domain of ggg.
- The output g(x)g(x)g(x) must belong to the domain of fff.
Finding the domain of a composite
Let f(x)=xf(x)=\sqrt{x}f(x)=x and g(x)=2x−6g(x)=2x-6g(x)=2x−6. Find fg(x)fg(x)fg(x) and its domain.
- Substitute g(x)g(x)g(x) into fff:
- The expression inside the square root must be non-negative:
- Solving gives x≥3x\geq 3x≥3, so the domain of fgfgfg is x≥3x\geq 3x≥3.
Inverse functions
An inverse function reverses the effect of the original function. The inverse of fff is written f−1f^{-1}f−1.
Inverse function
If fff maps an input xxx to an output yyy, then f−1f^{-1}f−1 maps that output yyy back to the original input xxx.
For example, if f(x)=3x+5f(x)=3x+5f(x)=3x+5, the function multiplies by three and then adds five. Its inverse must subtract five and then divide by three.
Function and inverse undo each other
Where both composites are defined,
f−1f(x)=xandff−1(x)=x. f^{-1}f(x)=x\qquad\text{and}\qquad ff^{-1}(x)=x. f−1f(x)=xandff−1(x)=x.Be careful: f−1(x)f^{-1}(x)f−1(x) does not mean 1f(x)\frac{1}{f(x)}f(x)1. The reciprocal and the inverse function are different ideas.
Finding an inverse algebraically
To find an inverse:
- Write y=f(x)y=f(x)y=f(x).
- Rearrange the equation to make xxx the subject.
- Swap the labels xxx and yyy, then write the result as f−1(x)f^{-1}(x)f−1(x).
Finding an inverse function
Find the inverse of f(x)=2x−35f(x)=\frac{2x-3}{5}f(x)=52x−3.
- Begin with
- Rearrange to make xxx the subject:
- Exchange the input and output labels:
- Check by composing the functions:
Treating the inverse as a reciprocal
The notation f−1(x)f^{-1}(x)f−1(x) means the inverse function, not 1f(x)\frac{1}{f(x)}f(x)1. For example, the inverse of f(x)=2xf(x)=2xf(x)=2x is x2\frac{x}{2}2x, whereas its reciprocal is 12x\frac{1}{2x}2x1.
When does an inverse exist?
A function has an inverse function only if it is one-to-one.
One-to-one function
A function is one-to-one if different permitted inputs always produce different outputs. Equivalently, each value in the range comes from exactly one input.
On a graph, a one-to-one function passes the horizontal line test: every horizontal line meets the graph at most once.
For example, f(x)=x2f(x)=x^2f(x)=x2 on the domain of all real numbers is not one-to-one because f(2)=f(−2)=4f(2)=f(-2)=4f(2)=f(−2)=4. Therefore, it does not have an inverse function on that full domain.
Its domain can be restricted, for example to x≥0x\geq 0x≥0. On this restricted domain, it is one-to-one and has the inverse f−1(x)=xf^{-1}(x)=\sqrt{x}f−1(x)=x.
Choosing the correct square-root branch
When f(x)=x2f(x)=x^2f(x)=x2 is restricted to x≥0x\geq 0x≥0, its inverse is x\sqrt{x}x. If it is restricted to x≤0x\leq 0x≤0, its inverse is −x-\sqrt{x}−x.
Restricting a quadratic to find its inverse
Let f(x)=(x−2)2+1f(x)=(x-2)^2+1f(x)=(x−2)2+1 with domain x≥2x\geq 2x≥2. Find f−1(x)f^{-1}(x)f−1(x).
- Write
- Rearrange:
Since the original domain has x≥2x\geq 2x≥2, choose the positive square root:
x−2=y−1. x-2=\sqrt{y-1}. x−2=y−1.- Make xxx the subject and exchange the labels:
- The domain of the inverse is the range of the original function. Since f(x)≥1f(x)\geq 1f(x)≥1, the inverse has domain x≥1x\geq 1x≥1.
Domains and ranges of inverse functions
The domain and range exchange roles when a function is inverted.
Swapping domain and range
The domain of f−1f^{-1}f−1 is the range of fff, and the range of f−1f^{-1}f−1 is the domain of fff.
This happens because the inputs and outputs are reversed. It is especially important for square roots, logarithms and restricted quadratics.
Graphs of inverse functions
The graph of y=f−1(x)y=f^{-1}(x)y=f−1(x) is the reflection of the graph of y=f(x)y=f(x)y=f(x) in the line y=xy=xy=x.
This reflection exchanges the coordinates of every point. If (a,b)(a,b)(a,b) lies on y=f(x)y=f(x)y=f(x), then (b,a)(b,a)(b,a) lies on y=f−1(x)y=f^{-1}(x)y=f−1(x).

The graph of a function and its inverse may intersect. Any intersection on the line y=xy=xy=x can be found by solving
f(x)=x. f(x)=x. f(x)=x.Checking an inverse graph
Before sketching, swap some easy coordinate pairs and reflect any endpoints or asymptotes in y=xy=xy=x. The original domain should become the inverse range.
In the exam
- Read composites from right to left: in fg(x)fg(x)fg(x), apply ggg first.
- Use brackets when substituting one function into another, and check the resulting domain.
- Before finding an inverse, check that the function is one-to-one or note the stated domain restriction.
- Verify an inverse using f−1f(x)=xf^{-1}f(x)=xf−1f(x)=x, and remember that the domain and range exchange.
- For an inverse graph, reflect coordinates in y=xy=xy=x rather than simply turning the page or changing signs.
Check yourself
- If f(x)=x+4f(x)=x+4f(x)=x+4 and g(x)=x2g(x)=x^2g(x)=x2, can you find both fg(x)fg(x)fg(x) and gf(x)gf(x)gf(x)?
- Why does f(x)=x2f(x)=x^2f(x)=x2 need a restricted domain before it can have an inverse?
- What happens to the domain and range when a function is inverted?