Problem: If m,n,p and q are real numbers and f(x)=mx+n and g(x)=px+q, then the equation f(g(x))=g(f(x)) has a solution
Answer Choices:
A. for all choices of m,n,p and q
B. if and only if m=p and n=q
C. if and only if mq−np=0
D. if and only if n(1−p)−q(1−m)=0
E. if and only if (1−n)(1−p)−(1−q)(1−m)=0
Solution:
For any real number x, the following equations are equivalent:
f(g(x))m(px+q)+nmpx+mq+nn(1−p)​=g(f(x))=p(mx+n)+q=mpx+np+q=q(1−m)​