Difference of powers (source code)

= Difference of powers
{title2=$a^n-b^n=(a-b)\sum_{k=0}^{n-1}a^{n-1-k}b^k$}

For $n\geq1$ and $a,b$ in a <commutative ring>, multiplying out the displayed <polynomial factorization> cancels all intermediate terms, leaving $a^n-b^n$. The case $n=2$ is the <difference of squares>. Unlike division by $a-b$, this identity also applies when $a=b$.

For real $1\leq b\leq a$, every summand lies between one and $a^{n-1}$. Consequently $n(a-b)\leq a^n-b^n\leq n(a-b)a^{n-1}$. This turns a one-step discrepancy into a bound after repeated multiplication, for example when estimating the <global error> of a <one-step method> on $y'=y$.