【Analysis】Obviously, when x1=x2=⋯=xn=0, inequality (1) always holds.
If xi(i=1,2,⋯,n) are not all 0, by homogeneity, we can assume ∑i=1nxi=1.
When n=2, x1+x2=1,
the left side of equation (1)
=x1x2(x12+x22)=x1x2(1−2x1x2)=21×2x1x2(1−2x1x2)⩽81,
with equality holding if and only if x1=x2=21.
When n⩾3, assume x1+x2<43, and let x3, x4,⋯,xn be fixed.
Let x1+x2=a.
Then the left side of equation (1)
=∑i=1n(xi3∑j=ixj+xi∑j=ixj3). Let A=x13(1−x1)+x23(1−x2)=(x1+x2)[(x1+x2)2−3x1x2]−[(x1+x2)2−2x1x2]2−2x12x22.
Let x1x2=t. Then
A=a(a2−3t)−(a2−2t)2−2t2=−2t2+(4a2−3a)t−a4.
Since a<43, the axis of symmetry is less than 0, and the parabola opens downwards.
Thus, when x1x2=0, it has the maximum value. Without loss of generality, assume x1=0, at this point, the problem is reduced to an (n−1)-variable problem, and so on, it is reduced to a two-variable problem. Therefore, it is known that the equality in inequality (1) holds if and only if two of the variables are equal and the rest are 0.