What is a Function?
A function is a rule that assigns exactly one output to every input. Think of it like a machine: you put a number in, the machine processes it, and exactly one number comes out. If the machine sometimes produced two different outputs for the same input, it would not be a function.
The most common example: f(x) = x². Every number you put in comes out squared. Put in 3, you get 9. Put in −3, you also get 9. That is fine — two different inputs can produce the same output. What is not allowed is one input producing two different outputs.
A function f from set A to set B is a rule that assigns to each element x in A exactly one element f(x) in B. We write f: A → B.
Function Notation: f(x)
The notation f(x) is read "f of x." The letter f is the name of the function, and x is the input (called the argument or independent variable). The output f(x) is called the dependent variable — its value depends on x.
f(2) = (2)² + 3(2) − 5 = 4 + 6 − 5 = 5
You will also see functions named g, h, p, or any other letter. In calculus, you will often work with f(x) and g(x) simultaneously — for example, when finding the area between two curves or composing two functions.
Domain and Range
The domain of a function is the set of all valid inputs — all values of x for which f(x) is defined. The range is the set of all possible outputs.
- f(x) = x² — Domain: all real numbers (any x works). Range: [0, ∞) — outputs are never negative.
- f(x) = √x — Domain: [0, ∞) — you cannot take the square root of a negative number (in real numbers). Range: [0, ∞).
- f(x) = 1/x — Domain: all real numbers except x = 0 (division by zero is undefined). Range: all real numbers except 0.
- f(x) = ln(x) — Domain: (0, ∞) — the natural log is only defined for positive numbers. Range: all real numbers.
When you differentiate or integrate a function, you need to know where the function is defined. You cannot take the derivative of f(x) = √x at x = 0 (the tangent line would be vertical), and you cannot integrate 1/x over an interval that includes x = 0 without special treatment.
Reading Function Graphs
The graph of a function f is the set of all points (x, f(x)) in the coordinate plane. It gives you an instant visual summary of the function's behaviour — where it is increasing, where it peaks, where it crosses zero.
The vertical line test confirms whether a graph represents a function: if any vertical line crosses the graph more than once, it is not a function (because one x-value would produce two y-values).
Types of Functions in Calculus
Calculus deals with many different types of functions. Each has a characteristic shape, behaviour, and set of derivative/integral rules. Here are the most important ones you will encounter:
Composition of Functions
Function composition means applying one function to the output of another. If f(x) = x² and g(x) = sin(x), then the composition g(f(x)) = sin(x²) — first square x, then take the sine of the result.
Example: f(x) = x², g(x) = sin(x)
(g ∘ f)(x) = sin(x²)
Composition is critical in calculus because the Chain Rule — one of the most important differentiation rules — exists specifically to differentiate composed functions. Understanding composition now will make the chain rule feel natural when you reach it.
Given f(x) = 2x + 1 and g(x) = x³, find f(g(2)) and g(f(2)).
- Stewart, J. (2015). Calculus, 8th ed., Ch. 1. Cengage.
- Strang, G. (1991). Calculus. Wellesley-Cambridge Press.
- Apostol, T. (1967). Calculus, Vol. 1. Wiley.
Ready to test your knowledge? The 50 Practice Problems collection covers functions through integrals with full solutions. The AP Calculus Review is the best single resource for exam prep.