Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose $p(x)=x^2+5x+3$ and $q(x)=3x^3-3x+7$. Write the expression $(q \circ p)(x)$ as a sum of terms, each which is a constant times the power of $x$.

Here is my work for the problem:
$(q\circ p)(x)=3(x^2+5x+3)^3-3(x^2+5x+3)+7$
$(q\circ p)(x)=3(x^6+125x^3+27)-3x^2-15x-9+7$
$(q\circ p)(x)=3x^6+375x^3+81-3x^2-15x-2$
$(q\circ p)(x)=3x^6+375x^3-3x^2-15x+79$

Did I do something wrong while working with this problem? The final answer I got wasn't in the multiple choice answers. I went over this problem 3 times and cannot find what I am doing wrong.

share|cite|improve this question
Your understanding of composition is fine; it’s just your algebra that went astray. See @Jasper’s answer. – Brian M. Scott Sep 27 '12 at 20:42
up vote 7 down vote accepted

The mistake you made is assuming that $(a+b+c)^3=a^3+b^3+c^3$. Note that $(a+b+c)(a+b+c)=a^2+ab+ac+ba+b^2+bc+ca+cb+c^2$. Simplify and multiply by $a+b+c$ again to get the cube. Alternatively you can rewrite $q(x)=3x(x^2-1)+7$ and work from there.

share|cite|improve this answer
Is there a shortcut to multiply this out? I did $(a+b+c)^2$ first then multiplied that by $(a+b+c)$ again. It was very long and messy. – Kot Sep 27 '12 at 20:45
@Steven This is a common (and very important) fallacy to overcome! Powers do not "distribute" over + or -... try to unlearn this misconception! – rschwieb Sep 27 '12 at 20:45

As Jasper noted you did wrong here: $$...=3(x^2+5x+3)^3...$$ $$...=3(x^6+125x^3+27)-...$$ In fact $$(a+b+c)^3=a^3 + 3a^2b + 3a^2c + 3ab^2 + 6abc + 3ac^2 + b^3 + 3b^2c + 3bc^2 + c^3$$ we have $q(p(x))=3x^6+45x^5+252x^4+645x^3+753x^2+390x+79$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.