Given $f(x)$ and $g(x)$, find $(fg)(x)$

I've attempted to solve the problem below, and here is what I got for a solution:

Given $f(x)=x^2-9$ and $g(x)=x^2+3x-1$, find $(fg)(x).$

\begin{align} (fg)(x)&=(x^2-9)(x^2+3x-1)\\ &=x^4+3x^3-x^2-9x^2-27x+9\\ &=x^4+3x^3-10x^2-27x+9 \end{align}

Have I done this correctly?

I am wondering if I should have factored $(x^2-9)$ before multiplying, but I'm not sure if it would have made a difference.

• You are correct! – Ahaan S. Rungta Dec 17 '14 at 15:05
• Converting to LaTeX... – FundThmCalculus Dec 17 '14 at 15:07
• Thanks for the edit @FundThmCalculus . I'm still not super confident with LaTeX. – McB Dec 17 '14 at 15:08
• @McB, not a problem. Once one of the higher-ranked people reviews the edit, it will appear. :) EDIT: Approved! :) – FundThmCalculus Dec 17 '14 at 15:09
• Sometimes notation $fg$ is used as an abbreviation for composition. Then $(fg)(x):=f(g(x))$. I hope that this is not the case here. – drhab Dec 17 '14 at 15:12

You are correct. If I know what you are saying, you are right that it wouldn't matter. The factored form is $(x+3)(x-3)(x^2+3x-1)$.