College Algebra

Composition and Inverse Functions

Last updated: March 2026 · Advanced
Before you start

You should be comfortable with:

Real-world applications
πŸ’Š
Nursing

Medication dosages, IV drip rates, vital monitoring

Function composition chains two functions together β€” the output of one becomes the input of the next. Inverse functions reverse the process entirely. Together, these ideas form the foundation for solving equations, converting units, and understanding how multi-step processes can be undone.

Composition of Functions

The composition of ff with gg, written (f∘g)(x)(f \circ g)(x), means β€œapply gg first, then apply ff to the result”:

(f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x))

The function gg is the inner function and ff is the outer function. Composition is not commutative β€” in general, f∘gβ‰ g∘ff \circ g \neq g \circ f.

Worked Example 1: Basic Composition

Let f(x)=2x+3f(x) = 2x + 3 and g(x)=x2βˆ’1g(x) = x^2 - 1.

(f∘g)(x)=f(g(x))=f(x2βˆ’1)=2(x2βˆ’1)+3=2x2βˆ’2+3=2x2+1(f \circ g)(x) = f(g(x)) = f(x^2 - 1) = 2(x^2 - 1) + 3 = 2x^2 - 2 + 3 = 2x^2 + 1

(g∘f)(x)=g(f(x))=g(2x+3)=(2x+3)2βˆ’1=4x2+12x+9βˆ’1=4x2+12x+8(g \circ f)(x) = g(f(x)) = g(2x + 3) = (2x + 3)^2 - 1 = 4x^2 + 12x + 9 - 1 = 4x^2 + 12x + 8

Since 2x2+1β‰ 4x2+12x+82x^2 + 1 \neq 4x^2 + 12x + 8, composition order matters.

Worked Example 2: Evaluating at a Point

Using the same ff and gg, find (f∘g)(3)(f \circ g)(3).

Method 1 (compose, then evaluate): (f∘g)(x)=2x2+1(f \circ g)(x) = 2x^2 + 1, so (f∘g)(3)=2(9)+1=19(f \circ g)(3) = 2(9) + 1 = 19.

Method 2 (evaluate step by step): g(3)=9βˆ’1=8g(3) = 9 - 1 = 8, then f(8)=2(8)+3=19f(8) = 2(8) + 3 = 19.

Both methods give the same result. Method 2 is faster for a single evaluation; Method 1 is better when you need the full composed formula.

Domain of a Composition

The domain of (f∘g)(x)(f \circ g)(x) is not simply the domain of gg. You need:

  1. xx must be in the domain of gg (so g(x)g(x) is defined)
  2. g(x)g(x) must be in the domain of ff (so f(g(x))f(g(x)) is defined)

Worked Example 3: Domain Restrictions from Composition

Let f(x)=1xβˆ’2f(x) = \frac{1}{x - 2} and g(x)=xg(x) = \sqrt{x}.

Find the domain of (f∘g)(x)=f(x)=1xβˆ’2(f \circ g)(x) = f(\sqrt{x}) = \frac{1}{\sqrt{x} - 2}.

Restriction 1: g(x)=xg(x) = \sqrt{x} requires xβ‰₯0x \geq 0.

Restriction 2: ff requires its input ≠2\neq 2, so x≠2\sqrt{x} \neq 2, meaning x≠4x \neq 4.

Domain of f∘gf \circ g: [0,4)βˆͺ(4,∞)[0, 4) \cup (4, \infty).

Worked Example 4: Another Domain Analysis

Let f(x)=ln⁑(x)f(x) = \ln(x) and g(x)=4βˆ’x2g(x) = 4 - x^2.

(f∘g)(x)=ln⁑(4βˆ’x2)(f \circ g)(x) = \ln(4 - x^2)

Restriction from gg: gg is defined for all xx (no restriction from gg alone).

Restriction from ff: ln⁑\ln requires its argument positive: 4βˆ’x2>04 - x^2 > 0, so x2<4x^2 < 4, giving βˆ’2<x<2-2 < x < 2.

Domain of f∘gf \circ g: (βˆ’2,2)(-2, 2).

Decomposing Functions

Given a complex function, we can write it as a composition of simpler functions.

Example: Express h(x)=(3xβˆ’7)5h(x) = (3x - 7)^5 as f∘gf \circ g.

Choose g(x)=3xβˆ’7g(x) = 3x - 7 (inner) and f(x)=x5f(x) = x^5 (outer). Then f(g(x))=(3xβˆ’7)5=h(x)f(g(x)) = (3x - 7)^5 = h(x).

Example: Express k(x)=ln⁑(x)k(x) = \sqrt{\ln(x)} as f∘gf \circ g.

Choose g(x)=ln⁑(x)g(x) = \ln(x) and f(x)=xf(x) = \sqrt{x}. Then f(g(x))=ln⁑(x)=k(x)f(g(x)) = \sqrt{\ln(x)} = k(x).

Decomposition is not unique β€” there may be multiple valid ways to split a function.

Inverse Functions

A function ff has an inverse function fβˆ’1f^{-1} if and only if ff is one-to-one (each output comes from exactly one input). When the inverse exists:

f(fβˆ’1(x))=xandfβˆ’1(f(x))=xf(f^{-1}(x)) = x \quad \text{and} \quad f^{-1}(f(x)) = x

The inverse β€œundoes” the function: if f(a)=bf(a) = b, then fβˆ’1(b)=af^{-1}(b) = a.

Important notation: fβˆ’1(x)f^{-1}(x) is the inverse function β€” it does not mean 1f(x)\frac{1}{f(x)}. The reciprocal would be written (f(x))βˆ’1(f(x))^{-1} or 1f(x)\frac{1}{f(x)}.

The Horizontal Line Test

A function is one-to-one if and only if every horizontal line intersects its graph at most once. If any horizontal line crosses the graph twice, the function fails the test and has no inverse (without domain restriction).

Verifying Inverses via Composition

To verify that ff and gg are inverses, check both compositions:

f(g(x))=xandg(f(x))=xf(g(x)) = x \quad \text{and} \quad g(f(x)) = x

Both must hold on the appropriate domains.

Worked Example 5: Verification

Verify that f(x)=3xβˆ’5f(x) = 3x - 5 and g(x)=x+53g(x) = \frac{x + 5}{3} are inverses.

f(g(x))=f ⁣(x+53)=3β‹…x+53βˆ’5=x+5βˆ’5=xf(g(x)) = f\!\left(\frac{x + 5}{3}\right) = 3 \cdot \frac{x + 5}{3} - 5 = x + 5 - 5 = x

g(f(x))=g(3xβˆ’5)=(3xβˆ’5)+53=3x3=xg(f(x)) = g(3x - 5) = \frac{(3x - 5) + 5}{3} = \frac{3x}{3} = x

Both compositions yield xx, confirming the functions are inverses.

Finding Inverses Algebraically

Method: Replace f(x)f(x) with yy, swap xx and yy, then solve for yy.

Worked Example 6: Linear Function

Find fβˆ’1f^{-1} for f(x)=2x+13f(x) = \frac{2x + 1}{3}.

Write y=2x+13y = \frac{2x + 1}{3}. Swap: x=2y+13x = \frac{2y + 1}{3}. Solve:

3x=2y+1β€…β€ŠβŸΉβ€…β€Š2y=3xβˆ’1β€…β€ŠβŸΉβ€…β€Šy=3xβˆ’123x = 2y + 1 \implies 2y = 3x - 1 \implies y = \frac{3x - 1}{2}

fβˆ’1(x)=3xβˆ’12f^{-1}(x) = \frac{3x - 1}{2}

Worked Example 7: Rational Function

Find fβˆ’1f^{-1} for f(x)=x+3xβˆ’1f(x) = \frac{x + 3}{x - 1}, xβ‰ 1x \neq 1.

Swap: x=y+3yβˆ’1x = \frac{y + 3}{y - 1}. Solve:

x(yβˆ’1)=y+3β€…β€ŠβŸΉβ€…β€Šxyβˆ’x=y+3β€…β€ŠβŸΉβ€…β€Šxyβˆ’y=x+3β€…β€ŠβŸΉβ€…β€Šy(xβˆ’1)=x+3x(y - 1) = y + 3 \implies xy - x = y + 3 \implies xy - y = x + 3 \implies y(x - 1) = x + 3

y=x+3xβˆ’1y = \frac{x + 3}{x - 1}

Remarkably, fβˆ’1(x)=x+3xβˆ’1=f(x)f^{-1}(x) = \frac{x + 3}{x - 1} = f(x). This function is its own inverse β€” it is called an involution.

Worked Example 8: Radical Function

Find fβˆ’1f^{-1} for f(x)=xβˆ’2+5f(x) = \sqrt{x - 2} + 5, where xβ‰₯2x \geq 2.

Swap: x=yβˆ’2+5x = \sqrt{y - 2} + 5. Solve:

xβˆ’5=yβˆ’2β€…β€ŠβŸΉβ€…β€Š(xβˆ’5)2=yβˆ’2β€…β€ŠβŸΉβ€…β€Šy=(xβˆ’5)2+2x - 5 = \sqrt{y - 2} \implies (x - 5)^2 = y - 2 \implies y = (x - 5)^2 + 2

fβˆ’1(x)=(xβˆ’5)2+2,xβ‰₯5f^{-1}(x) = (x - 5)^2 + 2, \quad x \geq 5

The domain of fβˆ’1f^{-1} is the range of ff: since xβˆ’2β‰₯0\sqrt{x - 2} \geq 0, f(x)β‰₯5f(x) \geq 5.

Restricting Domains to Create Inverses

Many common functions are not one-to-one on their entire domain. By restricting the domain, we can create a one-to-one function that has an inverse.

Worked Example 9: Quadratic with Restricted Domain

f(x)=x2f(x) = x^2 is not one-to-one on (βˆ’βˆž,∞)(-\infty, \infty) because, for instance, f(3)=f(βˆ’3)=9f(3) = f(-3) = 9.

Restrict to xβ‰₯0x \geq 0: f(x)=x2f(x) = x^2, xβ‰₯0x \geq 0.

Now ff is one-to-one (the right half of the parabola passes the horizontal line test).

Find the inverse: x=y2x = y^2, yβ‰₯0y \geq 0, so y=xy = \sqrt{x}.

fβˆ’1(x)=x,xβ‰₯0f^{-1}(x) = \sqrt{x}, \quad x \geq 0

We could also restrict to x≀0x \leq 0, giving fβˆ’1(x)=βˆ’xf^{-1}(x) = -\sqrt{x}.

Graphing Inverses

The graph of fβˆ’1f^{-1} is the reflection of the graph of ff over the line y=xy = x. Every point (a,b)(a, b) on ff corresponds to (b,a)(b, a) on fβˆ’1f^{-1}.

This means:

  • The domain of ff becomes the range of fβˆ’1f^{-1} (and vice versa)
  • Intercepts reflect: if ff has yy-intercept (0,b)(0, b), then fβˆ’1f^{-1} has xx-intercept (b,0)(b, 0)

Real-World Application: Nursing Dosage Conversions

In nursing, drug concentrations often require converting between units. If the conversion function is:

C(x)=0.001x+2.5C(x) = 0.001x + 2.5

where xx is the dosage in micrograms and CC is the blood concentration in mg/L, the inverse tells us what dosage produces a target concentration:

x=Cβˆ’2.50.001=1000(Cβˆ’2.5)x = \frac{C - 2.5}{0.001} = 1000(C - 2.5)

Cβˆ’1(y)=1000(yβˆ’2.5)=1000yβˆ’2500C^{-1}(y) = 1000(y - 2.5) = 1000y - 2500

For a target concentration of 3.2 mg/L: Cβˆ’1(3.2)=1000(3.2)βˆ’2500=700C^{-1}(3.2) = 1000(3.2) - 2500 = 700 micrograms.

Real-World Application: Temperature Conversion

The Fahrenheit-to-Celsius conversion is C=f(F)=59(Fβˆ’32)C = f(F) = \frac{5}{9}(F - 32). The inverse converts Celsius back to Fahrenheit:

F=fβˆ’1(C)=95C+32F = f^{-1}(C) = \frac{9}{5}C + 32

Verify: f(fβˆ’1(C))=59 ⁣(95C+32βˆ’32)=59β‹…95C=Cf(f^{-1}(C)) = \frac{5}{9}\!\left(\frac{9}{5}C + 32 - 32\right) = \frac{5}{9} \cdot \frac{9}{5}C = C.

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: Let f(x)=x2+1f(x) = x^2 + 1 and g(x)=3xβˆ’2g(x) = 3x - 2. Find (f∘g)(x)(f \circ g)(x) and (g∘f)(x)(g \circ f)(x).

(f∘g)(x)=f(3xβˆ’2)=(3xβˆ’2)2+1=9x2βˆ’12x+4+1=9x2βˆ’12x+5(f \circ g)(x) = f(3x - 2) = (3x - 2)^2 + 1 = 9x^2 - 12x + 4 + 1 = 9x^2 - 12x + 5

(g∘f)(x)=g(x2+1)=3(x2+1)βˆ’2=3x2+3βˆ’2=3x2+1(g \circ f)(x) = g(x^2 + 1) = 3(x^2 + 1) - 2 = 3x^2 + 3 - 2 = 3x^2 + 1

Answer: (f∘g)(x)=9x2βˆ’12x+5(f \circ g)(x) = 9x^2 - 12x + 5 and (g∘f)(x)=3x2+1(g \circ f)(x) = 3x^2 + 1.

Problem 2: Find the domain of (f∘g)(x)(f \circ g)(x) where f(x)=xf(x) = \sqrt{x} and g(x)=6βˆ’2xg(x) = 6 - 2x.

(f∘g)(x)=6βˆ’2x(f \circ g)(x) = \sqrt{6 - 2x}

g(x)g(x) is defined for all xx. But ff requires 6βˆ’2xβ‰₯06 - 2x \geq 0, so x≀3x \leq 3.

Domain: (βˆ’βˆž,3](-\infty, 3].

Problem 3: Find fβˆ’1(x)f^{-1}(x) for f(x)=4xβˆ’32x+1f(x) = \frac{4x - 3}{2x + 1}, xβ‰ βˆ’12x \neq -\frac{1}{2}.

Swap: x=4yβˆ’32y+1x = \frac{4y - 3}{2y + 1}. Solve:

x(2y+1)=4yβˆ’3β€…β€ŠβŸΉβ€…β€Š2xy+x=4yβˆ’3β€…β€ŠβŸΉβ€…β€Š2xyβˆ’4y=βˆ’xβˆ’3β€…β€ŠβŸΉβ€…β€Šy(2xβˆ’4)=βˆ’(x+3)x(2y + 1) = 4y - 3 \implies 2xy + x = 4y - 3 \implies 2xy - 4y = -x - 3 \implies y(2x - 4) = -(x + 3)

y=βˆ’(x+3)2xβˆ’4=βˆ’xβˆ’32(xβˆ’2)y = \frac{-(x + 3)}{2x - 4} = \frac{-x - 3}{2(x - 2)}

Answer: fβˆ’1(x)=βˆ’xβˆ’32(xβˆ’2)f^{-1}(x) = \frac{-x - 3}{2(x - 2)}, xβ‰ 2x \neq 2.

Problem 4: Restrict the domain of h(x)=(xβˆ’3)2+1h(x) = (x - 3)^2 + 1 so that it is one-to-one, then find its inverse.

Restrict to xβ‰₯3x \geq 3 (right side of the vertex).

Swap: x=(yβˆ’3)2+1β€…β€ŠβŸΉβ€…β€Šxβˆ’1=(yβˆ’3)2β€…β€ŠβŸΉβ€…β€Šyβˆ’3=xβˆ’1x = (y - 3)^2 + 1 \implies x - 1 = (y - 3)^2 \implies y - 3 = \sqrt{x - 1} (positive root since yβ‰₯3y \geq 3).

hβˆ’1(x)=xβˆ’1+3h^{-1}(x) = \sqrt{x - 1} + 3, xβ‰₯1x \geq 1.

Answer: hβˆ’1(x)=xβˆ’1+3h^{-1}(x) = \sqrt{x - 1} + 3 for xβ‰₯1x \geq 1.

Problem 5: Verify that f(x)=xx+2f(x) = \frac{x}{x + 2} and g(x)=2x1βˆ’xg(x) = \frac{2x}{1 - x} are inverses (for xβ‰ βˆ’2x \neq -2 and xβ‰ 1x \neq 1 respectively).

f(g(x))=f ⁣(2x1βˆ’x)=2x1βˆ’x2x1βˆ’x+2=2x1βˆ’x2x+2(1βˆ’x)1βˆ’x=2x2x+2βˆ’2x=2x2=xf(g(x)) = f\!\left(\frac{2x}{1 - x}\right) = \frac{\frac{2x}{1 - x}}{\frac{2x}{1 - x} + 2} = \frac{\frac{2x}{1 - x}}{\frac{2x + 2(1 - x)}{1 - x}} = \frac{2x}{2x + 2 - 2x} = \frac{2x}{2} = x

g(f(x))=g ⁣(xx+2)=2β‹…xx+21βˆ’xx+2=2xx+2x+2βˆ’xx+2=2x2=xg(f(x)) = g\!\left(\frac{x}{x + 2}\right) = \frac{2 \cdot \frac{x}{x + 2}}{1 - \frac{x}{x + 2}} = \frac{\frac{2x}{x + 2}}{\frac{x + 2 - x}{x + 2}} = \frac{2x}{2} = x

Answer: Both compositions yield xx, confirming ff and gg are inverses.

Key Takeaways

  • Composition (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)) applies gg first, then ff β€” order matters
  • The domain of f∘gf \circ g requires xx in the domain of gg and g(x)g(x) in the domain of ff
  • Inverse functions satisfy f(fβˆ’1(x))=xf(f^{-1}(x)) = x and fβˆ’1(f(x))=xf^{-1}(f(x)) = x
  • To find an inverse algebraically: write y=f(x)y = f(x), swap xx and yy, solve for yy
  • A function must be one-to-one (pass the horizontal line test) to have an inverse
  • Restricting the domain can make a non-one-to-one function invertible
  • The graph of fβˆ’1f^{-1} is the reflection of ff over the line y=xy = x

Return to College Algebra for more topics in this section.

Last updated: March 29, 2026