Factor $(x+y)^7-(x^7+y^7)$ I encountered the following problem while preparing for upcoming math contests.  

Factor $(x+y)^7-(x^7+y^7)$.

I got zero for $(x+y)^7-(x^7+y^7)$, however, the solutions said it's 
$$7xy(x+y)(x^2+xy+y^2)(x^2+xy+y^2)$$
Can someone explain how this is possible?
 A: Be careful: if you obtained $0$, did you equate $$(x+y)^7 \text{ with }(x^7+y^7)?$$
That's a careless oversight of distributing the exponent over a sum (and is not valid). As a general rule (barring cases like $n = 1)$,  $$(x + y)^n \neq x^n + y^n$$
Use the binomial theorem to easily expand $(x + y)^7$, 
$$(x+y)^n = {n \choose 0}x^n y^0 + {n \choose 1}x^{n-1}y^1 + {n \choose 2}x^{n-2}y^2 + \cdots + {n \choose n-1}x^1 y^{n-1} + {n \choose n}x^0 y^n,$$ then factor. No quick way around that.
Recall Pascal's Triangle (image from Wikipedia) for recalling the coefficients of the expansion of a binomial:

The bottom row gives the coefficients in the expansion of $(x + y)^7$.
A: Expand $(x+y)^7$, you would get:
\begin{align*}
(x+y)^7-(x^7+y^7)&=x^7+7x^6y+21x^5y^2+35x^4y^3+35x^3y^4+21x^2y^5+7xy^6+y^7-x^7-y^7
\\ &=7x^6y+21x^5y^2+35x^4y^3+35x^3y^4+21x^2y^5+7xy^6
\\ &=7xy(x^5+3x^4y+5x^3y^2+5x^2y^3+3xy^4+y^5)
\\ &=7xy(x+y)(x^4+2x^3y+3x^2y^2+2x^3+y^4)
\\ &=7xy(x+y)(x^2+xy+y^2)^2,\text{which is your given answer.}
\end{align*}
A: ( Motivation for this (late) answer is to demistify the derivation of the square factor, and show that it reduces to the routine factorization of an associated quadratic. )
Using that $\,x^7 + 1 = (x+1)(x^6 - x^5 + x^4 - x^3 + x^2 - x + 1)\,$:
$$
(x+1)^7 - x^7 - 1 = (x+1)\left((x+1)^6 - x^6 + x^5 - x^4 + x^3 - x^2 + x - 1\right) \tag{1}
$$
The second factor is a palindromic polynomial, which suggests the substitution $\,u = x + \dfrac{1}{x}\,$. Then $\,x^2 + \dfrac{1}{x^2} = u^2 - 2\,$, $\,x^3 + \dfrac{1}{x^3} = u^3 - 3u\,$, and:
$$
\begin{align}
& (x+1)^6 - x^6 + x^5 - x^4 + x^3 - x^2 + x - 1
\\ =\; &(x^2 + 2x + 1)^3 - x^6 + x^5 - x^4 + x^3 - x^2 + x - 1
\\ =\; &x^3\left(\left(x+\frac{1}{x}+2\right)^3 - \left(x^3 + \frac{1}{x^3} \right)+\left(x^2 + \frac{1}{x^2}\right)-\left(x + \frac{1}{x}\right)+1\right)
\\ =\; &x^3 \left((u+2)^3 - (u^3 - 3u) + (u^2 - 2) - u + 1\right)
\\ =\; &x^3 \left(7 u^2 + 14 u + 7\right)
\\ =\; &7x^3(u+1)^2
\\ =\; &7x(ux+x)^2
\\ =\; &7x(x^2 + x + 1)^2 \tag{2}
\end{align}
$$
Piecing together $\,(1)\,$ and $\,(2)\,$:
$$
(x+1)^7 - x^7 - 1 = 7x (x+1) \left(x^2+x+1\right)^2
$$
Substituting $\,x \mapsto \dfrac{x}{y}\,$ and multiplying by $\,y^7\,$ gives the identity in OP's question.
A: If you're really asking how it's possible you can always expand both sides and compare the coefficients...
If you're asking how to come up with it, observe that one of the solutions of 
$$
(x+y)^7-(x^7+y^7) = 0
$$
is
$$
x+y=0
$$
hence, $(x+y)^7-(x^7+y^7)$ must be divisible by $(x+y)$. 
A: Users have approached the problem using the Binomial Theorem, namely,

$$(a+b)^n=\sum_{k=0}^n\binom nka^{n-k}b^k,\tag1$$

such that the formula for a binomial coefficient is expressed thus: $$\dbinom nk\stackrel{\small\text{def}}{=}\frac{n!}{k!(n-k)!}.\tag{$n!=1\times 2\times 3\times\cdots\times n$}$$ It follows, then, that by substituting $(a,b,n)=(x,y,7)$ respectively, the answer is as follows: $$\begin{align}(x+y)^7&=x^7+7x^6y+21x^5y^2+35x^4y^3+35x^3y^4+21x^2y^5+7xy^6+y^7 \\ &= x^7+y^7+7(x^6y+xy^6)+21(x^5y^2+x^2y^5)+35(x^4y^3+x^3y^4) \\ &=x^7+y^7+7\big(x^6y+xy^6+3(x^5y^2+x^2y^5)+5(x^4y^3+x^3y^4)\big) \\ &=x^7+y^7+7xy\big(x^5+y^5+3xy(x^4+y^4)+5xy(x^3+y^3)\big),\end{align}$$ to which we can then factor $-$ but there is a better way!

Of course now, $(x+y)^7-(x^7+y^7)$ is a multiple of $x+y$. Let $x^7+y^7=x^7-(-y)^7$, then you can use the following formula from my answer to this post in order to factor the equation:

$$a^n-b^n=(a-b)\sum_{k=1}^na^{n-k}b^{k-1}.\tag2$$

It follows, then, that $$(x+y)^7-(x^7+y^7)=(x+y)\bigg((x+y)^6-\sum_{k=1}^7x^{n-k}y^{k-1}\bigg).$$ The following step requires you to use the binomial theorem for the algebraic expression $(x+y)^6$, which is much easier than calculating for $(x+y)^7$ by hand.
A: A more compact display : If $σ_n = x^n + y^n$ and $P = xy$, then from 7-th power binomial expansion we get $$σ_1^7 = σ_7 + 7P(σ_5 + 3σ_3P + 5σ_1P^2)$$ and since $σ_1 | σ_n$for odd $n$, viz., $σ_3 = σ_1(σ_2 - P)$;$σ_5 = σ_3σ_2 - σ_1P^2 = σ_1\left(σ_2^2 - P(σ_2 + P)\right),$ $$σ_1^7 = σ_7 + 7σ_1P\left[σ_2^2 \overbrace{-\ P(σ_2 + P)} + \ 3P(σ_2 - P) + 5P^2\right]$$ $$= σ_7 + 7σ_1P\left[(σ_2 + P)(σ_2 + 2P) \overbrace{-\ P(σ_2 + P)}\right]$$ $$= σ_7 + 7σ_1P(σ_2 + P)^2,$$i.e., $$σ_1^7 - σ_7 = 7σ_1P(σ_2 + P)^2,$$ or more explicitly, $$(x + y)^7 - (x^7 + y^7) = 7xy(x + y)(x^2 + xy + y^2)^2.$$
A: Another approach:  there is a general factoring pattern for a sum of $n$th powers that works only when $n$ is odd.  Specifically, in the case $n=7$ we have
$$x^7 + y^7 = (x+y)(x^6-x^5y+x^4y^2-x^3y^3+x^2y^4-xy^5+y^6)$$
Since both $(x+y)^7$ and $x^7 + y^7$ contain $(x+y)$ as a factor, we can write
$$(x+y)^7 - (x^7+y^7)= (x+y)\left((x+y)^6 - (x^6-x^5y+x^4y^2-x^3y^3+x^2y^4-xy^5+y^6)\right)$$
Now we can also expand $(x+y)^6$ using the binomial theorem:
$$(x+y)^6 = x^6 + 6x^5y + 15x^4y^2+20x^3y^3+15x^2y^4+6xy^5+y^6$$
Plugging this into the equation directly above it, and combining like terms, we have
$$(x+y)^7 - (x^7+y^7)= (x+y)\left((x^6 + 6x^5y + 15x^4y^2+20x^3y^3+15x^2y^4+6xy^5+y^6) - (x^6-x^5y+x^4y^2-x^3y^3+x^2y^4-xy^5+y^6)\right) = (x+y)\left( 7x^5y + 14x^4y^2+21x^3y^3+14x^2y^4+7xy^5 \right)$$
Now in the second parenthesis, each term is a multiple of $7xy$, so factor that out too:
$$(x+y)^7 - (x^7+y^7)= (x+y)(7xy)\left(x^4 + 2x^3y+3x^2y^2+2xy^3+y^4 \right)$$
The last step is to factor $x^4 + 2x^3y+3x^2y^2+2xy^3+y^4 $.  This is maybe the trickiest part, as you have to somehow either recognize the factoring pattern
$$x^4 + 2x^3y+3x^2y^2+2xy^3+y^4 = (x^2 + xy + y^2)^2$$
which can be confirmed by expanding the right-hand side; if you didn't know this pattern already, I'm not sure how one could discover it other than by trial and error.
Anyway, now you can put it all together:
$$(x+y)^7 - (x^7+y^7)= (x+y)(7xy) (x^2 + xy + y^2)^2 $$
and you're done.
A: Another approach would be to note that the function $ \ z \ =  \ (x+y)^7-(x^7+y^7) \ $ has an "exchange symmetry" between its variables $ \ x \ $ and $ \ y \ \ , $ which makes the function symmetric about the plane $ \ y \ = \ x \ \ . $  So its (bivariate) polynomial expression will have factors with this type of symmetry, such as $ \ x + y \ $ and $ \ xy \ \ . $
The Freshman's Dream notwithstanding, the binomial expansion applied to the expression will produce terms of the form $ \ C·x^m·y^n \ $ where $ \ m + n \ = \ 7 \ $ and with all of the binomial coefficients $ \  \frac{7!}{m!n!} \ \ , $ $ m \ \neq \ 0 \ , \ 7 \ \ , \  $  being divisible by $ \ 7 \ $ since that is prime.  So we can immediately see a factoring
$$ 7x^6y \ + \ 21x^5y^2 \ + \ 35x^4y^3 \ + \ 35x^3y^4 \ + \ 21x^2y^5 \ + \ 7xy^6 $$ $$ = \ \ 7 \ · \ xy \ · \ ( \ x^5 \ + \ 3x^4y \ + \ 5x^3y^2 \ + \ 5x^2y^3 \ + \ 3xy^4 \ + \ y^5 \ ) \ \ . $$
The "interchangeability" of the variables also permits us to see that $ \ ( x + y ) \ $ may be a factor:
$$  x^5 \ + \ 3x^4y \ + \ 5x^3y^2 \ + \ 5x^2y^3 \ + \ 3xy^4 \ + \ y^5 $$
$$ = \ \ x \ · \ ( \ x^4 \ + \ a·x^3y \ + \ b·x^2y^2 \ + \ axy^3 \ + \ y^4 \ ) $$ $$ \ + \ ( \ x^4 \ + \ a·x^3y \ + \ b·x^2y^2 \ + \ axy^3 \ + \ y^4 \ ) \ · \ y  \ \ . $$
Comparison of the coefficients requires that $ \ a + 1 \ = \ 3 \ $ and $ \ a + b \ = \ 5 \ \ , $ which can be solved consistently.  We then arrive at
$$ 7 \ · \ xy \ · \ (x + y) \ · \ ( \ x^4 \ + \ 2x^3y \ + \ 3x^2y^2 \ + \ 2xy^3 \  + \ y^4 \ ) \ \ . $$
The next most simple factor of suitable symmetry would be $ \ x^2 + y^2 \ \ ; $ no higher powers of $ \ (xy)^k \ $ can be "extracted".  Since there are terms in this remaining polynomial factor which have odd powers of $ \ x \ $ or $ \ y \ \ , $ however, this is a bit too simple.  We can instead next try factors of the form $   \ x^2 + cxy + y^2 \ \ . \ $  Although the symmetrical ("palindromic") arrangement of the coefficients strongly hints at what will happen, we will naïvely use two "distinct" factors to write
$$ x^4 \ + \ 2x^3y \ + \ 3x^2y^2 \ + \ 2xy^3 \  + \ y^4 \ \ =^{?} \ \ ( \ x^2 + cxy + y^2 \ ) · ( \ x^2 + dxy + y^2 \ ) $$
$$ =  \ \ ( \ x^4 + cx^3y + x^2y^2 \ ) \ + \  ( \ dx^3y + cdx^2y^2 + dxy^3 \ ) \ + \  ( \ x^2y^2 + cxy^3 + y^4 \ ) \ \ . $$
This factorization succeeds, as $ \ c + d \ = \ 2 \ $ and $ \ 1 + cd + 1 \ = \ 3 \ \ $ can also be solved consistently by $ \ c \ = \ d \ = \ 1 \ \ . $ So we find the two factors to be identical.
We thus obtain the factorization
$$ (x \ + \ y)^7 \ - \ (x^7 \ + \ y^7) \ \ = \ \ 7 \ · \ xy \ · \ (x + y) \ · \ ( \ x^2 + xy + y^2 \ )^2 \ \ . $$
