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.

Formal Definition

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(x) = x² + 3x − 5

f(2) = (2)² + 3(2) − 5 = 4 + 6 − 5 = 5
Evaluating a function: replace every x with the input value

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.

Why Domain Matters in Calculus

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.

Reading a Function Graph
max f(x) zero zero increasing → ← decreasing x f(x)

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:

Linear
f(x) = mx + b
Straight line. Constant rate of change. Derivative is the constant m.
Quadratic
f(x) = ax² + bx + c
Parabola. Has one turning point (vertex). Derivative is linear.
Polynomial
f(x) = aₙxⁿ + ... + a₀
Sum of power terms. Smooth and continuous everywhere. Easiest to differentiate.
Exponential
f(x) = eˣ or aˣ
Grows or decays rapidly. eˣ is its own derivative — the most remarkable function in calculus.
Logarithmic
f(x) = ln(x) or log(x)
Inverse of exponential. Grows slowly. d/dx[ln x] = 1/x.
Trigonometric
sin(x), cos(x), tan(x)
Periodic waves. Their derivatives cycle: sin → cos → −sin → −cos → sin...

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.

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

Example: f(x) = x², g(x) = sin(x)
(g ∘ f)(x) = sin()
Composition is read right-to-left: apply f first, then g

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.

Example Evaluating and Composing Functions

Given f(x) = 2x + 1 and g(x) = x³, find f(g(2)) and g(f(2)).

f(g(2))First: g(2) = 2³ = 8. Then: f(8) = 2(8) + 1 = 17.
g(f(2))First: f(2) = 2(2) + 1 = 5. Then: g(5) = 5³ = 125.
Key pointf(g(2)) ≠ g(f(2)). Order matters in composition — it is not commutative.
Frequently Asked Questions
What is the difference between a function and an equation?
An equation states that two expressions are equal (e.g., x² + y = 5). A function is a specific rule where one variable (output) is completely determined by another (input). All functions can be written as equations, but not all equations define functions — for example, x² + y² = 25 (a circle) is an equation but not a function of x, since one x-value gives two y-values.
What does it mean for a function to be "even" or "odd"?
An even function satisfies f(−x) = f(x) — it is symmetric about the y-axis. Examples: f(x) = x², cos(x). An odd function satisfies f(−x) = −f(x) — it has rotational symmetry about the origin. Examples: f(x) = x³, sin(x). These symmetries simplify integrals: the integral of an odd function over a symmetric interval [−a, a] is always zero.
What is an inverse function?
The inverse function f⁻¹ "undoes" what f does. If f(3) = 9, then f⁻¹(9) = 3. Only one-to-one functions (where each output comes from exactly one input) have inverses. The graph of f⁻¹ is the reflection of f across the line y = x. Examples: ln(x) is the inverse of eˣ; arcsin(x) is the inverse of sin(x).
Why do functions matter so much in calculus?
Because calculus is entirely about how functions change (derivatives) and accumulate (integrals). Every calculus operation takes a function as input and produces another function as output. You cannot do calculus without understanding functions — they are the objects calculus studies.
← Previous
History of Calculus — Newton vs Leibniz
Next →
What are Limits? Easy Explanation
References & Further Reading
  • 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.

AM
Dr. Aisha Malik, PhD Mathematics
Senior Lecturer in Applied Mathematics · 12 years teaching calculus at university level

Dr. Malik holds a PhD in Applied Mathematics from the University of Edinburgh and has taught calculus to over 4,000 students at both undergraduate and postgraduate level. Her research focuses on numerical methods for differential equations. She has reviewed this article for mathematical accuracy and pedagogical clarity.

Technically reviewed by: Prof. James Chen, Stanford Mathematics Department