47  Functions

47.1 Introduction

A function is one of the central concepts in mathematics.
It describes a relationship between two sets where each input (from the domain) corresponds to exactly one output (in the codomain).

Functions are used in every area of mathematics: algebra, calculus, statistics, computer science, and real-world applications like economics, physics, and business analytics.


47.2 Definition of a Function

Let \(A\) and \(B\) be two non-empty sets. A function \(f\) from \(A\) to \(B\) is a rule which assigns each element of \(A\) to exactly one element of \(B\).

Notation: \(f: A \to B\)
- \(A\): domain
- \(B\): codomain
- \(f(A)\): image or range

Example: \(f(x)=x^2\) maps real numbers to non-negative reals.


47.3 Representation of Functions

  • Algebraic form: \(f(x)=2x+3\)
  • Table form: input–output pairs
  • Graphical form: plot points \((x,f(x))\)
  • Arrow diagrams: mapping from domain to codomain

47.4 Types of Functions

  1. One-to-one (Injective): Each element of domain maps to a unique element of codomain.
  2. Onto (Surjective): Every element of codomain has at least one pre-image.
  3. Bijective: Both one-to-one and onto; invertible.
  4. Constant function: \(f(x)=c\).
  5. Identity function: \(f(x)=x\).
  6. Polynomial functions: \(f(x)=ax^n+...\).
  7. Exponential function: \(f(x)=a^x\).
  8. Logarithmic function: \(f(x)=\log_a x\).
  9. Trigonometric functions: \(\sin x, \cos x, \tan x\), etc.
  10. Even function: \(f(-x)=f(x)\) (symmetric about y-axis).
  11. Odd function: \(f(-x)=-f(x)\) (symmetric about origin).

47.5 Domain and Range

  • Domain: set of all valid inputs.
  • Range: set of all actual outputs.

Examples:
1. \(f(x)=1/x\) has domain \(\mathbb{R}\setminus\{0\}\), range \(\mathbb{R}\setminus\{0\}\).
2. \(f(x)=\sqrt{x}\) has domain \(x\geq 0\), range \(y\geq 0\).


47.6 Operations on Functions

  • Addition: \((f+g)(x)=f(x)+g(x)\)
  • Subtraction: \((f-g)(x)=f(x)-g(x)\)
  • Multiplication: \((fg)(x)=f(x)\cdot g(x)\)
  • Division: \((f/g)(x)=f(x)/g(x)\), \(g(x)\neq 0\)

47.7 Composition of Functions

If \(f:A\to B\) and \(g:B\to C\), then
\[ (g\circ f)(x)=g(f(x)) \]

Composition is not commutative: generally \(g(f(x))\neq f(g(x))\).


47.8 Inverse of a Function

If \(f:A\to B\) is bijective, its inverse \(f^{-1}:B\to A\) exists such that:
\[ f^{-1}(f(x))=x,\quad f(f^{-1}(y))=y \]

Example: If \(f(x)=2x+3\), then \(f^{-1}(y)=(y-3)/2\).


47.9 Graphs of Common Functions

  • Linear: straight line.
  • Quadratic: parabola.
  • Cubic: S-shaped curve.
  • Exponential: rapid growth/decay.
  • Logarithmic: slow growth, inverse of exponential.
  • Trigonometric: periodic, wave-like.

47.10 Solved Examples

Example 1
Find domain and range of \(f(x)=\sqrt{x-2}\).
Domain: \(x\geq 2\).
Range: \(y\geq 0\).


Example 2
If \(f(x)=2x+1\), \(g(x)=x^2\), find \((f\circ g)(x)\) and \((g\circ f)(x)\).
- \((f\circ g)(x)=f(g(x))=f(x^2)=2x^2+1\).
- \((g\circ f)(x)=g(f(x))=g(2x+1)=(2x+1)^2\).


Example 3
If \(f(x)=3x-4\), find \(f^{-1}(x)\).
\(y=3x-4 \Rightarrow x=(y+4)/3\).
So \(f^{-1}(x)=(x+4)/3\).


Example 4
Check if \(f(x)=x^2\) is one-to-one.
\(f(2)=4=f(-2)\), so not one-to-one over \(\mathbb{R}\).
But restricting domain to \(x\geq 0\), it becomes one-to-one.


47.11 Practice Problems

  1. Find domain and range of \(f(x)=\frac{1}{x-3}\).
  2. If \(f(x)=2x+5\), \(g(x)=x^2+1\), find \((f\circ g)(x)\).
  3. Show that \(f(x)=x^3\) is one-to-one and onto \(\mathbb{R}\).
  4. Determine if \(f(x)=\cos x\) is even or odd.
  5. Find inverse of \(f(x)=(x-1)/(x+2)\).

47.12 Summary

  • A function maps each input to exactly one output.
  • Key types: injective, surjective, bijective, constant, identity, polynomial, exponential, logarithmic, trigonometric.
  • Domain: valid inputs, range: actual outputs.
  • Functions can be added, multiplied, composed.
  • Inverse exists only if function is bijective.
  • Graphs help visualize behavior and symmetry.