learn › Algebra

Functions

lesson · about 3 minutes

Composition, inverses, domains, and piecewise rules.

Pen and paper is fine · no calculator needed why?

Opens at level 27. You're level 1. You can read and practice here now.

the idea

A function is a rule that turns each input into one output: f(x) = 2x + 3 turns 4 into 11.

A piecewise function uses different rules on different stretches of x. A composition, like f(g(3)), feeds one function's output into another. An inverse, written f⁻¹, runs the rule backward: f⁻¹(11) asks which input gave 11. The domain is every input the rule can accept.

techniques

Pick the piece first

The function has different rules for different values of x.

  1. For each input, check which condition it meets.
  2. At the boundary, look for ≤ or ≥. The piece with the bar under its sign includes the boundary.
  3. Use only that piece's rule for that input.
worked example

Example: f(x) = x² when x < 1, and 2x + 5 when x ≥ 1. What is f(1) + f(−2)?

  1. 1 meets x ≥ 1, so f(1) = 2 × 1 + 5 = 7.
  2. −2 meets x < 1, so f(−2) = (−2)² = 4.
  3. Total: 7 + 4 = 11.

Answer: 11

Work inside out

One function sits inside another, like f(g(2)).

  1. Work out the inside function first.
  2. Feed that number into the outside function.
  3. f(g(2)) and g(f(2)) are usually different, so read the order.
worked example

Example: f(x) = 3x − 1 and g(x) = x² + 2. What is f(g(2))?

  1. Inside first: g(2) = 2² + 2 = 6.
  2. Then f(6) = 3 × 6 − 1 = 17.

Answer: 17

What the rule allows

You need the domain: the inputs a function accepts.

  1. Square root: the inside must be 0 or more.
  2. Log: the inside must be more than 0.
  3. Fraction: the bottom cannot be 0.
  4. Solve that condition for x.
worked example

Example: What is the smallest integer x in the domain of f(x) = log(x − 2)?

  1. A log needs a positive inside: x − 2 > 0.
  2. So x > 2, which leaves out 2 itself.
  3. The smallest integer above 2 is 3.

Answer: 3

watch out for

practice

Sign in to try one

Piecewise functions

worked example

f(x) = 2x + 8 when x ≤ 0, and x² when x > 0. What is f(0) + f(5)?

Answer: 33

  1. f(0) uses the first rule (x ≤ 0): 2 × 0 + 8 = 0 + 8 = 8.
  2. f(5) uses the second rule (x > 0): 5² = 25.
  3. Total: 8 + 25 = 33.

Composition

worked example

f(x) = 2x + 6 and g(x) = x − 4. What is g(f(2))?

Answer: 6

  1. Work inside out: f(2) = 2 × 2 + 6 = 4 + 6 = 10.
  2. Then g(10) = 10 − 4 = 6.

Inverse value

worked example

f(x) = 3x − 10. What is f⁻¹(−31)?

Answer: -7

  1. f⁻¹(−31) is the input that gives −31: solve 3x − 10 = −31.
  2. 3x = −21, so x = −7.

Domain

worked example

What is the domain of f(x) = √(−2 − x)?

  1. x ≤ 2
  2. all real x
  3. x < −2
  4. x ≥ −2
  5. x ≤ −2

Answer: x ≤ −2

  1. A square root needs a non-negative inside: −2 − x ≥ 0, so x ≤ −2.

Sign in to start