01 Foundations
Functions
Learn function notation, inputs and outputs, domain and range, and the behaviour of linear functions.
mathematics · functions
Functions
A function is a rule that takes an input and produces exactly one output.
Function notation is written as:
This is read as "\(f\) of \(x\)." The expression \(f(x)\) represents the output produced by the function when the input is \(x\).
For example:
To calculate \(f(4)\), substitute 4 wherever \(x\) appears:
A function must assign exactly one output to each input. Different inputs can produce the same output. For example:
Then:
and:
Both inputs produce the same output, which is allowed.
4.1 Domain and range
The domain is the set of allowed inputs to a function.
The range is the set of outputs the function can produce.
Consider:
Any real number can be used as an input, so the domain is all real numbers.
Because \(x^2\) cannot be negative:
Therefore:
The smallest possible output is 2. The range is:
Now consider:
The input cannot be zero because division by zero is undefined.
Its domain is all real numbers except zero. Its range is also all real numbers except zero.
For:
the denominator cannot be zero:
Therefore, \(x\ne3\).
4.2 Linear functions
A linear function has the general form:
where:
- \(m\) is the slope.
- \(c\) is the \(y\)-intercept.
The slope describes how quickly the output changes as the input changes.
The \(y\)-intercept is the output when \(x=0\).
For example:
Its slope is 2, and its \(y\)-intercept is 3.
When \(x=0\):
So the graph crosses the \(y\)-axis at \((0,3)\).
4.3 Plotting a linear function
Consider:
Some input-output pairs are:
These give the coordinates:
Plotting these points and connecting them produces a straight line.
4.4 Calculating slope from two points
Given two points:
the slope is:
For example, using the points \((-2,0)\) and \((0,2)\):
The slope is 1.
4.5 Positive, negative, and zero slopes
A positive slope means the line increases as \(x\) increases.
A negative slope means the line decreases as \(x\) increases.
A zero slope means the function is constant: its output does not change as the input changes.
For example:
has slope 0.
A function such as:
has slope \(-2\) and \(y\)-intercept 0.
4.6 The x-intercept and y-intercept
The \(y\)-intercept is found by setting \(x=0\).
The \(x\)-intercept is found by setting \(y=0\), or equivalently solving \(f(x)=0\).
For:
The \(y\)-intercept is:
To find the \(x\)-intercept:
So the \(x\)-intercept is:
4.7 Parallel and perpendicular lines
Two non-vertical lines are parallel when they have the same slope.
For example:
and:
Both have slope 3, so they are parallel.
Two non-vertical lines are perpendicular when the product of their slopes is \(-1\):
For example, a line with slope 2 is perpendicular to a line with slope:
A horizontal line has slope 0. A vertical line has an undefined slope.