a) \(\left(x+2\right)\left(x^2-2x+4\right)-x\left(x+1\right)^2=15\)
\(\left(x+2\right)\left(x^2-2x+4\right)-x\left(x^2+2x+1\right)=15\)
\(x^3-2x^2+4x+2x^2-4x+8-x^3-2x^2-x=15\)
\(8-2x^2-x=15\)
\(2x^2+x=-7\)
b) \(\left(x-1\right)\left(x-5\right)=6\)
\(x^2-5x-x+5=6\)
\(x^2-4x=1\)
\(\left(x-2\right)^2=5\)