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...

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$$
