When actually $f(g(x))=g(f(x))$ holds?

4.6k Views Asked by At

We can see that if $f(x)=g(x)=x$ then $f(g(x))=g(f(x))$.
I would like to see other examples of functions $f(x)$ and $g(x)$ such that $f(g(x))=g(f(x))$.

P.S. By definition we also must have $D_{f\circ g}= D_{g\circ f}$

5

There are 5 best solutions below

3
On

Take $f(x)=x+1$ and $g(x)=x-1$

$$f(g(x))=g(x)+1\\ =(x-1)+1\\ =x\\ \text{ and }\\ g(f(x))=f(x)-1\\ (x+1)-1\\ =x$$

2
On

I think if you take two inverse functions, defined over e.g. $\Bbb R$ (or over the same subset of $\Bbb R$),
then you trivially get the desired property, because $x = f(g(x)) = g(f(x))$.

Here is an example where the two functions are not inverse.

$f(x) = x^n$

$g(x) = x^m$

where $n$ and $m$ are e.g. integers

Also:

$f(x) = a \cdot x$

$g(x) = b \cdot x$

where $a$ and $b$ are e.g. reals

0
On

Functions need not be inverses of each other to commute. A simple example. Let $f(x)=x+1$ and $g(x)=x+2$. Here, of course $$f(g(x))=g(f(x))=x+3.$$

1
On

I'm not sure there's much to say.

There's $g= f^{-1}$ so $f (g (x)) = x $

Then there's $f = g $ so $f (g (x))e f (f (x)) $

Then there's $f (g (x)) = g (f (x)) = h (x)$ so $g (x) = f^{-1}(g(f (x))) = f^{-1}(h (x)) $ and/or $f (x)=g^{-1}(h (x))$.

As long as we can find invertible functions we can find these. Is there anything more that needs to be said?

2
On

Here is a family of examples: let $h$ be any function from a set to itself, and $n,m$ any positive integers. Then $f(x)=h^m(x),g(x)=h^n(x)$ (here superscripts denote functional power, so for example $h^3(x)=h(h(h(x)))$). Then clearly $f(g(x))=h^{m+n}(x)=g(f(x))$.