Surjective Functions (Onto)
Surjective Functions (Onto). Practice questions to deepen understanding of surjective (onto) functions. Online math practice with full solutions and step-by-step explanations.
Surjective (onto) functions practice — definition, dependence on the codomain B, checking methods, examples of surjective and non-surjective functions.
Definition of surjective, linear (always surjective), quadratic (depends on B), checking methods, exponential (not surjective onto ℝ), logarithm.
🎯 Definition:
A function \(f: A \to B\) is onto (surjective) if:
| 🎯 Surjective Function — Definition The formal definition: A function \(f: A \to B\) is surjective (onto) if: \(\forall y \in B, \exists x \in A: f(x) = y\) or in words: For every y in B, there is some x in A that maps to it In simple terms: Every element in the codomain (B) is attained! No "orphan" element in B that no x maps to ✓ Equivalent: \(f\) is surjective ⇔ range = B The entire set B is the range! Non-surjective example: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = x^2\) range = \([0, \infty)\) but B = \(\mathbb{R}\) (including negatives!) negative numbers are never attained ✗ not surjective! ⚠️ Remember: injective ≠ surjective • injective: every y is attained at most once • surjective: every y in B is attained at least once |
✅ Example:
Is \(f: \mathbb{R} \to \mathbb{R}\), \(f(x) = 2x + 1\) onto?
| ✅ Surjective linear function The function: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = 2x + 1\) Check: We must show that for every \(y \in \mathbb{R}\), there exists \(x \in \mathbb{R}\) such that \(f(x) = y\) Given: some \(y \in \mathbb{R}\) Goal: find x Solution: \(f(x) = y\) \(2x + 1 = y\) \(2x = y - 1\) \(x = \frac{y-1}{2}\) ✓ Verification: \(f\left(\frac{y-1}{2}\right) = 2 \cdot \frac{y-1}{2} + 1 = y\) ✓ Therefore it is surjective! The general rule: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = ax + b\) surjective iff \(a \neq 0\) • If \(a = 0\): constant function (not surjective) • If \(a \neq 0\): always surjective! ✓ Why? A non-horizontal straight line passes through every value in \(\mathbb{R}\) Range = \(\mathbb{R}\) = B ✓ Interesting! A linear function (with \(a \neq 0\)) is: • injective ✓ • surjective ✓ Therefore it is a bijection! |
² Quadratic:
Is \(f: \mathbb{R} \to \mathbb{R}\), \(f(x) = x^2\) onto?
| ² Quadratic — not surjective! The function: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = x^2\) Check: Range of \(x^2\): \(x^2 \geq 0\) always so the range = \([0, \infty)\) But B = \(\mathbb{R}\) includes negative numbers! Test \(y = -1\): Does there exist x such that \(x^2 = -1\)? No! (in \(\mathbb{R}\)) ✗ Therefore not surjective! ⚠️ However... If we change B: \(f: \mathbb{R} \to [0, \infty)\) \(f(x) = x^2\) Now it IS surjective! ✓ (because range = B) The key point: "Surjective" depends on the definition of B! The same function can be: • surjective onto one set • not surjective onto another It depends on what we defined as the "target codomain" Summary for the quadratic: \(f(x) = x^2\) • \(\mathbb{R} \to \mathbb{R}\): not surjective ✗ • \(\mathbb{R} \to [0,\infty)\): surjective ✓ • \([0,\infty) \to [0,\infty)\): surjective and injective! ✓✓ |
🔍 Check method:
How do you check whether \(f: A \to B\) is surjective?
| 🔍 Methods for checking surjectivity The basic principle: \(f: A \to B\) surjective ⇔ range(f) = B Method 1: find the range 1. Find the range of the function 2. Compare with B 3. If equal ⇒ surjective ✓ Example: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = x^3\) Range: \(\mathbb{R}\) (the cube covers everything) B: \(\mathbb{R}\) range = B ⇒ surjective! ✓ Method 2: solve the equation For every \(y \in B\) (arbitrary): 1. Solve \(f(x) = y\) for x 2. If there is a solution in A ⇒ surjective ✓ 3. If no solution ⇒ not surjective ✗ Example: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = 2x + 1\) Let \(y \in \mathbb{R}\) be arbitrary Solve \(2x + 1 = y\): \(x = \frac{y-1}{2} \in \mathbb{R}\) ✓ A solution always exists ⇒ surjective! Method 3: graphical Draw the graph: • If every horizontal line \(y = c\) (with \(c \in B\)) intersects the graph ⇒ surjective ✓ • If some horizontal line does not intersect ⇒ not surjective ✗ Important tip: If you find one value in B that is not attained by any x in A, that is enough to prove f is not surjective! A single counterexample suffices ✓ |
📈 Exponential:
Is \(f: \mathbb{R} \to \mathbb{R}\), \(f(x) = e^x\) onto?
| 📈 Exponential The function: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = e^x\) Check: What is the range of \(e^x\)? \(e^x > 0\) always! For every \(x \in \mathbb{R}\): \(e^x > 0\) so the range = \((0, \infty)\) But B = \(\mathbb{R}\) includes negative numbers and 0! Counterexample: Does there exist x such that \(e^x = -1\)? No! ✗ Does there exist x such that \(e^x = 0\)? No! ✗ Therefore not surjective! ⚠️ However... If we change B: \(f: \mathbb{R} \to (0, \infty)\) \(f(x) = e^x\) Now it IS surjective! ✓ (and also injective — a bijection!) The general rule: \(f(x) = a^x\) (with \(a > 0, a \neq 1\)) • \(\mathbb{R} \to \mathbb{R}\): not surjective ✗ • \(\mathbb{R} \to (0, \infty)\): surjective ✓ The range is always \((0, \infty)\)! Interesting: \(e^x: \mathbb{R} \to (0,\infty)\) This is a bijection! (injective and surjective) The inverse function: \(\ln: (0,\infty) \to \mathbb{R}\) is also a bijection! |
📊 Logarithm:
Is \(f: (0, \infty) \to \mathbb{R}\), \(f(x) = \ln(x)\) surjective?
| 📊 Logarithm — is surjective! The function: \(f: (0, \infty) \to \mathbb{R}\) \(f(x) = \ln(x)\) Check: We must show that for every \(y \in \mathbb{R}\), there exists \(x \in (0, \infty)\) such that \(\ln(x) = y\) Given: some \(y \in \mathbb{R}\) Goal: find \(x \in (0, \infty)\) Solution: \(\ln(x) = y\) \(x = e^y\) Verification: • Is \(e^y > 0\)? Yes! ✓ • Is \(\ln(e^y) = y\)? Yes! ✓ Therefore it is surjective! The range: range(\(\ln\)) = \(\mathbb{R}\) • \(x \to 0^+\): \(\ln(x) \to -\infty\) • \(x \to \infty\): \(\ln(x) \to \infty\) Logarithm covers all of \(\mathbb{R}\)! ✓ Interesting! \(\ln: (0,\infty) \to \mathbb{R}\) is: • injective ✓ • surjective ✓ Therefore it is a bijection! Its inverse: \(e^x: \mathbb{R} \to (0,\infty)\) The rule: \(\log_a: (0,\infty) \to \mathbb{R}\) with \(a > 0, a \neq 1\) always: • injective ✓ • surjective ✓ For every base! |
÷ Rational:
Is \(f: \mathbb{R} \setminus \{0\} \to \mathbb{R}\), \(f(x) = \frac{1}{x}\) surjective?
| ÷ Rational — not surjective! The function: \(f: \mathbb{R} \setminus \{0\} \to \mathbb{R}\) \(f(x) = \frac{1}{x}\) Check: What is the range of \(\frac{1}{x}\)? \(\frac{1}{x} \neq 0\) always! (there is no x such that \(\frac{1}{x} = 0\)) so the range = \(\mathbb{R} \setminus \{0\}\) But B = \(\mathbb{R}\) includes 0! Counterexample: Does there exist x such that \(\frac{1}{x} = 0\)? No! ✗ Therefore not surjective! ⚠️ However... If we change B: \(f: \mathbb{R} \setminus \{0\} \to \mathbb{R} \setminus \{0\}\) \(f(x) = \frac{1}{x}\) Now it IS surjective! ✓ (and also injective — a bijection!) Proof it is onto the smaller codomain: Let \(y \in \mathbb{R} \setminus \{0\}\) Does there exist \(x \in \mathbb{R} \setminus \{0\}\) such that \(\frac{1}{x} = y\)? Yes! \(x = \frac{1}{y}\) ✓ Since \(y \neq 0\), also \(x = \frac{1}{y} \neq 0\) ✓ Interesting! \(\frac{1}{x}: \mathbb{R}\setminus\{0\} \to \mathbb{R}\setminus\{0\}\) is its own inverse! \(f(f(x)) = \frac{1}{\frac{1}{x}} = x\) ✓ |
∿ Trigonometry:
Is \(f: \mathbb{R} \to \mathbb{R}\), \(f(x) = \sin(x)\) surjective?
| ∿ Sine The function: \(f: \mathbb{R} \to \mathbb{R}\) \(f(x) = \sin(x)\) Check: What is the range of \(\sin(x)\)? \(-1 \leq \sin(x) \leq 1\) always! so the range = \([-1, 1]\) But B = \(\mathbb{R}\) Counterexample: Does there exist x such that \(\sin(x) = 2\)? No! ✗ Does there exist x such that \(\sin(x) = -5\)? No! ✗ Therefore not surjective! ⚠️ However... If we change B: \(f: \mathbb{R} \to [-1, 1]\) \(f(x) = \sin(x)\) Now it IS surjective! ✓ (but not injective! Sine is periodic) Fix for bijection: To get a bijection, we must also restrict the domain: \(f: \left[-\frac{\pi}{2}, \frac{\pi}{2}\right] \to [-1, 1]\) \(f(x) = \sin(x)\) Now: • injective ✓ • surjective ✓ The inverse function: \(\arcsin\) Trigonometry summary: • \(\sin: \mathbb{R} \to \mathbb{R}\) — not surjective ✗ • \(\sin: \mathbb{R} \to [-1,1]\) — surjective ✓ • \(\cos: \mathbb{R} \to \mathbb{R}\) — not surjective ✗ • \(\cos: \mathbb{R} \to [-1,1]\) — surjective ✓ |
∘ Composition:
If \(f: A \to B\) and \(g: B \to C\) are both surjective, is \(g \circ f\) surjective?
| ∘ Composition of functions Theorem: If \(f: A \to B\) and \(g: B \to C\) are both surjective, then \((g \circ f): A \to C\) is also surjective! ✓ Proof: Let \(z \in C\) be arbitrary We must find \(x \in A\) such that \((g \circ f)(x) = z\) Step 1: Since \(g\) is surjective and \(z \in C\): ⇒ there exists \(y \in B\) such that \(g(y) = z\) ✓ Step 2: Since \(f\) is surjective and \(y \in B\): ⇒ there exists \(x \in A\) such that \(f(x) = y\) ✓ Step 3: \((g \circ f)(x) = g(f(x)) = g(y) = z\) ✓ We found x! Therefore \(g \circ f\) is surjective! Example: \(f: \mathbb{R} \to \mathbb{R}\), \(f(x) = 2x\) — surjective ✓ \(g: \mathbb{R} \to \mathbb{R}\), \(g(x) = x + 1\) — surjective ✓ \((g \circ f)(x) = 2x + 1\) also surjective! ✓ ⚠️ Remember: If \(g \circ f\) is surjective, that does not guarantee that \(f\) or \(g\) is surjective! However if \(g \circ f\) is surjective: ⇒ \(g\) must be surjective ✓ (but not necessarily f) Summary: • surjective + surjective = surjective ✓ • injective + injective = injective ✓ • bijection + bijection = bijection ✓ |
📚 Summary:
Which condition must hold for \(f: A \to B\) to be surjective?
📚 Summary — Surjective functions Definition: \(f: A \to B\) surjective ⇔ range = B Every element of B is attained by some element of A How do you check?
Surjective examples: • Linear: \(\mathbb{R} \to \mathbb{R}\), \(ax+b\) (a≠0) • Cube: \(\mathbb{R} \to \mathbb{R}\), \(x^3\) • Logarithm: \((0,\infty) \to \mathbb{R}\), \(\ln(x)\) • Sine: \(\mathbb{R} \to [-1,1]\), \(\sin(x)\) Non-surjective examples: • Quadratic: \(\mathbb{R} \to \mathbb{R}\), \(x^2\) (range: [0,∞)) • Exponential: \(\mathbb{R} \to \mathbb{R}\), \(e^x\) (range: (0,∞)) • Rational: \(\mathbb{R}\setminus\{0\} \to \mathbb{R}\), \(\frac{1}{x}\) • Sine: \(\mathbb{R} \to \mathbb{R}\), \(\sin(x)\) ⚠️ Important: • "Surjective" depends on the definition of B! • The same function can be surjective or not, depending on how we define B • Example: \(x^2\) — \(\mathbb{R} \to \mathbb{R}\): not surjective ✗ — \(\mathbb{R} \to [0,\infty)\): surjective ✓ Properties: • surjective + surjective = surjective (composition) ✓ • injective + surjective = bijective ✓ • If f is a bijection, it has an inverse function ✓ |