ironfern @ docs ~/math/grade-9/2-quadratic/functions $

Functions

A function is one of the most fundamental concepts in mathematics. It describes a precise relationship between two sets of numbers.

What Is a Function?

📐Definition — Function

A function ff from set AA to set BB is a rule that assigns to each element xAx \in A exactly one element yBy \in B. We write y=f(x)y = f(x).

  • xx is called the input (or argument)
  • y=f(x)y = f(x) is called the output (or value)

The key word is exactly one. For every valid input, the function produces one and only one output. The notation f(2)f(2) means “evaluate the function ff at x=2x = 2.”

Domain and Range

📐Definition — Domain and Range
  • The domain of ff is the set of all valid inputs xx for which f(x)f(x) is defined.
  • The codomain is the target set BB.
  • The range is the set of all actual outputs: {f(x):xdomain}\{f(x) : x \in \text{domain}\}.

The range is always a subset of the codomain, but they are not always equal.

Common Examples

FunctionFormulaDomain
Linearf(x)=2x+1f(x) = 2x + 1all real numbers
Quadraticf(x)=x2f(x) = x^2all real numbers
Square rootf(x)=xf(x) = \sqrt{x}x0x \geq 0
Reciprocalf(x)=1xf(x) = \dfrac{1}{x}x0x \neq 0
Example — Evaluating a Function

Let f(x)=2x23x+1f(x) = 2x^2 - 3x + 1. Find f(3)f(3).

Solution. Substitute x=3x = 3:

f(3)=2(3)23(3)+1=189+1=10f(3) = 2(3)^2 - 3(3) + 1 = 18 - 9 + 1 = 10

The Vertical Line Test

A graph in the xyxy-plane represents a function if and only if every vertical line intersects the graph at most once. If any vertical line crosses the graph in two or more points, the graph fails the test — it does not define a function, because one input would map to multiple outputs.

For instance, the graph of y=x2y = x^2 passes the test (parabola), but the graph of x2+y2=1x^2 + y^2 = 1 (circle) does not.

Piecewise Functions

A piecewise function uses different formulas on different parts of its domain.

Example — Piecewise Function
f(x)={x2if x<02x+1if x0f(x) = \begin{cases} x^2 & \text{if } x < 0 \\ 2x + 1 & \text{if } x \geq 0 \end{cases}

Evaluate f(2)f(-2) and f(3)f(3).

Solution.

  • Since 2<0-2 < 0, use the first rule: f(2)=(2)2=4f(-2) = (-2)^2 = 4.
  • Since 303 \geq 0, use the second rule: f(3)=2(3)+1=7f(3) = 2(3) + 1 = 7.

Piecewise functions are especially useful for modeling real-world situations where different rules apply under different conditions — for example, tax brackets or shipping rates.