TITLE: Is there a shorter/faster way to show these two expressions are equal?
QUESTION [10 upvotes]: I want to know if the two expressions are equivalent:

$\frac{1}{2}(k+2)(2a+(k+1)b)$
$\frac{1}{2}(k+1)(2a+kb)+(a+(k+1)b)$

My attempt:
First, I decided to start with 2 as 1 looks complicated to me (expanding it is time consuming).
Since 1 has $\frac{1}{2}$ as a factor, I try to express 2 in terms of $\frac{1}{2}$ to get:
$\frac{1}{2}\left[(k+1)(2a+kb)+2a+2(k+1)b \right]$
Since there is a $(k+2)$ in 1, I decided to expand everything in the square bracket and hope that $(k+2)$ is a factor of that expression:
$\frac{1}{2} \left[ k^2b+3b+2ak+4a+2b\right]$
Using polynomial long division to divide the expression in the square brackets by $(k+2)$, I get:
$\frac{1}{2} \left[(k+2) (kb+b+2a) \right]$
Which can be simplified to:
$\frac{1}{2}(k+2)(2a+b(k+1))$, as required.
Is there a more efficient method to solve this kind of question and how will you reason about it? I feel that I am missing some obvious shortcuts/properties since I had to resort to polynomial long division.

REPLY [19 votes]: By inspection, the two expressions are quadratics in $k$.  Therefore, if they are equal at three different values of $k$, they are equal at all values of $k$.  The easiest values to check are $k=0$, $-1$, and $-2$.
For $k=0$ the expressions become
$${1\over2}(0+2)(2a+(0+1)b)=2a+b$$
and
$${1\over2}(0+1)(2a+0b)+(a+(0+1)b)=2a+b$$
For $k=-1$, they become
$${1\over2}(-1+2)(2a+0b)=a$$
and
$${1\over2}(0)(2a-b)+a+0b=a$$
And for $k=-2$, they become
$${1\over2}(0)(2a-b)=0$$
and
$${1\over2}(-1)(2a-2b)+(a-b)=0$$