When Does Function Composition Commute? [Duplicate]

When Does Function Composition Commute? [Duplicate]
$\begingroup$

I've read that function composition "generally does not commute."

Not counting compositions involving the identity function, and compositions of a function and its inverse, are there examples of functions on the reals (for example) $f, g$ where $fg = gf$ outside of these cases?

$\endgroup$
1

2 Answers

$\begingroup$

There are plenty of examples:

$$ f(x) = x + 3,\ g(x) = x + 5: fg(x) = gf(x) = x + 8 $$ $$ f(x) = 5x,\ g(x) = 2x: fg(x) = gf(x) = 10x $$ $$ f(x) = x^4,\ g(x) = x^7: fg(x) = gf(x) = x^{28} $$

A common thread among these is that they involve commutative operations.

$\endgroup$
$\begingroup$

Take $f(x) = x^{2}$ and $g(x) = x^{3}$. Then $f(g(x)) = g(f(x)) = x^{6}$. So, $f$ and $g$ commute

$\endgroup$
2
David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.