Think of a function as a machine. You feed it an input (say, a number x), it does something, and out comes an output f(x). Now imagine you have two such machines, f and g. Function operations are simply ways to hook these machines together — to add, subtract, multiply, or divide their outputs, or to feed one machine's output into the other.
The core idea is simple: if you can do arithmetic with numbers, you can do arithmetic with functions. The only catch is that both functions must be "ready to work" on the same input at the same time.
The Four Arithmetic Operations
Let f and g be two functions. For any input x that belongs to both their domains (the set of numbers each can accept), we define:
Operation
Notation
What it means
Sum
(f+g)(x)
f(x)+g(x)
Difference
(f−g)(x)
f(x)−g(x)
Product
(f⋅g)(x)
f(x)⋅g(x)
Quotient
(gf)(x)
g(x)f(x), provided g(x)=0
Note
The domain of the new function is the intersection of the domains of f and g — the numbers both machines can handle. For the quotient, you must also exclude any x where g(x)=0, because division by zero is undefined.
Example. Let f(x)=x (domain: x≥0) and g(x)=x−1 (domain: all real numbers). Then:
(f+g)(x)=x+x−1, domain: x≥0.
(gf)(x)=x−1x, domain: x≥0andx=1.
Composition: Feeding One Machine into Another
This is the most powerful operation. Instead of adding outputs side by side, you take the output of one function and feed it as the input to the other.
(f∘g)(x)=f(g(x))
Read "f composed with g". You do g first, then f on the result.
Intuition. Suppose g is a machine that converts Celsius to Fahrenheit, and f is a machine that converts Fahrenheit to Kelvin. Then f∘g converts Celsius directly to Kelvin — one combined machine.
Domain trap. For f(g(x)) to make sense, two conditions must hold:
x must be in the domain of g (so g(x) exists).
g(x) must be in the domain of f (so f can accept it).
So the domain of f∘g is: all x in the domain of g such that g(x) is in the domain of f.
Watch out
Composition is not commutative. f∘g is almost never the same as g∘f. For example, if f(x)=x2 and g(x)=x+1, then:
Function operations are performed pointwise: add, subtract, or divide the output values for the same input x. For f(x)=x+1 and g(x)=2x−3, we get (f+g)(x)=3x−2, (f−g)(x)=−x+4, and (gf)(x)=2x−3x+1 with domain R∖{23}.
When you have two functions, you can combine them just like numbers — by adding, subtracting, multiplying, or dividing their outputs. The key idea is that these operations happen pointwise: for each input x, you first evaluate f(x) and g(x) separately, then perform the arithmetic on those two numbers. The result is a new function whose rule is the combination of the original rules.
Let’s see this in action.
Addition: f+g
The sum function is defined by (f+g)(x)=f(x)+g(x).
Substitute the given expressions:
(f+g)(x)=(x+1)+(2x−3)
Combine like terms: x+2x=3x, and 1−3=−2.
So (f+g)(x)=3x−2.
The domain is all real numbers, since both f and g are defined everywhere.
Subtraction: f−g
The difference function is (f−g)(x)=f(x)−g(x).
(f−g)(x)=(x+1)−(2x−3)
Distribute the minus sign: x+1−2x+3.
Combine: x−2x=−x, and 1+3=4.
So (f−g)(x)=−x+4.
Again, domain is R.
Division: gf
The quotient function is (gf)(x)=g(x)f(x), provided g(x)=0.
(gf)(x)=2x−3x+1
Now, division by zero is undefined, so we must exclude any x where g(x)=0.