Find fog and gof when f(x) = 2x+1 and g(x) = x²

easy CBSE JEE-MAIN 3 min read

Question

If f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^2, find: (a) fog(x)fog(x) — also written as fg(x)f \circ g(x) or f(g(x))f(g(x)) (b) gof(x)gof(x) — also written as gf(x)g \circ f(x) or g(f(x))g(f(x))

Also verify whether fog=goffog = gof.

Solution — Step by Step

fog(x)fog(x) means: first apply gg, then apply ff to the result. The notation reads right-to-left: in fgf \circ g, gg acts first.

gof(x)gof(x) means: first apply ff, then apply gg to the result. In gfg \circ f, ff acts first.

A useful way to remember: fog(x)=f(g(x))fog(x) = f(g(x)) — substitute g(x)g(x) wherever you see xx in ff.

Start with g(x)=x2g(x) = x^2. Now substitute this into ff:

fog(x)=f(g(x))=f(x2)fog(x) = f(g(x)) = f(x^2)

Replace xx with x2x^2 in f(x)=2x+1f(x) = 2x + 1:

fog(x)=2(x2)+1=2x2+1fog(x) = 2(x^2) + 1 = \mathbf{2x^2 + 1}

Start with f(x)=2x+1f(x) = 2x + 1. Now substitute this into gg:

gof(x)=g(f(x))=g(2x+1)gof(x) = g(f(x)) = g(2x + 1)

Replace xx with (2x+1)(2x + 1) in g(x)=x2g(x) = x^2:

gof(x)=(2x+1)2=4x2+4x+1=4x2+4x+1gof(x) = (2x + 1)^2 = 4x^2 + 4x + 1 = \mathbf{4x^2 + 4x + 1}

fog(x)=2x2+1fog(x) = 2x^2 + 1 and gof(x)=4x2+4x+1gof(x) = 4x^2 + 4x + 1.

These are clearly different expressions, so foggoffog \neq gof.

This confirms that function composition is generally not commutative.

Why This Works

Function composition is essentially substitution — you’re plugging one function’s output as the other function’s input. The order matters because the transformations are different: fogfog first squares xx then applies the linear transformation; gofgof first applies the linear transformation then squares.

Think of it as two machines in a factory. fogfog: raw material → Machine G (squaring) → Machine F (double and add 1). gofgof: raw material → Machine F first → Machine G. Different orders produce different products.

Alternative Method

Verify with a specific value. Let x=2x = 2:

fog(2)=f(g(2))=f(4)=2(4)+1=9fog(2) = f(g(2)) = f(4) = 2(4) + 1 = 9. Check: 2(2)2+1=92(2)^2 + 1 = 9

gof(2)=g(f(2))=g(5)=25gof(2) = g(f(2)) = g(5) = 25. Check: 4(4)+4(2)+1=16+8+1=254(4) + 4(2) + 1 = 16 + 8 + 1 = 25

Substituting a specific value is a quick way to verify your algebra for composition problems.

For CBSE Class 12 and JEE, always write out the full substitution step clearly. In exams, the marks are awarded for showing f(g(x))=f(expression for g(x))f(g(x)) = f(\text{expression for } g(x)) and then simplifying — not just writing the final answer.

Common Mistake

The most frequent error is reversing the order: students compute fogfog but actually perform gofgof. Remember: fog=f(g(x))fog = f(g(x)) — in this notation, ”gg is inside ff,” meaning gg goes first. If you’re unsure, always expand: fog(x)=f(g(x))fog(x) = f(g(x)), and now it’s clear — evaluate gg first, then put the result into ff.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next