<s>[INST] 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...
 [/INST] 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.$$
</s>