# Determine conditions on $a$ and $b$ such that $f \circ g$ = $g \circ f$.

I have this problem:

Let $f$ and $g$ be the following straight line functions: $f(x) = ax + b$, $g(x) = cx + d$. Determine conditions on $a$ and $b$ such that $f \circ g$ = $g \circ f$.

This is what I got:

$$ad-d=cb-b$$

and then

$$a(d - d/a) = b(c-1)$$

Is it correct?

Thank you

• Yep that's correct! – Cameron Williams Sep 27 '15 at 16:48
• $a(cx+d)+b=c(ax+b)+d\Rightarrow acx+ad+b=acx+cb+d\Rightarrow d(a-1)=b(c-1)$ thus if $a\neq 0$ you are right. – R.N Sep 27 '15 at 16:50

## 1 Answer

Your condition very nearly works perfectly, but it doesn't work if $a=0.$ Instead of factoring out $a,$ you should factor out $d,$ giving you $$d(a-1)=b(c-1).$$