<s>[INST] Two factoring problems that I can't figure out I have two problems I can't seem to factor.


*

*$8a^3+27b^3+2a+3b$


I first tried it by grouping. I grouped the first two terms together and used sum of two cubes to get
$$(2a+3b)(4a^2-6ab+9b^2)$$ and then I added the leftover $2a+3b$ to get:
$$(2a+3b)(4a^2-6ab+9b^2) + 2a+3b$$
But the answer is $(2a+3b)(4a^2-6ab+9b^2 + 1)$ and I'm not quite sure how you got the $+1$ from the $2a+3b$.


*$x^3+3x^2+3x+1$


The answer is $(x+1)^3$ but I don't know how to get there. I tried factoring by grouping, but that wasn't right, and I'm stuck as to how to solve it.
Thanks!
 [/INST] .For the first question, you were very close to the answer. In fact, when you write $(2a+3b)(4a^2+9b^2-6ab) + 2a+3b$, all you need to notice is that the $2a+3b$ at the end can also be taken into the bracket, using the distributive law:
$$
(2a+3b)(4a^2+9b^2-6ab) + 2a+3b = (2a+3b)(4a^2+9b^2-6ab) + 1(2a+3b) \\ = (2a+3b)(4a^2+9b^2-6ab + 1)
$$
Using $xy+ xz = x(y+z)$, where $x=2a+3b, y = 4a^2+9b^2-6ab,z=1$.
Hence the answer follows.
For the second one, yes it is tricky, but here is the catch,  or rather a heuristic in these kind of problems:

Suppose you are asked to factorize some complicated cubic, say $x^3+ax^2+bx+c$, or any other complicated expression. Then, most likely, the roots are integers, which are factors of the constant in the expression.

For example, here $x^3+3x^2+3x+1$ is given, and the constant is $1$. Hence, the roots, if they are integers, are all factors of $1$. Then, they can only be $-1$ or $1$. You can use the remainder theorem to check which of these is a factor, by substituting $-1$ and $1$ in the expression and checking when the value is zero. Turns out for $-1$ that the expression is $0$, so $(x-(-1)) = (x+1)$ is a factor of your expression. Then, go on and divide by $1$, you will get $x^2+2x+1$, which is $(x+1)^2$. So collecting everything, we have $x^3+3x^2+3x+1=(x+1)^3$.
It's good to do one more example. Suppose someone asks you to factor $x^3-x^2-4x+4$. Using the heuristic, you know that the roots must divide $4$. Hence, the roots can only be $\pm 1,\pm 2,\pm4$. Use remainder theorem, and check that substituting $1$ gives $0$. Hence $x-1$ is a factor, and on dividing you get $x^2-4$, which is $(x-2)(x+2)$. Hence the complete answer is $(x-1)(x+2)(x-2)$.
</s>