I’m working on inverse functions and I thought I had the recipe down: swap x and y, solve for y, done. For f(x) = x^2 + 4x + 5, I completed the square to get (x + 2)^2 + 1. Solving for the inverse gave me y − 1 = (x + 2)^2 → x = −2 ± √(y − 1), so after swapping I wrote f⁻¹(x) = −2 ± √(x − 1). But now I’m stuck: the “±” means it’s not a function unless I pick a branch, and my book says I need to restrict the domain of f (like x ≥ −2 or x ≤ −2) first. I can see the reflection across y = x when I graph it, but I keep getting confused about how to choose the correct branch and how to state the domains/ranges so that f(f⁻¹(x)) = x and f⁻¹(f(x)) = x actually hold.
My confusion: sometimes when I try composing, I get x, sometimes I get something like |x + 2|, and sometimes it’s undefined. I know about the horizontal line test, but it feels arbitrary to pick x ≥ −2 versus x ≤ −2. Is there a clear rule for which branch to keep and how to write the exact domain and range for both f and f⁻¹ in this example?
I also tried a rational example f(x) = (2x − 5)/(x + 3). I found an inverse algebraically, but then I noticed f(f⁻¹(x)) seemed to break at x = 2 even though 2 isn’t a problem in f. Is that because 2 isn’t in the range of f? Not sure if that’s relevant, but it made me think I’m mixing up where each identity is supposed to hold.
How should I systematically handle the domain/range restrictions and branch choice so the inverse actually works as a function here?
















3 Responses
Great question! The “swap-and-solve” recipe only works cleanly when your original function is one-to-one, and a quadratic isn’t-unless you trim it to one monotonic side. For f(x) = x^2 + 4x + 5 = (x + 2)^2 + 1, the vertex is at x = −2; it’s decreasing on (−∞, −2] and increasing on [−2, ∞). You aren’t picking a side arbitrarily: you must choose one side so f becomes one-to-one, and then choose the square-root branch that sends outputs back into that chosen side. If you keep the right-hand branch (x ≥ −2), then the inverse is f⁻¹(y) = −2 + √(y − 1), with domain y ≥ 1 and range x ≥ −2. If you keep the left-hand branch (x ≤ −2), then f⁻¹(y) = −2 − √(y − 1), with domain y ≥ 1 and range x ≤ −2. The compositions line up like this: f ∘ f⁻¹(y) = y for all y ≥ 1, and f⁻¹ ∘ f(x) = x only on the domain you kept. The “why do I get |x + 2|?” moment comes from √((x + 2)²) = |x + 2|; unless you restrict to one side of −2, the absolute value won’t collapse to x + 2 or −(x + 2), so the identity fails off the chosen domain. Analogy: it’s like choosing one ramp of a V-shaped slide-once you pick the left or the right ramp, the ride down and back up retraces your steps; if you try to come back up the other ramp, you won’t land where you started.
Your rational example shows the same “where does the identity hold?” idea. For f(x) = (2x − 5)/(x + 3), the domain is x ≠ −3. Solving y = (2x − 5)/(x + 3) gives x = (5 + 3y)/(2 − y), so f⁻¹(y) = (5 + 3y)/(2 − y) with domain y ≠ 2 and range x ≠ −3. Note 2 is not in the range of f (indeed, solving f(x) = 2 leads to −5 = 6, impossible), so f ∘ f⁻¹(y) is defined and equals y exactly on y in range(f) = ℝ \ {2}, and f⁻¹ ∘ f(x) is defined and equals x exactly on x in domain(f) = ℝ \ {−3}. Systematically: (1) state f’s domain, (2) find f’s range (this becomes the inverse’s domain), (3) if needed, restrict f to a one-to-one piece, and (4) pick the algebraic branch so the inverse’s outputs land in that restricted domain. Do that, and the compositions will behave exactly where they’re supposed to.
Think of it like choosing one side of the “bowl” so it passes the horizontal line test: restrict to x ≥ −2 (increasing) and keep f⁻¹(x) = −2 + √(x − 1), or restrict to x ≤ −2 (decreasing) and keep f⁻¹(x) = −2 − √(x − 1); if you don’t restrict, composing collapses to |x + 2|.
Quick check: with the x ≥ −2 branch, f(0)=5 and f⁻¹(5)=−2+√4=0, so f⁻¹∘f(x)=x on x ≥ −2 (and I think also f∘f⁻¹(x)=x for all x>1); nice refresher here: https://www.khanacademy.org/math/algebra/x2f8bb11595b61c86:functions/x2f8bb11595b61c86:invertible-functions/a/restricting-domains-of-functions-to-make-inverses
Think of your parabola as a shiny bowl with its lowest point at (−2, 1): it’s strictly decreasing to the left of x = −2 and strictly increasing to the right, so the clear rule is “pick a side where it’s one-to-one,” i.e., restrict f to x ≥ −2 or to x ≤ −2 before inverting. With f(x) = (x + 2)² + 1, solving gives x = −2 ± √(y − 1); the plus sign belongs to the increasing branch (x ≥ −2), and the minus sign belongs to the decreasing branch (x ≤ −2). If you choose the right-hand branch, write f: [−2, ∞) → (1, ∞) and f⁻¹(x) = −2 + √(x − 1) with domain x > 1 and range [−2, ∞); then f(f⁻¹(x)) = x for x > 1, and f⁻¹(f(x)) = x for x ≥ −2. The mystery absolute value shows up if you try to compose outside these rules: f⁻¹(f(x)) becomes −2 + √((x + 2)²) = −2 + |x + 2|, which is only x when x ≥ −2; on the left branch you’d instead use −2 − √(x − 1), and the identities swap to the x ≤ −2 world. For your rational friend f(x) = (2x − 5)/(x + 3), its domain is x ≠ −3 and its range is y ≠ 2, so the inverse f⁻¹(y) = (5 + 3y)/(2 − y) naturally has domain y ≠ 2; that’s why f(f⁻¹(x)) “breaks” at x = 2 even though f itself is fine there-2 simply isn’t in the range of f. The systematic recipe: restrict f to a monotone interval, choose the matching ± sign, set the inverse’s domain equal to the restricted range of f, and check compositions only on those matching sets.