Algebra of functions

Numbers can be added, subtracted, multiplied and divided — and so can functions. Given two real-valued functions ff and gg, the algebra of functions tells you how to build four new functions, f+gf+g, f−gf-g, fgfg and f/gf/g, by combining the output values f(x)f(x) and g(x)g(x) at each shared input xx. This closes out the Relations and Functions strand of ISC Class 11 Sets and Functions, right after domain and range, and it stops exactly there: composing functions to build f(g(x))f(g(x)) and finding inverse functions are both Class XII topics and are not touched here. The one genuinely tricky part is not the arithmetic — that is just substitution — it is the domain. Every combined function needs a fresh, separate decision about where it is defined, and that decision is a set-theory question about intersecting domains, never a question you can answer by staring at a simplified algebraic expression. Getting this domain step right, and knowing why it can survive algebraic cancellation, is what this article is built around.

The core insight

Combined functions like f+gf+g, f−gf-g, fgfg and f/gf/g are formed pointwise from f(x)f(x) and g(x)g(x), but each one's domain is found separately by intersecting DfD_f and DgD_g (and, for the quotient, further removing zeros of gg) — never by reading it off the simplified formula.

The core idea

Let ff and gg be real-valued functions with domains DfD_f and DgD_g. The four combined functions are defined pointwise — you plug the same xx into both ff and gg, get two numbers, and combine those numbers exactly as you would combine any two real numbers:

(f+g)(x)=f(x)+g(x),(f−g)(x)=f(x)−g(x)(f+g)(x) = f(x) + g(x), \qquad (f-g)(x) = f(x) - g(x)
(fg)(x)=f(x)⋅g(x),(fg)(x)=f(x)g(x),g(x)≠0(fg)(x) = f(x)\cdot g(x), \qquad \left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}, \quad g(x) \neq 0

where: f(x)f(x) and g(x)g(x) are the values the two original functions take at the same input xx, and the right-hand side of each equation is an ordinary arithmetic operation on two real numbers. That is the entire "rule" half of the topic. The "domain" half is a separate question, and it is answered by set intersection, not algebra:

Domain(f±g)=Domain(fg)=Df∩Dg\text{Domain}(f\pm g) = \text{Domain}(fg) = D_f \cap D_g
Domain(fg)=(Df∩Dg)−{x:g(x)=0}\text{Domain}\left(\frac{f}{g}\right) = (D_f \cap D_g) - \{x : g(x) = 0\}

where: Df∩DgD_f \cap D_g is the set of inputs where both original functions are defined, and the quotient additionally strips out any input at which g(x)g(x) happens to equal zero, since division by zero is never allowed. A useful side case: for a real constant kk, (kf)(x)=k⋅f(x)(kf)(x) = k\cdot f(x) has exactly the same domain as ff, since multiplying by a constant never introduces a new restriction. Think of the construction as always happening in two separate stages that must not be blended together. Stage one is purely mechanical: substitute f(x)f(x) and g(x)g(x) into the arithmetic operation. Stage two is purely set-theoretic: ask "for which xx does this combination make sense at all," and answer that by intersecting domains (and, for a quotient, trimming zeros of the denominator) — never by simplifying the combined expression first and reading a domain off the simplified form. That single habit, kept separate and done first, prevents the most common mistake in the whole topic.

Figure
Number line showing the domain of f as all reals the domain of g as x greater than or equal to zero their overlap as the domain of f plus g and f times g and one point removed from that overlap for the domain of f over g
Building the domain of a combined function D_f = all reals D_g = x greater or equal to 0 D_f ∩ D_g = domain of f+g and fg domain of f over g (example g has a zero at x = 5) excluded, g = 0 here Each row narrows the previous one — intersection first, zero-removal only for the quotient
Derivation ADomain of a quotient survives algebraic cancellation

The goal of this derivation is to show, from the domain rule alone and without appeal to any diagram, that when a quotient of two functions is simplified by cancelling a common algebraic factor, an input that was excluded from the original domain must remain excluded from the domain of the simplified expression even though the simplified expression looks perfectly defined there — the excluded point is a fact about the function you started with, not about whichever algebraic form you happen to be looking at.

Step 1. Take f(x)=x+3f(x) = x + 3 with Df=RD_f = \mathbb{R} and g(x)=x2−9g(x) = x^2 - 9 with Dg=RD_g = \mathbb{R}, and form the quotient rule first, purely mechanically: (fg)(x)=x+3x2−9\left(\dfrac{f}{g}\right)(x) = \dfrac{x+3}{x^2-9}.

Step 2. Apply the domain rule for a quotient. First intersect: Df∩Dg=R∩R=RD_f \cap D_g = \mathbb{R} \cap \mathbb{R} = \mathbb{R}. Then remove the zeros of gg by solving x2−9=0x^2 - 9 = 0, which gives x2=9x^2 = 9, so x=3x = 3 or x=−3x = -3. The domain is therefore Domain=R−{−3,3}\text{Domain} = \mathbb{R} - \{-3, 3\}, fixed entirely by the original ff and gg, before any simplification has been attempted.

Step 3. Only now simplify the algebraic expression, factoring x2−9=(x−3)(x+3)x^2 - 9 = (x-3)(x+3): x+3x2−9=x+3(x−3)(x+3)=1x−3\dfrac{x+3}{x^2-9} = \dfrac{x+3}{(x-3)(x+3)} = \dfrac{1}{x-3}. This cancellation is only valid at points already inside the domain found in Step 2, i.e. for x≠−3,3x \neq -3, 3.

Step 4. Compare the two forms at x=−3x = -3. The simplified expression 1x−3\frac{1}{x-3} evaluates just fine there, to 1−6\frac{1}{-6}, and looks completely defined. But the original function x+3x2−9\frac{x+3}{x^2-9} was never defined at x=−3x=-3, because g(−3)=0g(-3) = 0 makes it a division by zero — the numerator's own zero at x=−3x=-3 only cancels the algebraic factor, it does not undo the fact that you divided by zero there. So x=−3x = -3 stays excluded regardless of what the cancelled formula suggests, and the domain from Step 2 is the final, correct answer.

Worked example

Problem. Let f(x)=x2−1f(x) = x^2 - 1 with domain R\mathbb{R}, and g(x)=xg(x) = \sqrt{x} with domain [0,∞)[0,\infty). Find (f+g)(x)(f+g)(x) and (fg)(x)(fg)(x) with their domains, then evaluate (f+g)(4)(f+g)(4) and (fg)(4)(fg)(4).

Step 1. Combine the rules by substitution: (f+g)(x)=f(x)+g(x)=x2−1+x(f+g)(x) = f(x) + g(x) = x^2 - 1 + \sqrt{x}, and (fg)(x)=f(x)⋅g(x)=(x2−1)x(fg)(x) = f(x)\cdot g(x) = (x^2-1)\sqrt{x}.

Step 2. Apply the domain rule Df∩DgD_f \cap D_g. Here Df=RD_f = \mathbb{R} and Dg=[0,∞)D_g = [0,\infty), so Df∩Dg=[0,∞)D_f \cap D_g = [0,\infty). Both f+gf+g and fgfg share this same domain — neither is a quotient, so there is no further zero-removal step.

Step 3. Evaluate (f+g)(4)(f+g)(4): (f+g)(4)=(42−1)+4=15+2=17(f+g)(4) = (4^2 - 1) + \sqrt{4} = 15 + 2 = \mathbf{17}.

Step 4. Evaluate (fg)(4)(fg)(4) the same pointwise way: (fg)(4)=(42−1)⋅4=15×2=30(fg)(4) = (4^2-1)\cdot\sqrt{4} = 15 \times 2 = \mathbf{30}. Both evaluations only needed f(4)f(4) and g(4)g(4) individually, computed first and then combined — the general symbolic rule for (f+g)(x)(f+g)(x) or (fg)(x)(fg)(x) is convenient when many evaluations are needed, but is never strictly required for a single numeric evaluation.

Common traps

  • Cancelling a common algebraic factor in a quotient and forgetting the original exclusion still applies, exactly as x=−3x = -3 stays excluded from x+3x2−9\frac{x+3}{x^2-9} even though the cancelled form 1x−3\frac{1}{x-3} looks fine there.
  • Taking the domain of f+gf+g or fgfg to be the union Df∪DgD_f \cup D_g instead of the intersection Df∩DgD_f \cap D_g — the combined function needs both f(x)f(x) and g(x)g(x) to exist, so it can only be defined where both individually are.
  • Forgetting the extra zero-removal step that applies only to a quotient f/gf/g, and mistakenly applying it to a sum, difference or product too.
  • Reading the domain off the simplified algebraic form of a combined function instead of computing it from the original, unsimplified ff and gg.

Ask the tutor: Try asking why Df∩DgD_f \cap D_g and not Df∪DgD_f \cup D_g makes sense by picking a specific xx that's in only one domain and checking whether (f+g)(x)(f+g)(x) could possibly be computed there.

Why does simplifying the quotient not change its domain?

Simplifying only rewrites the formula — it never changes which function you are describing. The domain is a property of the original ff and gg, fixed the moment they were defined, before you ever touch the algebra. In the worked derivation, x=−3x=-3 was excluded because g(−3)=0g(-3)=0 made the original quotient a division by zero; cancelling the shared factor (x+3)(x+3) removes that factor from the written expression, but it cannot retroactively make the original division valid. So you always compute the domain from the unsimplified rule first, then simplify separately if asked.

Do I always need to write out the general rule for f+g before evaluating it at a number?

No. To find (f+g)(a)(f+g)(a) for a specific number aa, it is usually fastest to compute f(a)f(a) and g(a)g(a) separately and then add the two numbers, exactly as in the worked example where (f+g)(4)=15+2=17(f+g)(4) = 15 + 2 = 17 needed no symbolic expression at all. Writing the general rule (f+g)(x)=f(x)+g(x)(f+g)(x) = f(x)+g(x) becomes genuinely useful only when you need several evaluations, or when the question explicitly asks for the rule itself.

Is composition, like f of g of x, part of this topic?

No, and this is a common source of confusion. Composition — building a new function f(g(x))f(g(x)) by feeding the output of gg into ff — along with inverse functions, belongs to Class XII, not Class XI. This ISC Class 11 topic covers only the four arithmetic combinations f+gf+g, f−gf-g, fgfg and f/gf/g and their domains. If a problem asks you to substitute one function's formula into another as its input, that is composition and is outside this syllabus point.

Before this

Where this leads