Sub topic 1
What a function is and how to read f(x)
Prerequisites
This chapter assumes you can do the following:
- Solve linear and quadratic equations.
- Plot points on the coordinate plane and read the axes.
- Work with inequalities and the absolute value of a number.
- Apply the laws of exponents and know what a logarithm means.
You do not need any earlier material from this tutorial. This is the first chapter, and the later chapters build on the notation set up here.
What a function is
A function is a rule that assigns to each allowed input exactly one output. The phrase "exactly one" is the whole definition. If one input could give two different outputs, the rule is not a function.
Take the rule "double the number, then add 3". Input 4 gives 11. Input -1 gives 1. Every input has one answer, so the rule is a function.
Now take the rule "y is a number whose square is x". The input 9 gives both 3 and -3. This rule is not a function of x. CAT questions test this idea in the form "is y a function of x?", and the check is always the same: can one input produce two outputs?
Three words are used throughout the tutorial:
- The input is the value you put in, usually called x.
- The output is the value that comes out, usually called f(x) or y.
- The domain is the set of inputs the rule accepts. The range is the set of outputs it actually produces. The next chapter covers both in detail.
How to read f(x)
The symbol f(x) is read "f of x". It does not mean f multiplied by x. It means "the output of the rule f when the input is x".
Suppose f(x) = 2x + 3. The letter x is a placeholder. To evaluate f at a value, replace every x with that value, using brackets so that signs and powers stay correct.
- f(4) = 2(4) + 3 = 11
- f(-1) = 2(-1) + 3 = 1
- f(a + 1) = 2(a + 1) + 3 = 2a + 5
The last line shows that the input can be an expression. Whatever sits inside the brackets replaces x everywhere.
Common reading errors
- Dropping brackets. For f(x) = x² - 6x + 5, f(-2) = (-2)² - 6(-2) + 5 = 4 + 12 + 5 = 21. Writing -2² gives -4 and a wrong answer.
- Treating f as linear. In general f(a + b) is not f(a) + f(b). For f(x) = x², f(2 + 3) = 25, but f(2) + f(3) = 13.
- Confusing f(x) with f·x. The notation never means multiplication unless the question says so.
- Mixing up the letter. f(x) = x + 1 and f(t) = t + 1 are the same function. The name of the placeholder does not matter.
Ways a function is given
CAT presents functions in several forms. You should be able to evaluate each one.
Algebraic form
A formula such as f(x) = 2x + 3. Substitute and simplify.
Piecewise form
Different formulas apply on different parts of the domain. For example:
f(x) = x + 1 if x < 0, and f(x) = x² if x ≥ 0.
To evaluate f(-3), check which condition -3 satisfies. It satisfies x < 0, so f(-3) = -3 + 1 = -2. For f(2), the condition x ≥ 0 applies, so f(2) = 4. Always pick the branch first, then substitute.
Tabular form
A table lists inputs and outputs directly.
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| f(x) | 5 | 3 | 4 | 10 |
Here f(2) = 4 and f(f(1)) = f(3) = 10. For a composition such as f(f(1)), work from the inside out: find f(1) first, then use that result as the next input.
Verbal or recursive form
Some questions define f by a relation, such as "f(x + 1) = f(x) + 2 and f(0) = 1". You build values step by step: f(1) = 3, f(2) = 5, f(3) = 7. Chapter 16 returns to such relations as functional equations.
Functions as machines and as graphs
Two mental pictures help. In the machine picture, x goes in, the rule acts on it, and f(x) comes out. In the graph picture, each input x is a position on the horizontal axis and f(x) is the height of the curve above that position.
A graph is the set of points (x, f(x)). The vertical line test follows from the definition. A curve is the graph of a function exactly when every vertical line meets it at most once. A circle fails the test, because a vertical line through its middle meets it twice. A parabola opening upward, y = x², passes.
Evaluating with code
You can check hand calculations in Python. A Python function mirrors the mathematical one: it takes an input and returns one output.
def f(x):
return 2 * x + 3
def g(x):
return x ** 2
print(f(4)) # 11
print(f(-1)) # 1
print(f(g(1))) # f(g(x)) = 2x^2 + 3, so 5
print(g(f(1))) # g(f(x)) = (2x + 3)^2, so 25The last two lines show that the order of nesting matters. The output of the inner function becomes the input of the outer one. At x = 1, f(g(1)) is 5 but g(f(1)) is 25. Composition gets its own chapter later, but the evaluation habit starts here: work from the inside out.
The next example evaluates a piecewise function. The if statement does the work of choosing the branch.
def h(x):
if x < 0:
return x + 1
return x ** 2
for value in [-3, 0, 2]:
print(value, h(value))The output is -3 -2, 0 0 and 2 4. These match the hand calculations above.
Worked examples
Example 1: Substituting an expression
Let f(x) = x² - 6x + 5. Find f(a + 2).
Replace x with (a + 2):
f(a + 2) = (a + 2)² - 6(a + 2) + 5 = a² + 4a + 4 - 6a - 12 + 5 = a² - 2a - 3.
Check with a = 1. The formula gives 1 - 2 - 3 = -4. Directly, f(3) = 9 - 18 + 5 = -4. The results agree.
Example 2: Finding the input from the output
Let f(x) = 2x + 3. For which x is f(x) = 11?
Set 2x + 3 = 11, so x = 4. Here you are solving an equation instead of substituting. Some outputs can come from more than one input. For f(x) = x², the output 9 comes from x = 3 and x = -3.
Example 3: Using a relation
Suppose f(x) + 2f(1/x) = 3x for x ≠ 0. This is a CAT-style question, and the substitution idea behind it is the core skill. Replace x with 1/x to get a second equation:
f(1/x) + 2f(x) = 3/x.
Let A = f(x) and B = f(1/x). The two equations are A + 2B = 3x and B + 2A = 3/x. Multiply the second by 2 to get 2B + 4A = 6/x. Subtract the first: 3A = 6/x - 3x, so f(x) = 2/x - x.
Check at x = 1. The original equation gives f(1) + 2f(1) = 3, so f(1) = 1. The formula gives 2 - 1 = 1. It agrees.
Edge cases
- A rule can be a function and still be undefined at some inputs. f(x) = 1/x has no value at x = 0, so 0 is outside its domain.
- Two different formulas can describe the same function. (x² - 1)/(x - 1) and x + 1 agree for every x except 1, where the first is undefined. Because their domains differ, they are different functions.
- A function does not have to be one-to-one. f(x) = x² sends both 3 and -3 to 9. This is allowed. The reverse, one input with two outputs, is not.
- A constant rule such as f(x) = 5 is a function. Every input gives the same output.
Summary of the reading routine
- Identify the placeholder and what is inside the brackets.
- For piecewise rules, pick the branch by testing the condition.
- Substitute with brackets, then simplify.
- For nested expressions, evaluate from the inside out.
- Check with a simple value such as 0, 1 or -1.
Exercise
Let f(x) = x² - 6x + 5. Find f(-2), then find f(a + 2) and verify it at a = 1.
Show answer
f(-2) = (-2)² - 6(-2) + 5 = 4 + 12 + 5 = 21. For f(a + 2), substitute: (a + 2)² - 6(a + 2) + 5 = a² + 4a + 4 - 6a - 12 + 5 = a² - 2a - 3. At a = 1 this gives -4, and f(3) = 9 - 18 + 5 = -4, so the results agree.
Exercise
Define f(x) = x + 1 for x < 0 and f(x) = x² for x ≥ 0. Evaluate f(f(-1)) and f(f(2)).
Show answer
f(-1) = -1 + 1 = 0, since -1 < 0. Then f(0) = 0² = 0, so f(f(-1)) = 0. For the second, f(2) = 4, and f(4) = 16, so f(f(2)) = 16.
Exercise
Is the relation x² + y² = 25 a function with y as the output? Give the reason using one input.
Show answer
No. For x = 3, y can be 4 or -4, so one input gives two outputs. Equivalently, the vertical line x = 3 meets the circle at two points, so the vertical line test fails.
Exercise
If f(x + 1) = f(x) + 2 and f(0) = 1, find f(5).
Show answer
Build step by step: f(1) = 3, f(2) = 5, f(3) = 7, f(4) = 9, f(5) = 11. Equivalently, f(x) = 2x + 1, and f(5) = 11.