[tex]a) (x+1)^2-(x+1)-2=\\
Not\breve{a}m\ x+1=t\\
t^2-t-2=t^2-2t+t-2=t(t-2)+(t-2)=(t-2)(t+1)\\
\hat{I}nlocuind: (x+1-2)(x+1+2)=\boxed{(x-1)(x+3)}\\
\\
b)3(x+1)^2+5(x+1)+2=\\
Se\ face\ la\ fel\ ca\ a).\\
3t^2+5t+2=3t^2+3t+2t+2=3t(t+1)+2(t+1)=\\
=(t+1)(3t+2)\\
\hat{I}nlocuind:(x+1+1)[3(x+1)+2]=\boxed{(x+2)(3x+5)}\\
\\
c)(x^2+3x+1)^2-1=(x^2+3x+1-1)(x^2+3x+1+1)=\\
(x^2+3x)(x^2+3x+2)=x(x+3)(x^2+2x+x+2)=\\
x(x+3)[x(x+2)+(x+2)]=\boxed{x(x+1)(x+2)(x+3)}\\
[/tex]
[tex]d)(x^2+x+1)(x^2+x-3)+3=\\
Notam: x^2+x=t\\
(t+1)(t-3)+3=t^2-3t+t-3+3=t^2-2t=t(t-2)\\
\hat{I}nlocuind: (x^2+x)(x^2+x-2)=x(x+1)(x^2+2x-x-2)=\\
=x(x+1)[x(x+2)-(x+2)]=\boxed{x(x+1)(x-1)(x+2)}[/tex]