Ta có: \(P=\left(a+1\right)^2+\left(b+1\right)^2+\left(c+1\right)^2+2\left(ab+bc+ca\right)\)
\(=a^2+2a+1+b^2+2b+1+c^2+2c+1+2\left(ab+bc+ca\right)\)
\(=\left(a^2+b^2+c^2\right)+2\left(a+b+c\right)+3+2\left(ab+bc+ca\right)\) (1)
Lại có: \(Q=\left(a+b+c+1\right)^2\)
\(=\left[\left(a+b+c\right)+1\right]^2\)
\(=\left(a+b+c\right)^2+2\left(a+b+c\right)+1\)
\(=\left[\left(a+b\right)+c\right]^2+2\left(a+b+c\right)+1\)
\(=\left(a+b\right)^2+2\left(a+b\right)c+c^2+2\left(a+b+c\right)+1\)
\(=a^2+2ab+b^2+2ac+2bc+c^2+2\left(a+b+c\right)+1\)
\(=\left(a^2+b^2+c^2\right)+2\left(ab+bc+ca\right)+2\left(a+b+c\right)+1\) (2)
Từ (1) và (2) suy ra:
\(P-Q=2\)