Extra help on inequality Someone very helpfully provided an answer to an inequality. See Hard Olympiad Inequality However I don't get part of their answer. How did they get the last factorization??? Thanks so much for any help.
Would Wolfram Alpha help? I plugged it in it is still loading

Below is a rather long proof, but every step is straightforward. For any function $\phi$ in three variables $a,b,c$, let us denote
$$
\begin{array}{lcl}
\Sigma_{cyc}\phi&=&\phi(a,b,c)+\phi(b,c,a)+\phi(c,a,b) \\
\Sigma_{all}\phi&=&\phi(a,b,c)+\phi(a,c,b)+\phi(b,a,c)+\phi(b,c,a)+\phi(c,a,b)+\phi(c,b,a)
\end{array}\tag{1}
$$
Our job is to rewrite
$$
A_1= (a+b+c)^2-4(ab+ac+bc)\bigg(\sum_{cyc}\frac{a^2}{(a+b)(a+c)}\bigg) \tag{2}
$$
First, letting $p(a,b,c)=(a+b)(a+c)(b+c), q(a,b,c)=\sum_{all}a^2b$ and $A_2=p(a,b,c)A_1$, we equivalently
have to rewrite $A_2$, where 
$$
A_2=(a+b+c)^2p(a,b,c)-4(ab+ac+bc)q(a,b,c) \tag{3}
$$
We can do it as follows, by breaking the symmetry and separating $a$ from the pair $(b,c)$ :
$$
\begin{array}{lcl}
A_2 &=&  (a+b+c)^2p(a,b,c)-4(ab+ac+bc)q(a,b,c) \\
&=&  4(a+b+c)^2p(a,b,c)-3(a+b+c)^2p(a,b,c) \\
& & -8(ab+ac+bc)q(a,b,c)+
4(ab+ac+bc)q(a,b,c) \\
&=& \bigg(\sum_{all} 2a(a+b+c)p(a,b,c)\bigg)
+\bigg(\sum_{all} \frac{1}{2}(a(b^2+c^2)-4a^2(b+c)-2abc)(a+b+c)^2\bigg)
\\
& & -\bigg(\sum_{all} 2a(b+c)q(a,b,c)\bigg)+
\bigg(\sum_{all} 2a^2(b+c)(ab+ac+bc)\bigg)
 \\
&=& \sum_{all} aA_3(a,b,c),\\
\end{array}\tag{4}
$$
where
$$
\begin{array}{lcl}
A_3 &=&  2(a+b+c)p(a,b,c)+\frac{1}{2}((b^2+c^2)-4a(b+c)-2bc)(a+b+c)^2 \\
& & -2(b+c)q(a,b,c)+2a(b+c)(ab+ac+bc) \\
&=&  2(a+b+c)(q(a,b,c)+2abc)+\frac{1}{2}((b-c)^2-4a(b+c))(a+b+c)^2 \\
& & -2(b+c)q(a,b,c)+2a(b+c)(ab+ac+bc) \\
&=&  2a(q(a,b,c)+2abc)+2(b+c)(2abc)+\frac{1}{2}((b-c)^2-4a(b+c))(a+b+c)^2 \\
& & +2a(b+c)(ab+ac+bc) \\
&=&  2ap(a,b,c)+2a(b+c)(ab+ac+3bc)+\frac{1}{2}((b-c)^2-4a(b+c))(a+b+c)^2 \\
&=&  2ap(a,b,c)+2a(b+c)(ab+ac+3bc-(a+b+c)^2)+\frac{(b-c)^2}{2}(a+b+c)^2 \\
&=&  2a\bigg(p(a,b,c)+(b+c)(bc-(ab+ac)-a^2-b^2-c^2)\bigg)+\frac{(b-c)^2}{2}(a+b+c)^2 \\
&=&  2a(b+c)\bigg((a+b)(a+c)+bc-(ab+ac)-a^2-b^2-c^2)\bigg)+\frac{(b-c)^2}{2}(a+b+c)^2 \\
&=&  2a(b+c)\bigg(-(b-c)^2\bigg)+\frac{(b-c)^2}{2}(a+b+c)^2 \\
&=&  (b-c)^2\bigg(-2a(b+c)+\frac{(a+b+c)^2}{2}\bigg)\\
&=&  (b-c)^2\frac{(b+c-a)^2}{2}
\end{array}\tag{5}
$$
and we are done.
