Đặt \(A=\left(x+1\right)^3+6\left(x+1\right)^2+12x+20\)
\(=\left(x+1\right)^3+6\left(x+1\right)^2+12x+12+8\)
\(=\left(x+1\right)^3+3\cdot\left(x+1\right)^2\cdot2+3\left(x+1\right)\cdot2^2+2^3\)
\(=\left(x+1+2\right)^3=\left(x+3\right)^3\)
Khi x=5 thì \(A=\left(5+3\right)^3=8^3=512\)