Maths with Lemon

Function Composition

IB Mathematics: Analysis and Approaches SL / HL · Lesson 2.7 · SL 2.5

Explore function operations, domains, composite functions, graphical evaluation and applications, following your Lesson 2.7 worksheet.

Open Lesson 2.7 worksheet (PDF) · Functions topic

1. Warm-Up: Function Transformations

Recall the transformations

  • Horizontal shifts act inside the function.
  • Vertical shifts act outside the function.
  • Horizontal scaling requires care with the coefficient of \(x\).
  • Use the original graph to identify the transformed coordinates.

From the worksheet, page 1

\[f(x-2)+2\]
\[2f(x)-2\]
\[f(2x+2)\]
\[f\left(\frac32x\right)\]

Sketch these transformations on the grids in the worksheet.

2. Operations on Functions

Four basic operations

  • Add the two function expressions.
  • Subtract in the specified order.
  • Multiply the function outputs.
  • Divide only where the denominator is nonzero.

Notation

\[(f+g)(x)=f(x)+g(x)\]
\[(f-g)(x)=f(x)-g(x)\]
\[(fg)(x)=f(x)g(x)\]
\[\left(\frac fg\right)(x)=\frac{f(x)}{g(x)},\quad g(x)\ne0\]
Worksheet example

Given \(f(x)=-10x^2-10x+3\) and \(g(x)=-4x^2-x\):

\[\boxed{(f+g)(x)=-14x^2-11x+3}\]
\[\boxed{(f-g)(x)=-6x^2-9x+3}\]

3. Evaluate Function Operations

Use substitution

  • Calculate each function value first.
  • Then perform the required operation.
  • The product \((fg)(x)\) is different from the composite \((f\circ g)(x)\).

Worksheet functions

Let \(f(x)=4x+1\) and \(g(x)=(x-2)^2\)
\[(fg)(x)=(4x+1)(x-2)^2\]
\[f(6)=25,\qquad g(6)=16\]
\[\boxed{(fg)(6)=400}\]

4. Domain Restrictions

Questions to ask

  • Is a denominator ever zero?
  • Does an even root have a negative radicand?
  • Does a logarithm have a nonpositive argument?
  • Are there restrictions from an inverse or a real-world context?

Worksheet examples

Rational function
\[h(x)=\frac{x+11}{x^2-81}\]
\[\boxed{x\in\mathbb R,\quad x\ne-9,\ 9}\]
Square root
\[f(x)=\sqrt{65-5x}\]
\[65-5x\ge0\quad\Rightarrow\quad\boxed{x\le13}\]
Additional examples
\[g(x)=8x^2-4\quad\Rightarrow\quad x\in\mathbb R\]
\[k(x)=4\sqrt{x}-17\quad\Rightarrow\quad x\ge0\]

5. Evaluate Functions from Graphs

Reading the worksheet graphs

  • Locate the given \(x\)-value.
  • Read the corresponding \(y\)-value from the correct graph.
  • For sums and products, read both outputs at the same \(x\).
  • For quotients, check that the denominator is not zero.

Graph-based operations

\[(f+g)(0)=f(0)+g(0)\]
\[(g-f)(2)=g(2)-f(2)\]
\[(fg)(0)=f(0)g(0)\]

Use the three graphs on page 3 of the worksheet to practise.

6. What Is Function Composition?

Order matters

  • The inner function is applied first.
  • The output of the inner function becomes the input of the outer function.
  • In general, \(f\circ g\ne g\circ f\).
  • Always write the substitution step explicitly.

Essential notation

\[\boxed{(f\circ g)(x)=f(g(x))}\]
\[\boxed{(g\circ f)(x)=g(f(x))}\]
Simple example

For \(f(x)=x^2\) and \(g(x)=x+3\):

\[(f\circ g)(x)=(x+3)^2\]
\[(g\circ f)(x)=x^2+3\]

7. Find Composite Expressions

Step-by-step method

  • Write the outside function.
  • Replace its input variable with the entire inner function.
  • Use brackets before expanding.
  • Simplify and consider domain restrictions.

Worksheet example, page 4

Let \(f(x)=x^2-x+7\) and \(g(x)=-2x+14\)
\[f(g(x))=(-2x+14)^2-(-2x+14)+7\]
\[\boxed{(f\circ g)(x)=4x^2-54x+189}\]
\[g(f(x))=-2(x^2-x+7)+14\]
\[\boxed{(g\circ f)(x)=-2x^2+2x}\]

8. Evaluate Composite Functions

Substitute from the inside out

  • Evaluate the inner function at the given number.
  • Use that result as the input of the outer function.
  • Repeat in the reverse order to compare.

Worksheet example, page 4

Given \(f(x)=3x^2+2x-15\), \(g(x)=2x-6\)
\[g(1)=-4,\qquad f(-4)=25\]
\[\boxed{(f\circ g)(1)=25}\]
\[f(1)=-10,\qquad g(-10)=-26\]
\[\boxed{(g\circ f)(1)=-26}\]

The different results demonstrate that composition is generally not commutative.

9. Interactive Composition Explorer

Experiment with two functions

  • Choose simple linear and quadratic functions.
  • Set an input value.
  • Compare \(f(g(x))\) and \(g(f(x))\).
  • Observe how the order of operations changes the result.

Evaluate both orders

10. Composite Functions from Graphs

Two-step graphical evaluation

  • Find \(g(a)\) on the graph of \(g\).
  • Locate that result on the horizontal axis of the graph of \(f\).
  • Read \(f(g(a))\).
  • For \(g(f(a))\), reverse the roles.

Worksheet practice, page 5

\[(f\circ g)(4)=f(g(4))\]
\[(g\circ f)(-1)=g(f(-1))\]

Work through both sets of graphical questions on page 5. Check whether the intermediate output belongs to the domain of the outer function.

11. Applications and Inverse Functions

Modelling with composition

  • Identify which quantity depends on another.
  • Compose functions to eliminate the intermediate variable.
  • Interpret the result and restrict the domain to meaningful values.
  • If two functions undo each other, their compositions are the identity function.

Worksheet applications

Toy manufacturer, page 5

Given \(n(p)=30-25p\) and \(r(x)=1000-\frac14x^2\), express revenue in terms of price:

\[\boxed{r(n(p))=1000-\frac14(30-25p)^2}\]
Inverse functions preview, page 6
\[f(x)=\frac{x-16}{4},\qquad g(x)=4x+16\]
\[\boxed{f(g(x))=x,\qquad g(f(x))=x}\]

12. Practice and Common Mistakes

Use your worksheet

  • Page 1: transformations and function operations.
  • Page 2: function notation and domain restrictions.
  • Page 3: graph reading and creating equations.
  • Pages 4–5: algebraic and graphical compositions.
  • Page 6: inverse function preview.

Avoid these mistakes

  • Assuming \(f(g(x))=g(f(x))\).
  • Forgetting brackets around the inner expression.
  • Confusing \((fg)(x)\) with \((f\circ g)(x)\).
  • Ignoring excluded values in a composite domain.
  • Reading the outer function first when evaluating a composition.

Open the full Lesson 2.7 worksheet

IB Past Paper Problems

Select a topic and unit, then click the button below to get a new problem.

Press the button to start!