Simplify rational fraction 
$$\large \frac {bx(a^2x^2+2a^2y^2+b^2y^2)+ay(a^2x^2+2b^2x^2+b^2y^2)}{bx+ay}$$

My attempt:
$$\dfrac{ba^2x^3+2a^2bxy^2+b^3xy^2+a^3x^2y+2b^2x^2ay+b^2ay^3}{bx+ay}$$
I multiplied it out like this, then got stuck...
 A: First, let's pull out the $bx$ and $ay$ in the numerator:
\begin{eqnarray}
bx(a^2 x^2 &+& 2a^2 y^2 + b^2 y^2) + ay(a^2 x^2 + 2b^2 x^2 + b^2 y^2)\\
&=& (bx+ay)(a^2 x^2 + b^2 y^2) + 2a^2 b x y^2 + 2 a b^2 x^2 y\\
&=& (bx+ay)(a^2 x^2 + b^2 y^2) + ay(2a b x y) + bx(2a b x y)\\
&=& (bx+ay)(a^2 x^2 + 2abxy +  b^2 y^2).
\end{eqnarray}
Now divide out the $bx + ay$ and factor to get
$$a^2 x^2 + 2abxy +  b^2 y^2 = (ax + by)^2.$$
A: In numerator, the factor $a^2x^2+b^2y^2$ is common, then
$$\frac {bx(a^2x^2+2a^2y^2+b^2y^2)+ay(a^2x^2+2b^2x^2+b^2y^2)}{bx+ay}=$$
$$\frac {(a^2x^2+b^2y^2)(bx+ay)+2a^2y^2bx+2b^2x^2ay}{bx+ay}=$$
$$\frac {(a^2x^2+b^2y^2)(bx+ay)+2abxy(bx+ay)}{bx+ay}=$$
$$\frac {(a^2x^2+b^2y^2+2abxy)(bx+ay)}{bx+ay}=$$
$$a^2x^2+b^2y^2+2abxy=(ax+by)^2.$$
A: Like @RossMillikan's comment stated, you can switch the second and the fifth terms and then factor out $bx$ and $ay$.
$$\frac {bx(a^2x^2+2a^2y^2+b^2y^2)+ay(a^2x^2+2b^2x^2+b^2y^2)}{bx+ay}=$$ 
Distribute
$$\frac{ba^2x^3+2a^2bxy^2+b^3xy^2+a^3x^2y+2b^2x^2ay+b^2ay^3}{bx+ay}=$$
Switch the second and fifth terms
$$\frac{ba^2x^3+2b^2x^2ay+b^3xy^2+a^3x^2y+2a^2bxy^2+b^2ay^3}{bx+ay}=$$
Factor out $bx$ and $ay$
$$\frac{bx(a^2x^2+2bxay+b^2y^2)+ay(a^2x^2+2abxy+b^2y^2)}{bx+ay}=$$
Simplify
$$\frac{(bx+ay)(a^2x^2+2abxy+b^2y^2)}{bx+ay}=$$
$$a^2x^2+2abxy+b^2y^2=$$
$$(ax+by)^2$$
