Using Pascal's triangle:
So for reference type #(p+q)^9# we have:
#p^9 color(magenta)(+9p^8q)+36p^7q^2+84p^6q^3+126p^5q^4+126p^4q^5+84p^3q^6+36p^2q^7+9pq^8+q^9#
,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The coefficients as shown in Pascal's triangle are derived by the binomial expansion:
Note that: #""_""^nC_r-> (n!)/((n-r)!r!) #
#""_""^9C_0p^9q^0color(magenta)(+""_""^9C_1p^8q^1)+""_""^9C_2p^7q^2+....+""_""^9C_9p^0q^9 #
Thus for example: #color(magenta)(""_""^9C_1p^8q^1) -> (9 !)/((9-1)!1! )p^8q^1#
However, #p=2x" and "q=-y# giving
#(n !)/((n-1)!1! )p^8q^1 " "->color(magenta)(" "(9xx cancel(8!))/(cancel(8!))(2x)^8(-y))#
# = (9xx 256)x^8(-y) =color(magenta)( -2304x^8y)#
#color(green)("I will let you fill in all the numbers. Good luck! A lot of work!")#
Using software I get the final solution of:
#512x^9-2304x^8y+4608x^7y^2-5376x^6y^3+4032x^5y^4-2016x^4y^5+672x^3y^6-144x^2y^7+18xy^8-y^9#