Metamath Proof Explorer


Theorem subsq2

Description: Express the difference of the squares of two numbers as a polynomial in the difference of the numbers. (Contributed by NM, 21-Feb-2008)

Ref Expression
Assertion subsq2 ABA2B2=AB2+2BAB

Proof

Step Hyp Ref Expression
1 2cn 2
2 mulcl 2B2B
3 1 2 mpan B2B
4 3 adantl AB2B
5 subadd23 AB2BA-B+2B=A+2B-B
6 4 5 mpd3an3 ABA-B+2B=A+2B-B
7 2txmxeqx B2BB=B
8 7 adantl AB2BB=B
9 8 oveq2d ABA+2B-B=A+B
10 6 9 eqtrd ABA-B+2B=A+B
11 10 oveq1d ABA-B+2BAB=A+BAB
12 subcl ABAB
13 12 4 12 adddird ABA-B+2BAB=ABAB+2BAB
14 11 13 eqtr3d ABA+BAB=ABAB+2BAB
15 subsq ABA2B2=A+BAB
16 sqval ABAB2=ABAB
17 12 16 syl ABAB2=ABAB
18 17 oveq1d ABAB2+2BAB=ABAB+2BAB
19 14 15 18 3eqtr4d ABA2B2=AB2+2BAB