1.02v - Composite and inverse functions

1.02v - Composite and inverse functions

Putting two functions together is sensitive to order; reversing one needs a carefully chosen domain. Learn to compose rules, check both stages and find inverses algebraically and by reflection in a graph.

Following the order of a composite function

Does “double, then subtract one” followed by “square” give the same result as doing those instructions backwards? Start with 33: the first route gives 3↦5↦253\mapsto5\mapsto25; the reverse gives 3↦9↦173\mapsto9\mapsto17. The operations are familiar, but their order changes the answer.

You already know

A function assigns one output to each permitted input. Substituting an expression means replacing the whole input slot, using brackets when necessary.

Think of composition as a two-stage machine: the first machine's output must fit into the second machine's input slot.

Composite function

gf(x)=g(f(x))\mathrm{gf}(x)=\mathrm g(\mathrm f(x)) means apply f\mathrm f first, then g\mathrm g. The function nearest the input acts first. It is not the product g(x)f(x)\mathrm g(x)\mathrm f(x), and usually gf≠fg\mathrm{gf}\ne\mathrm{fg}.

The notation also distinguishes repeating a function from squaring an output.

Repeated composition

f2(x)=f(f(x)),[f(x)]2=the square of the output\mathrm f^2(x)=\mathrm f(\mathrm f(x)),\qquad [\mathrm f(x)]^2=\text{the square of the output}

Each composition is defined only when both stages allow the input they receive.

Not in the formula sheet: learn it.

Write the inner function first, then feed its entire expression into the outer function.

Worked example 1: square after a linear rule

Question. f(x)=2x−1\mathrm f(x)=2x-1 and g(x)=x2\mathrm g(x)=x^2, both on R\mathbb R. Determine gf(x)\mathrm{gf}(x), fg(x)\mathrm{fg}(x) and f2(x)\mathrm f^2(x).

Plan. Replace the input slot of each outer function by the complete inner rule.

gf(x)=g(2x−1)=(2x−1)2f acts firstfg(x)=f(x2)=2x2−1g acts firstf2(x)=f(2x−1)repeat the linear rule=2(2x−1)−1=4x−3expand\begin{aligned} \mathrm{gf}(x)&=\mathrm g(2x-1)=(2x-1)^2 &&\mathrm f\text{ acts first}\\ \mathrm{fg}(x)&=\mathrm f(x^2)=2x^2-1 &&\mathrm g\text{ acts first}\\ \mathrm f^2(x)&=\mathrm f(2x-1) &&\text{repeat the linear rule}\\ &=2(2x-1)-1=4x-3 &&\text{expand} \end{aligned}

Why this step? Brackets preserve the complete inner output; squaring only 2x2x would change the rule.

Answer. gf(x)=(2x−1)2\mathrm{gf}(x)=(2x-1)^2, fg(x)=2x2−1\mathrm{fg}(x)=2x^2-1 and f2(x)=4x−3\mathrm f^2(x)=4x-3.

Check. At x=3x=3, the first two outputs are 2525 and 1717, matching the opening routes.

Change only g\mathrm g's exponent from 22 to 33. The composition order stays exactly the same.

Worked example 2: cube after a linear rule

Question. f(x)=2x−1\mathrm f(x)=2x-1 and g(x)=x3\mathrm g(x)=x^3, both on R\mathbb R. Determine gf(x)\mathrm{gf}(x), fg(x)\mathrm{fg}(x) and f2(x)\mathrm f^2(x).

Plan. Substitute each complete inner expression into its outer rule.

gf(x)=(2x−1)3cube the linear outputfg(x)=2x3−1apply the linear rule to x3f2(x)=2(2x−1)−1neither stage uses g=4x−3simplify\begin{aligned} \mathrm{gf}(x)&=(2x-1)^3 &&\text{cube the linear output}\\ \mathrm{fg}(x)&=2x^3-1 &&\text{apply the linear rule to }x^3\\ \mathrm f^2(x)&=2(2x-1)-1 &&\text{neither stage uses }\mathrm g\\ &=4x-3 &&\text{simplify} \end{aligned}

Why this step? Changing g\mathrm g affects the first two composites, but cannot affect a route that uses only f\mathrm f.

Answer. (2x−1)3(2x-1)^3, 2x3−12x^3-1 and 4x−34x-3, respectively.

Check. At x=2x=2, the first two routes give 33=273^3=27 and 2(8)−1=152(8)-1=15; repeating f\mathrm f gives 55.

Order can occasionally make no difference: “add 11” and “add 22” commute, since both orders give x+3x+3. The opening pair does not. Equality must be established for the particular functions, rather than assumed.

Watch out

Wrong: f2(x)=(2x−1)2\mathrm f^2(x)=(2x-1)^2. Right: f2(x)=4x−3\mathrm f^2(x)=4x-3, while [f(x)]2=(2x−1)2[\mathrm f(x)]^2=(2x-1)^2.

Try all three notations with a new pair of linear rules.

Checking both stages of the domain

A valid first calculation does not guarantee a valid second one. The first image might hit a forbidden denominator or lie outside the next function's stated domain.

Domain of a composite

Dgf={x∈Df:f(x)∈Dg}D_{\mathrm{gf}}=\{x\in D_{\mathrm f}:\mathrm f(x)\in D_{\mathrm g}\}

Keep both the stated domain of the inner function and the requirement on its image.

Not in the formula sheet: learn it.

For example, if f(x)=x+1\mathrm f(x)=x+1 is defined only on [0,2][0,2], a composite beginning with f\mathrm f cannot acquire inputs outside [0,2][0,2], even if its simplified formula could accept them.

Worked example 3: exclude a second-stage pole

Question. f(x)=x+2\mathrm f(x)=\sqrt{x+2}, with x≥−2x\ge-2, and g(x)=1/(x−1)\mathrm g(x)=1/(x-1), with x≠1x\ne1. Determine gf(x)\mathrm{gf}(x) and its domain.

Plan. Retain the root's domain, then prevent its output from becoming 11.

gf(x)=1x+2−1substitute into gx≥−2first-stage conditionx+2≠1second-stage conditionx≠−1solve the exclusion\begin{aligned} \mathrm{gf}(x)&=\frac1{\sqrt{x+2}-1} &&\text{substitute into }\mathrm g\\ x&\ge-2 &&\text{first-stage condition}\\ \sqrt{x+2}&\ne1 &&\text{second-stage condition}\\ x&\ne-1 &&\text{solve the exclusion} \end{aligned}

Why this step? The excluded input of g\mathrm g is 11, but the input of the whole composite that produces it is −1-1.

Answer. gf(x)=1/(x+2−1)\mathrm{gf}(x)=1/(\sqrt{x+2}-1), with domain [−2,∞)∖{−1}[-2,\infty)\setminus\{-1\}.

Check. x=−2x=-2 gives f(−2)=0\mathrm f(-2)=0, then g(0)=−1\mathrm g(0)=-1, so the root endpoint is permitted.

Change only the order of the same two functions. The same conditions now act on different expressions.

Worked example 4: a rational expression inside a root

Question. For the same functions and domains, determine fg(x)\mathrm{fg}(x) and its domain.

Plan. Exclude the first denominator zero, then require the outer root's argument to be non-negative.

fg(x)=1x−1+2substitute into fx≠1first-stage denominator1x−1+2=2x−1x−1≥0second-stage root\begin{aligned} \mathrm{fg}(x)&=\sqrt{\frac1{x-1}+2} &&\text{substitute into }\mathrm f\\ x&\ne1 &&\text{first-stage denominator}\\ \frac1{x-1}+2&=\frac{2x-1}{x-1}\ge0 &&\text{second-stage root} \end{aligned}

The numerator changes sign at 1/21/2; the denominator changes sign at 11. Both are negative for x<1/2x<1/2, opposite in sign for 1/2<x<11/2<x<1, and both positive for x>1x>1. At 1/21/2, the numerator is zero.

Why this step? Multiplying by x−1x-1 without knowing its sign could reverse an inequality unnoticed. A sign check keeps both intervals.

Answer. fg(x)=1/(x−1)+2\mathrm{fg}(x)=\sqrt{1/(x-1)+2}, with domain (−∞,1/2]∪(1,∞)( -\infty,1/2]\cup(1,\infty).

Check. x=1/2x=1/2 gives output 00; x=3/4x=3/4 gives a negative root argument, so it is correctly excluded.

The restrictions belong to the input of each stage, not merely to the letters that happen to appear in the formula.

Watch out

Wrong: exclude only x=1x=1 in Worked example 4. Right: also exclude (1/2,1)(1/2,1), where the outer root is not real.

Keep the order gf\mathrm{gf}, but move the pole and the root endpoint.

Making reversal a function

Reversing a function means recovering its input from its output. That works as a function only when the output identifies one input uniquely.

Inverse function

For a one-to-one function f\mathrm f, its inverse f−1\mathrm f^{-1} maps each image back to the input that produced it. Its domain is the range of f\mathrm f, and its range is the domain of f\mathrm f. A many-to-one function must first be restricted to a suitable one-to-one domain.

A horizontal line meeting a graph twice reveals two candidate inputs for one inverse output. The vertical-line test only checks the forward relation. The inverse notation and this existence condition are not in the formula sheet: learn them.

Worked example 5: choosing the right branch

Question. q(x)=(x−1)2\mathrm q(x)=(x-1)^2. Explain why it has no inverse function on R\mathbb R, then find its inverse when restricted to x≥1x\ge1.

Plan. Identify a repeated image, then solve the output equation using the permitted sign of x−1x-1.

q(0)=q(2)=1two inputs share an imagey=(x−1)2start the reversalx−1=yx−1≥0x=1+yrecover the input\begin{aligned} \mathrm q(0)&=\mathrm q(2)=1 &&\text{two inputs share an image}\\ y&=(x-1)^2 &&\text{start the reversal}\\ x-1&=\sqrt y &&x-1\ge0\\ x&=1+\sqrt y &&\text{recover the input} \end{aligned}

Why this step? The domain selects the positive-root branch; using both signs would fail to define an inverse function.

Answer. There is no inverse on R\mathbb R. On [1,∞)[1,\infty), q−1(x)=1+x\mathrm q^{-1}(x)=1+\sqrt{x}, with domain [0,∞)[0,\infty) and range [1,∞)[1,\infty).

Check. q(3)=4\mathrm q(3)=4, and q−1(4)=3\mathrm q^{-1}(4)=3.

Change only the domain to the left-hand branch. The inverse formula must now choose the other sign.

Worked example 6: choosing the left branch

Question. q(x)=(x−1)2\mathrm q(x)=(x-1)^2. Explain why it has no inverse function on R\mathbb R, then find its inverse when restricted to x≤1x\le1.

Plan. Use the same repeated image and solve with x−1≤0x-1\le0.

q(0)=q(2)=1no inverse on the full domainy=(x−1)2output equationx−1=−yx−1≤0x=1−yrecover the left input\begin{aligned} \mathrm q(0)&=\mathrm q(2)=1 &&\text{no inverse on the full domain}\\ y&=(x-1)^2 &&\text{output equation}\\ x-1&=-\sqrt y &&x-1\le0\\ x&=1-\sqrt y &&\text{recover the left input} \end{aligned}

Why this step? The negative sign describes a non-positive distance from 11; choosing the positive sign would return an input outside the domain.

Answer. On (−∞,1]( -\infty,1], q−1(x)=1−x\mathrm q^{-1}(x)=1-\sqrt{x}, with domain [0,∞)[0,\infty) and range (−∞,1]( -\infty,1].

Check. q(−1)=4\mathrm q(-1)=4, and the new inverse sends 44 back to −1-1.

The inverse is also different from the reciprocal. For f(x)=2x−1\mathrm f(x)=2x-1, solving y=2x−1y=2x-1 gives inverse (x+1)/2(x+1)/2, while the reciprocal is 1/(2x−1)1/(2x-1). Only the former undoes the linear rule.

Watch out

Wrong: f−1(x)=1/f(x)\mathrm f^{-1}(x)=1/\mathrm f(x). Right: the superscript −1-1 on a function name denotes reversal; solve for the input instead of taking a reciprocal.

Choose a branch for a new quadratic, giving the reason as well as the restriction.

Finding and checking an inverse

To find an inverse algebraically, make the input the subject of the output equation. The change of letters comes last; it is the rearrangement that does the mathematics.

Checking inverse functions

f−1(f(x))=x(x∈Df),f(f−1(x))=x(x∈Rf)\mathrm f^{-1}(\mathrm f(x))=x\quad(x\in D_{\mathrm f}),\qquad \mathrm f(\mathrm f^{-1}(x))=x\quad(x\in R_{\mathrm f})

The inverse has domain RfR_{\mathrm f} and range DfD_{\mathrm f}.

Not in the formula sheet: learn it.

For a rational rule, collect all terms involving the input before dividing. The value excluded from the inverse domain often emerges in that division.

Worked example 7: reversing a rational function

Question. f(x)=(3x−2)/(x+1)\mathrm f(x)=(3x-2)/(x+1), with x≠−1x\ne-1. Determine its inverse, including domain and range.

Plan. Solve y=f(x)y=\mathrm f(x) for xx, then exchange the roles of input and output.

y(x+1)=3x−2clear the denominatorx(y−3)=−y−2collect the input termsx=y+23−ydivide and simplify\begin{aligned} y(x+1)&=3x-2 &&\text{clear the denominator}\\ x(y-3)&=-y-2 &&\text{collect the input terms}\\ x&=\frac{y+2}{3-y} &&\text{divide and simplify} \end{aligned}

Why this step? Dividing by y−3y-3 requires y≠3y\ne3. Indeed, f(x)=3\mathrm f(x)=3 would give −2=3-2=3, so that output is impossible. Every other yy gives a permitted input.

Answer. f−1(x)=(x+2)/(3−x)\mathrm f^{-1}(x)=(x+2)/(3-x), with domain R∖{3}\mathbb R\setminus\{3\} and range R∖{−1}\mathbb R\setminus\{-1\}.

Check. f(0)=−2\mathrm f(0)=-2 and f−1(−2)=0\mathrm f^{-1}(-2)=0. Also, substituting f(x)\mathrm f(x) into the inverse gives [5x/(x+1)]/[5/(x+1)]=x[5x/(x+1)]/[5/(x+1)]=x.

Change only the constant term in the numerator from −2-2 to −1-1. The shape of the rearrangement stays the same.

Worked example 8: the same rearrangement with a new numerator

Question. p(x)=(3x−1)/(x+1)\mathrm p(x)=(3x-1)/(x+1), with x≠−1x\ne-1. Determine its inverse, including domain and range.

Plan. Collect the input terms after clearing the denominator.

y(x+1)=3x−1multiply out the denominatorx(y−3)=−y−1collect xx=y+13−ysolve for the input\begin{aligned} y(x+1)&=3x-1 &&\text{multiply out the denominator}\\ x(y-3)&=-y-1 &&\text{collect }x\\ x&=\frac{y+1}{3-y} &&\text{solve for the input} \end{aligned}

Why this step? The forbidden output is still 33, but the numerator of the inverse has changed. Reusing the previous inverse would miss that change.

Answer. p−1(x)=(x+1)/(3−x)\mathrm p^{-1}(x)=(x+1)/(3-x), with domain R∖{3}\mathbb R\setminus\{3\} and range R∖{−1}\mathbb R\setminus\{-1\}.

Check. p(0)=−1\mathrm p(0)=-1, and p−1(−1)=0\mathrm p^{-1}(-1)=0. Substitution simplifies to [4x/(x+1)]/[4/(x+1)]=x[4x/(x+1)]/[4/(x+1)]=x.

A graph shows the same reversal. A point (a,b)(a,b) becomes (b,a)(b,a), reflecting in y=xy=x. The quadratic branch q(x)=(x−1)2\mathrm q(x)=(x-1)^2, x≥1x\ge1, has points (1,0)(1,0), (2,1)(2,1), (3,4)(3,4); its inverse has (0,1)(0,1), (1,2)(1,2), (4,3)(4,3).

Restricted quadratic and its inverse reflected in the line y equals x

Reflect the whole one-to-one branch, retaining open or closed endpoints. Intercepts exchange roles, and vertical asymptotes become horizontal asymptotes. For the rational example, x=−1x=-1 and y=3y=3 become y=−1y=-1 and x=3x=3.

A function can even be its own inverse without being the identity: s(x)=5−x\mathrm s(x)=5-x on R\mathbb R gives s(s(x))=5−(5−x)=x\mathrm s(\mathrm s(x))=5-(5-x)=x. A second trip through the same rule undoes the first.

Exam tip

An inverse answer includes any requested restrictions. The inverse's input values are the forward function's attained outputs, not automatically the forward domain.

The opening operations can now be undone in reverse order: to undo “double, then subtract one”, add one, then halve. Finish with a fresh rational rule.

Quick Recap

  • In gf\mathrm{gf}, apply f\mathrm f first; composition generally changes when its order changes.
  • A composite input must survive the first domain and feed an allowed input to the second function.
  • An inverse exists on a one-to-one domain; a branch restriction decides which root to choose.
  • Find inverses by rearranging, exchange domain and range, and reflect graphs in y=xy=x.

The opening routes give 2525 and 1717, so order matters; undoing a route means reversing both its operations and their order.