Real-valued functions can be added, subtracted, multiplied and divided , point by point , exactly like real numbers. This algebra of functions turns the set of real functions into something that almost behaves like the real number line, with one wrinkle: domains can shrink when you combine functions.
Definitions
Let f,g be real-valued functions with domains Df and Dg respectively, both contained in R. For each x in the common domain Df∩Dg:
Sum: (f+g)(x)=f(x)+g(x).
Difference: (f−g)(x)=f(x)−g(x).
Product: (fg)(x)=f(x)⋅g(x).
Scalar multiple: (cf)(x)=c⋅f(x), for any real c.
For the quotientgf, we additionally require g(x)=0:
(gf)(x)=g(x)f(x),x∈Df∩Dg,g(x)=0.
The domain of any combination is the intersection of the individual domains, minus any points where the operation fails (division by zero).
Why "common domain" matters
If f is defined only on [0,∞) (say f(x)=x) and g is defined only on (−∞,1] (say g(x)=1−x), then f+g is defined only where both are: on [0,1]. Outside [0,1], at least one of the two terms is not real, so the sum is meaningless.
This rule, simple as it is, is the single biggest source of careless mistakes in JEE problems. Always intersect domains.
Algebraic laws
For functions f,g,h on a common domain D:
Commutative: f+g=g+f, fg=gf.
Associative: (f+g)+h=f+(g+h), (fg)h=f(gh).
Distributive: f(g+h)=fg+fh.
Zero: the zero function 0(x)=0 satisfies f+0=f.
One: the constant 1 satisfies f⋅1=f.
These all follow because the operations are defined pointwise and real numbers obey the same laws.
Worked examples
Example 1. Let f(x)=x2+1 and g(x)=2x−3. Find (f+g)(x),(f−g)(x),(fg)(x),(f/g)(x) and state domains.
Df=Dg=R.
(f+g)(x)=x2+2x−2, domain R.
(f−g)(x)=x2−2x+4, domain R.
(fg)(x)=(x2+1)(2x−3)=2x3−3x2+2x−3, domain R.
(f/g)(x)=2x−3x2+1, domain R∖{3/2}.
Example 2. Let f(x)=x and g(x)=1−x. Find the domain of (f+g) and (fg).
Df=[0,∞), Dg=(−∞,1]. Common domain Df∩Dg=[0,1], which is the domain of both f+g and fg.
Example 3. Find (fg)(x) and the domain of f/g, where f(x)=x2−4 and g(x)=x−2.
(fg)(x)=(x2−4)(x−2)=(x−2)2(x+2).
(f/g)(x)=x−2x2−4=x+2 for x=2. Even though the simplified expression is x+2, the quotient's domain is R∖{2}.
Example 4. Let f(x)=x+1,g(x)=2x+3. Find a function h such that h+f=g.
h(x)=g(x)−f(x)=2x+3−x−1=x+2.
Example 5 (harder). Let f(x)=x−11 and g(x)=x+11. Find (f+g)(x) and state the domain.
The simplified expression x2−12x has domain R∖{−1,1} , matching what we computed.
Try it yourself
If f(x)=x2 and g(x)=x+1, find (f+g)(x),(f−g)(x),(fg)(x),(f/g)(x), and state the domains.
If f(x)=x−1 and g(x)=4−x, find the domains of f+g and f/g.
If f(x)=x3 and g(x)=x2, simplify f/g and state its domain.
If f(x)=∣x∣ and g(x)=x−2, find (fg)(x) at x=−1,0,1,3.
Show that if f is even and g is even, then f+g,fg are even.
Show that if f is odd and g is odd, then fg is even.
If f(x)=2x+1, find f⋅f and f+f. Are they equal? Why not?
Let f(x)=x1. Find the domain of f+f and of f⋅f.
If f(x)=cosx, g(x)=sinx, what familiar function is f2+g2?
If f(x)=x2+1, find a function g such that fg(x)=x4−1.
If f(x)=x+2 and (f+g)(x)=3x+1, find g(x).
Find a function f with f(x)+f(−x)=2x2 for all x.
Pitfalls / Tricks
After simplifying a quotient, the domain may not extend. x−2x2−4 simplifies to x+2, but the domain of the quotient is still R∖{2}. Functions are equal only when their domains are equal.
(f/g) requires g(x)=0 , never forget.
Adding two functions does not always give a function on the union of domains. Use the intersection.
Insight. The algebra of functions makes the set of real functions a ring (you will meet this word in higher courses). Already in Class XI, recognising that sin2x+cos2x=1 is a statement about functions , not just numbers , is a small but important step.