\(\eqalign{
& a)\;{x^3} + 3{x^2} + 3x + 1 \cr
& = {x^3} + 3{x^2}.1 + 3x{.1^2} + {1^3} \cr
& = {\left( {x + 1} \right)^3} \cr} \)
\(\eqalign{
&b)\; {\left( {x + y} \right)^2} - 9{x^2} = {\left( {x + y} \right)^2} - {\left( {3x} \right)^2} \cr
& = \left( {x + y + 3x} \right)\left( {x + y - 3x} \right) \cr
& = \left( {4x + y} \right)\left( { - 2x + y} \right) \cr} \)