Learn the rule:
The square of the sum of any number of terms =
The sum of all the squares of the terms +
The sum of TWICE THE PRODUCT of every possible pair of terms.
When there are three terms:
So your problem is:
=
=
There are only two like terms to combine, and
It is customary to arrange the terms is descending order
of powers of one of the letters, usually the one that
comes first in the alphabet. Here it is arranged in
descending order of powers of x:
Edwin