Sub topic 1
What a function is and how to read f(x)
Prerequisites
This chapter assumes you can solve linear and quadratic equations, plot points on a coordinate plane, and evaluate expressions by substitution. You should also know what an absolute value is.
What a function is and how to read f(x)
A function is a rule that assigns exactly one output to each input. We write f(x) for the output the rule gives when the input is x. The notation f(x) is read as "f of x" and does not mean f times x.
def f(x):
return 2 * x + 3
print(f(4)) # 11
print(f(-1)) # 1Domain and range: which inputs work and which outputs appear
The domain is the set of inputs a function accepts. The range is the set of outputs it produces. For f(x) = 1/(x - 2), the input x = 2 causes division by zero, so the domain is every real number except 2.
Reading and plotting graphs
A graph plots each pair (x, f(x)) as a point. To sketch a graph, choose several inputs, compute their outputs, and plot the points. Then join them with a smooth curve or straight line. Key features to mark are intercepts, turning points, and any gaps in the domain.
Linear functions: slope and intercepts
A linear function has the form f(x) = mx + c. The slope m equals rise divided by run. The y-intercept c is the output at x = 0. The x-intercept is the input where f(x) = 0, which equals -c/m when m is not zero.
| Function | Slope | y-intercept | x-intercept |
|---|---|---|---|
| f(x) = 2x + 3 | 2 | 3 | -1.5 |
Quadratic functions: vertex, axis and roots
A quadratic function has the form f(x) = ax^2 + bx + c, with a not zero. Its graph is a parabola. The vertex lies at x = -b/(2a), and the vertical line through the vertex is the axis of symmetry. The roots are the inputs where f(x) = 0.
def g(x):
return x ** 2 - 6 * x + 5
a, b = 1, -6
vertex_x = -b / (2 * a)
print(vertex_x, g(vertex_x)) # 3.0 -4.0Exercise
If f(x) = 2x + 3, what is f(4)?
Show answer
f(4) = 2(4) + 3 = 11.