← LOGBOOK LOG-372
COMPLETE · MATHEMATICS ·
ALGEBRAFUNCTIONSDOMAINRANGECOMPOSITIONFOUNDATIONS

Functions — Domain, Range, and Composition

What a function is, how to characterise it by its domain and range, and how functions combine through composition.

What a Function Is

A function is a rule that assigns to each input exactly one output. One input → one output. That’s the whole definition.

f(x) = 2x + 1

For any x you put in, you get exactly one value out. f(3) = 7. f(−1) = −1. No input produces two different outputs.

Notation: f(x) is read “f of x.” The letter f names the function; x is the input. The output is f(x).

The vertical line test

A graph represents a function if and only if every vertical line crosses it at most once. If a vertical line hits the graph at two points, two outputs correspond to one input — not a function.


Domain

The domain is the set of all valid inputs — all values x can take.

Three things that restrict a domain:

  1. Division by zero — the denominator cannot be zero
  2. Even roots of negatives — √(negative) is not real
  3. Logarithms of non-positives — log(x) requires x > 0
f(x) = 1/(x − 3)       domain: x ≠ 3, i.e., (−∞,3) ∪ (3,∞)
f(x) = √(x − 2)        domain: x ≥ 2, i.e., [2, ∞)
f(x) = log(x + 5)      domain: x > −5, i.e., (−5, ∞)
f(x) = x² + 1          domain: all reals, (−∞, ∞)

If no domain is stated, assume all real numbers that make the expression defined.


Range

The range is the set of all possible outputs — the values f(x) can actually take.

Finding the range is often harder than finding the domain. Strategies:

  • Think about what values the function can and cannot produce
  • Solve x = f(y) for y, then find the domain of that expression
  • For simple functions, read the range from a graph
f(x) = x²           range: [0, ∞)  — squares are never negative
f(x) = x² − 4       range: [−4, ∞) — shifts the parabola down by 4
f(x) = √x           range: [0, ∞)
f(x) = 1/x          range: all reals except 0, (−∞,0) ∪ (0,∞)
f(x) = sin(x)       range: [−1, 1]

Types of Functions

Linear: f(x) = mx + b — straight line, constant rate of change. m is the slope, b is the y-intercept.

Quadratic: f(x) = ax² + bx + c — parabola. Opens up if a > 0, down if a < 0.

Polynomial: f(x) = aₙxⁿ + … + a₁x + a₀ — sums of power terms. Domain always all reals.

Rational: ratio of polynomials. Denominator restrictions apply.

Exponential: f(x) = aˣ — rapid growth or decay. Domain all reals, range (0, ∞) if a > 0.

Logarithmic: f(x) = log(x) — inverse of exponential. Domain (0, ∞), range all reals.

Trigonometric: sin, cos, tan — periodic functions. Covered in the trigonometry note.


Transformations

Starting from a base function f(x), transformations shift, stretch, or reflect it:

TransformationEffect
f(x) + kshift up k units
f(x) − kshift down k units
f(x + h)shift left h units
f(x − h)shift right h units
−f(x)reflect over x-axis
f(−x)reflect over y-axis
a·f(x)stretch vertically by a
f(ax)compress horizontally by a
g(x) = (x − 3)² + 2

This is f(x) = x² shifted right 3, up 2. Vertex at (3, 2).

Transformations compound — apply inside the function first (horizontal effects), then outside (vertical effects).


Inverse Functions

The inverse function f⁻¹ undoes what f does. If f(a) = b, then f⁻¹(b) = a.

f(x) = 2x + 3
y = 2x + 3
x = (y − 3)/2     (solve for x)
f⁻¹(x) = (x − 3)/2

Check: f(f⁻¹(x)) = x and f⁻¹(f(x)) = x.

Graphically: the inverse is the reflection of f over the line y = x.

Not every function has an inverse. f(x) = x² doesn’t — f(2) = f(−2) = 4, so you can’t reverse from 4 to a unique input. A function must be one-to-one (each output comes from exactly one input) to have an inverse. The horizontal line test checks this on a graph.


Composition

Function composition feeds the output of one function into another:

(f ∘ g)(x) = f(g(x))

First apply g, then apply f to the result.

f(x) = x + 1
g(x) = x²

(f ∘ g)(x) = f(g(x)) = f(x²) = x² + 1
(g ∘ f)(x) = g(f(x)) = g(x + 1) = (x + 1)²

Order matters — f ∘ g ≠ g ∘ f in general.

Domain of a composition

The domain of f ∘ g is all x in the domain of g such that g(x) is in the domain of f.

f(x) = √x        (domain: x ≥ 0)
g(x) = x − 4

(f ∘ g)(x) = √(x − 4)
domain: x − 4 ≥ 0 → x ≥ 4

Decomposing functions

Recognising a function as a composition is useful in calculus (chain rule) and when designing systems:

h(x) = (3x + 1)⁵
= f(g(x)) where g(x) = 3x + 1 and f(x) = x⁵

Even and Odd Functions

Even function: f(−x) = f(x) — symmetric about the y-axis. Examples: x², cos(x), |x|.

Odd function: f(−x) = −f(x) — symmetric about the origin. Examples: x³, sin(x), x.

Most functions are neither. These properties matter in integration (odd functions integrate to zero over symmetric intervals) and signal processing (even/odd decomposition).