// Numbas version: finer_feedback_settings {"name": "Inverse and composite functions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Inverse and composite functions", "tags": [], "metadata": {"description": "

Find the inverse of a composite function by finding the inverses of two functions and then the composite of these; and by finding the composite of two functions then finding the inverse. The question then concludes by asking students to compare their two answers and verify they're equivalent.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

\n

Give all of your answers in terms of $x$.

", "advice": "

a)

\n

$f^{-1}(x)$ is the function with the property that $f^{-1}(f(x)) = x$.

\n

To find this, we first set $x=f(y)$ and rearrange to find $y$ in terms of $x$, i.e. $y = f^{-1}(x)$.

\n

\\begin{align}
f(y)=\\simplify{{a[0]}y+{a[1]}}&=x\\\\
\\simplify{{a[0]}y}&=x-\\var{a[1]}\\\\[1em]
y&=\\simplify[]{(x-{a[1]})/{a[0]}}\\\\[1em]
f^{-1}(x)&=\\simplify{(x-{a[1]})/{a[0]}}\\text{.}\\\\
\\end{align}

\n

b)

\n

We use the same method as part a) to find $g^{-1}(x)$: 

\n

\\begin{align}
g(y)=\\simplify{{a[3]}y-{a[2]}}&=x\\\\
\\simplify{{a[3]}y}&=x+\\var{a[2]}\\\\[1em]
y&=\\simplify[]{(x+{a[2]})/{a[3]}}\\\\[1em]
g^{-1}(x)&=\\simplify{(x+{a[2]})/{a[3]}}\\text{.}\\\\
\\end{align}

\n

c)

\n

$(g^{-1} \\circ f^{-1})(x)$ is the function which first applies $f^{-1}(x)$ and then applies $g^{-1}$ to the result of that.

\n

We use the previous answers: $f^{-1}(x)=\\simplify{(x-{a[1]})/{a[0]}}$ and $g^{-1}(x)=\\simplify{(x+{a[2]})/{a[3]}}$ to find the definition of $(g^{-1} \\circ f^{-1})(x)$ by substituting $f^{-1}(x)$ everywhere $x$ occurs in the definition of $g^{-1}(x)$.

\n

\\begin{align}
(g^{-1}\\circ f^{-1}) (x)&=g^{-1}(f^{-1}(x))\\\\[1em]
&=g^{-1} \\left( \\simplify[]{(x-{a[1]})/{a[0]}} \\right) \\\\[1em]
&=\\frac{\\left(\\simplify[]{(x-{a[1]})/{a[0]}}\\right)+\\simplify[]{{a[2]}}}{\\var{a[3]}\\text{.}}
\\end{align}

\n

d)

\n

$(f \\circ g)(x)$ is the function which first applies $g(x)$ and then applies $f$ to the result of that.

\n

We find the definition of $(f \\circ g)(x)$ by substituting $g(x)$ everywhere that $x$ occurs in the definition of $f(x)$.

\n

\\begin{align}
(f\\circ g)(x)&=f(g(x))\\\\
&=f(\\simplify{{a[3]}x-{a[2]}})\\\\
&=\\simplify{{a[0]}({a[3]}x-{a[2]})+{a[1]}}
\\end{align}

\n

e)

\n

Now that we have the definition of $(f \\circ g)(x)$, we can find its inverse by using the same method as in parts a) and b).

\n

\\begin{align}
(f \\circ g)(y) &= x \\\\
\\simplify{{a[0]}({a[3]}y-{a[2]})+{a[1]}}&=x\\\\
\\simplify{{a[0]}({a[3]}y-{a[2]})}&=x-\\var{a[1]}\\\\[1em]
\\simplify{{a[3]}y-{a[2]}}&=\\frac{(x-\\var{a[1]})}{\\var{a[0]}}\\\\[1em]
\\simplify{{a[3]}y}&=\\left( \\frac{(x-\\var{a[1]})}{\\var{a[0]}} \\right) +\\var{a[2]}\\\\[1em]
y&=\\frac{\\left(\\frac{(x-\\var{a[1]})}{\\var{a[0]}}\\right)+\\var{a[2]})}{\\var{a[3]}}\\\\[1em]
(f\\circ g)^{-1}(x)&=\\frac{\\left(\\frac{(x-\\var{a[1]})}{\\var{a[0]}}\\right)+\\var{a[2]}}{\\var{a[3]}}\\\\[1em]
\\end{align}

\n

We can see that in this case $(f\\circ g)^{-1}(x) = (g^{-1}\\circ f^{-1}) (x)$.

\n

f)

\n

So long as the inverses of $f$ and $g$ exist and they can be composed, it is always true that \\[(f \\circ g)^{-1}(x) \\equiv (g^{-1} \\circ f^{-1}) (x)\\text{.}\\]

", "rulesets": {}, "extensions": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "repeat(random(5..9),5)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "repeat(random(2..5),5)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Find $f^{-1}(x)$ when $\\simplify{f(x)={a[0]}x+{a[1]} }$.

\n

$\\displaystyle f^{-1}(x)=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(x-{a[1]})/{a[0]}", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Find $g^{-1}(x)$ when $\\simplify{g(x)={a[3]}x-{a[2]} }$.

\n

$\\displaystyle g^{-1}(x)=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(x+{a[2]})/{a[3]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Use your above answers for $f^{-1}(x)$ and $g^{-1}(x)$ to find the inverse, composed function, $(g^{-1}\\circ f^{-1}) (x)$ terms of $x$:

\n


$\\displaystyle (g^{-1}\\circ f^{-1}) (x)$ =[[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(x-{a[1]}+({a[2]}{a[0]}))/({a[3]}*{a[0]})", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Using:
\\[
\\begin{align}
f(x)&=\\simplify{{a[0]}x+{a[1]} }\\\\
&\\text{ and } \\\\
g(x)&=\\simplify{{a[3]}x-{a[2]} }\\text{,}
\\end{align}
\\]
find $(f\\circ g)(x)$, the composition of $f(x)$ with $g(x)$.

\n

$\\displaystyle (f\\circ g)(x)=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[0]}({a[3]}x-{a[2]})+{a[1]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Use your above answer for $(f\\circ g)(x)$ to find the inverse, composed function,$(f\\circ g)^{-1}(x)$ in terms of $x$:

\n

$\\displaystyle (f\\circ g)^{-1}(x)=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(x-{a[1]}+({a[2]}{a[0]}))/({a[3]}*{a[0]})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

When should your answer for c), $(g^{-1}\\circ f^{-1}) (x)$ be the same as your answer for e) $(f\\circ g)^{-1}(x)$?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["

Never

", "

Only when $f(x)=g(x)$

", "

Only when $f(x)$ is in the same family as $g(x)$

", "

Always, provided that composite and inverse functions exist

"], "matrix": [0, 0, 0, "1"], "distractors": ["", "", "", ""]}], "type": "question", "contributors": [{"name": "Matthew Mears", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1688/"}]}]}], "contributors": [{"name": "Matthew Mears", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1688/"}]}