I was trying to prove the multiplication rule for limits but I got stuck trying to factor $a_nb_n-LM$

How was the author able to factor the expression from the left side to the expression on the right? $$a_nb_n-LM=(a_n-L)(b_n-M)+M(a_n-L)+L(b_n-M)$$

Thanks!

-
Expand the right hand side. – Mariano Suárez-Alvarez Oct 3 '11 at 7:43
If I expand the right side, I get the left side but how do I factor the left side? – Juan de la John Oct 3 '11 at 7:51
There is no sensible sense in which this equality is the result of "factoring", really. The right hand side is a useful expression for the left hand side in the context of the proof---you will see, as you continue learning calculus, that this same trick is used very often, and then it will become natural... – Mariano Suárez-Alvarez Oct 3 '11 at 8:09
Oh okay thank you for all your help! I will continue to persist with my calculus course – Juan de la John Oct 3 '11 at 16:01

To obtain the identity in the first place, the idea is that you want to make use of the assumption that $a_n \to L$ and $b_n \to M$, and that it's often easier to use the equivalent formulation $a_n - L \to 0$ and $b_n - M \to 0$. So one introduces new variables $x_n = a_n - L$ and $y_n = b_n -M$. Then $$a_n b_n - LM = (x_n + L)(y_n + M) - LM = \dots$$ (Expand this expression and watch what happens!)