A Catalog of Essential Functions
Almost every function in calculus is built from a short list of basic families: linear, polynomial, power, rational, algebraic, trigonometric, exponential and logarithmic. This lesson lists each family with its defining features, shows how to recognise one in data, and explains why the choice of family is the first step of every mathematical model.
For a first look, see Types of Functions, Polynomials and Their Roots and Trigonometric Functions.
Mathematical models
A model is a function chosen to describe a real quantity. The workflow is always the same: pick a family from the catalogue below based on theory or on the shape of the data, fit its parameters, use it to predict, and test the predictions against new data. The catalogue is the menu.
The catalogue
| Family | Form | Key features |
|---|---|---|
| linear | constant rate of change | |
| polynomial | , | degree , at most roots and turning points, domain |
| power | , constant | (positive integer), (root), (reciprocal) |
| rational | , , polynomials | undefined where , often vertical asymptotes |
| algebraic | built from polynomials with , , , and roots | e.g. , |
| trigonometric | , , , … ( in radians) | periodic: and have period , has period |
| exponential | , , | growth () or decay () by a constant factor |
| logarithmic | , , | inverse of , domain , grows slower than any power |
Functions that are not algebraic (trigonometric, exponential, logarithmic and their inverses) are called transcendental.
Linear models
A function is linear exactly when its rate of change is constant: equal steps always produce equal steps , and . Two measurements determine the model.
from fractions import Fraction as F
# p95 latency of a service measured at two request rates
r1, t1 = 200, F(42) # requests/s, milliseconds
r2, t2 = 500, F(87)
m = (t2 - t1) / (r2 - r1)
b = t1 - m * r1
print("slope m =", m, "ms per (req/s)")
print("intercept b =", b, "ms")
print("model at 800 req/s:", m * 800 + b, "ms")
print("budget 120 ms reached at", (120 - b) / m, "req/s")slope m = 3/20 ms per (req/s)
intercept b = 12 ms
model at 800 req/s: 132 ms
budget 120 ms reached at 720 req/s
Exact fractions keep the slope instead of a rounded float. Whether the service really stays linear beyond 500 req/s is a question for the data, not the algebra: queues typically make latency blow up near capacity, which a rational model like captures better.
Polynomials and power functions
The degree controls a polynomial's end behaviour: for large the leading term dominates everything else. Even degree means both ends go the same way; odd degree means opposite ways.
Power functions behave very differently depending on :
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0.05, 2, 300)
plt.figure(figsize=(6, 4))
for a, label in [(3, "x³"), (2, "x²"), (1, "x"), (0.5, "√x"), (-1, "1/x")]:
plt.plot(x, x**a, label=label)
plt.ylim(0, 4)
plt.axvline(1, color="grey", lw=0.5)
plt.legend()
plt.title("Power functions xᵃ: all pass through (1, 1)")
for a in [3, 2, 1, 0.5, -1]:
print(f"a = {a:>4}: f(0.5) = {0.5**a:.3f}, f(2) = {2**a:.3f}")a = 3: f(0.5) = 0.125, f(2) = 8.000
a = 2: f(0.5) = 0.250, f(2) = 4.000
a = 1: f(0.5) = 0.500, f(2) = 2.000
a = 0.5: f(0.5) = 0.707, f(2) = 1.414
a = -1: f(0.5) = 2.000, f(2) = 0.500
On a larger exponent gives a smaller value; past the order flips. That crossover is why is negligible next to for small , the idea behind linear approximation in chapter 3.
Recognising a power law in data
If , then : on a log-log plot a power law is a straight line whose slope is the exponent. This is the standard way to measure a scaling exponent, for example the running-time growth of an algorithm.
import numpy as np
n = np.array([1000, 2000, 4000, 8000, 16000, 32000])
rng = np.random.default_rng(7)
seconds = 2e-6 * n**1.5 * (1 + 0.03 * rng.standard_normal(n.size)) # simulated timings
a, logc = np.polyfit(np.log(n), np.log(seconds), 1)
print(f"fitted exponent a ≈ {float(a):.3f}")
print(f"fitted constant c ≈ {float(np.exp(logc)):.2e}")fitted exponent a ≈ 1.490
fitted constant c ≈ 2.15e-06
The fit recovers an exponent of 1.49 (true value 1.5) despite 3 % noise; the constant is less precise, because a small error in the slope is magnified when extrapolated back to . An exponential model would instead be a straight line on a semi-log plot ( against ), which is how you tell the two families apart.
Trigonometric and exponential families
A general sinusoid has amplitude , period , phase shift and midline . It models anything periodic: daily traffic, seasons, sound. Exponentials model quantities that change by a constant factor per unit step, as linear functions change by a constant amount. They get their own lessons: Exponential Functions and Inverse Functions and Logarithms.
In software
The catalogue is the vocabulary of complexity analysis: , , , , , are a constant, a logarithm, linear, a product, a power and an exponential (Time Complexity). Graphics and audio code is full of sinusoids, animation uses polynomial easing curves, ML uses the exponential inside softmax and the logarithm inside cross-entropy loss, and capacity planning fits linear and power-law models to load-test data exactly as above.
Exercises
Exercise 1: Classify
Classify each function as polynomial, rational, algebraic (but not rational), power, exponential or trigonometric: (a) , (b) , (c) , (d) , (e) , (f) .
Answer
(a) rational, (b) exponential, (c) power, (d) algebraic, (e) polynomial, (f) trigonometric.
Solution
(a) is a quotient of polynomials. In (b) the variable is in the exponent, while in (c) the variable is the base and the exponent is fixed. (d) needs a root of a polynomial. (e) has degree 3. (f) is a sinusoid with period .
Exercise 2: A heating model
A 3D printer's nozzle warms linearly from 22 °C at s to 210 °C at s. Find and the time at which it reaches 150 °C.
Answer
; it reaches 150 °C at s.
Solution
Exercise 3: End behaviour
Describe the end behaviour of and give the maximum number of real roots and turning points.
Answer
as and as ; at most 5 roots and 4 turning points.
Solution
The leading term dominates. Odd degree with a negative leading coefficient: large positive gives large negative values and large negative gives large positive values. A degree-5 polynomial has at most 5 roots, and its derivative (degree 4) has at most 4 roots, so at most 4 turning points.
Exercise 4: Find the exponent
Timings of a function are 0.8, 3.2, 12.8 and 51.2 ms for inputs , 200, 400 and 800. Find the exponent in by hand, then with a log-log fit in Python.
Answer
(each doubling of multiplies by 4), ms.
Solution
Doubling multiplies by , so . Then .
import numpy as np
n = np.array([100, 200, 400, 800])
t = np.array([0.8, 3.2, 12.8, 51.2])
a, logc = np.polyfit(np.log(n), np.log(t), 1)
print(round(float(a), 6), f"{float(np.exp(logc)):.1e}")2.0 8.0e-05
Test yourself
Which function is a power function rather than an exponential?
Data points lie on a straight line when you plot against . Which family fits?
- Power function
- Exponential
- Linear in and
- Logarithmic
What is the period of ?
- 3