Question 148879
Note that {{{x^3 = x^2*x}}}.
From the original expression:

The expressions {{{x^3}}} and {{{3*x^2}}} have a term {{{x^2}}} which can be factored out.  The expressions {{{a*x}}} and {{{3*a}}} have a term {{{a}}} which can be factored out.

So we have:
{{{x^2*x + a*x + a*3 + x^2*3}}} =
{{{x^2*x + x^2*3 + a*x + a*3}}} =
{{{x^2*(x+3) + a*(x+3)}}} =
{{{(x^2 + a) * (x + 3)}}} (answer)