After 18 months of studying an advanced junior high school mathematics course, I'm doing a review of the previous 6 months, starting with solving difficult quadratics that are not easily factored, for example: $$x^2+6x+2=0$$ This could be processed via the quadratic equation but the course I'm working through asks me to use the complete the square method. I can do it, and I appreciate the geometric illustration of what is happening.

But it's so powerful and elegant, I can't help but wonder where else this method of adding something into an expression only to take it away in another is employed in mathematics. And is there a name for the general case of this kind of operation?

geometric complete the square

  • 7
    $\begingroup$ Adding-and-taking-away a given value is effectively adding a clever form of $0$. I do it quite often when manipulating expressions, but I don't have good examples to show. I'll note, however, the counterpart action: "multiplying by a clever form of $1$" ---ie, multiplying-and-dividing-by a given value--- which is what we do to fractions to get common denominators, to rationalize denominators, etc. ... In both situations (and others), we do one thing (say, adding a value) because we want to, then do the opposite thing (subtracting that value) because we have to to maintain balance. $\endgroup$
    – Blue
    Commented Jul 10, 2022 at 12:49
  • $\begingroup$ Well... Simplifying something like $\frac{4+\sqrt 3}{2-\sqrt 5}$ by noting $a^2-b^2=(a+b)(a-b)$ means we can multiply by compliments. $\frac{4+\sqrt 3}{2-\sqrt 5}=\frac{4+\sqrt 3}{2-\sqrt 5}\frac{2+\sqrt 5}{2+\sqrt 5}= \frac {(4+\sqrt3)(2-\sqrt 5)}{2^2-\sqrt 5^2}=\frac {8 +2\sqrt 3-4\sqrt 5-\sqrt{15}}{4-5}=-8-2\sqrt 3 + 4\sqrt 5 + \sqrt{15}$. $\endgroup$
    – fleablood
    Commented Jul 10, 2022 at 17:14
  • 4
    $\begingroup$ Try adding $\cos^2x + \sin^2x - 1$ and see if it helps simplifying your favourite trig expression $\endgroup$
    – Jojo
    Commented Jul 10, 2022 at 21:19
  • $\begingroup$ In what way is the added term "taken away" again in completing the square? $\endgroup$ Commented Jul 11, 2022 at 0:58
  • $\begingroup$ @DanielR.Collins The subtraction may not be overt, but it has to be there, or else you're just factorising some other expression. Overt example: $x^2+6x+2=0\Rightarrow x^2+6x+9-9+2=0\Rightarrow \left(x+3\right)^2-7=0$ Non-overt example: $x^2+6x+2=0\Rightarrow x^2+6x+9=7\Rightarrow \left(x+3\right)^2=7$ $\endgroup$ Commented Jul 11, 2022 at 5:58

6 Answers 6


The method of inserting $0$ in a clever way by adding and subtracting a term is used many times in analysis. I learned long ago to call this clever use of $0$ a "propitious zero" and others have been taught that term too: look here and here.

I'll apply this idea to products, reciprocals, and to the terms in a sequence rewritten as a series.

Example 1. Let's prove continuity of multiplication of real numbers. If $x$ is near $a$ and $y$ is near $b$ then we want to show $xy$ is near $ab$. A standard way to do this is to write $$ xy - ab = (xy - ay) + (ay - ab) = (x-a)y + a(y-b) $$ and then $$ (x-a)y = (x-a)(y-b+b) = (x-a)(y-b) + (x-a)b, $$ so $$ xy - ab = (x-a)(y-b) + (x-a)b + a(y-b). $$ On the right side $x$ and $y$ only show up in the context of $x-a$ and $y-b$, so by choosing $x$ and $y$ so that $|x-a|$ and $|y-b|$ are sufficiently small, we can make the right side arbitrarily close to $0$. Thus multiplication as a mapping $\mathbf R^2 \to \mathbf R$ is continuous at each point $(a,b)$ in $\mathbf R^2$.

A similar argument shows other multiplication operations (on $\mathbf C$, on ${\rm M}_n(\mathbf R)$, etc.) are continuous.

UPDATE: the answer by CR Drost reminds me that a propitious zero occurs in the proof of the product rule from calculus for the derivative $(u(t)v(t))'$ in exactly the same way as in the last identity above for $xy - ab$. In that identity, replace $a$ and $b$ with $u(t)$ and $v(t)$ and replace $x$ and $y$ with $u(t+h)$ and $v(t+h)$. It tells us that $u(t+h)v(t+h) - u(t)v(t)$ equals $$ (u(t+h) - u(t))(v(t+h)-v(t)) + (u(t+h) - u(t))v(t) + u(t)(v(t+h)-v(t)). $$ Divide by $h$ and let $h \to 0$ to get in the limit $$ u'(t)0 + u'(t)v(t) + u(t)v'(t) = u'(t)v(t) + u(t)v'(t). $$

Example 2. Let's prove continuity of inversion on the nonzero real numbers. If $a \not= 0$ and $x$ is close enough to $a$, we want to show $1/x$ is close to $1/a$. To begin, let's suppose $|x-a| < |a|$, so $x$ is inside the open interval around $a$ of radius $a$ and thus $x \not= 0$. We have $$ \left|\frac{1}{x} - \frac{1}{a}\right| = \frac{|x-a|}{|x||a|}. $$ On the right side, in the numerator $x$ appears only in the context of $x-a$, which is great. For the denominator, we want to get a (positive) lower bound on $|x|$ in terms of $|x-a|$ in order to get an upper bound on $1/|x|$. It's time for a propitious zero: $$ |a| = |a-x+x| \leq |a-x| + |x| \Longrightarrow |x| \geq |a| - |a-x| = |a| - |x-a|. $$ As long as $|x-a| < |a|$, that lower bound is positive, so $$ |x-a| < |a| \Longrightarrow \left|\frac{1}{x} - \frac{1}{a}\right| = \frac{|x-a|}{|x||a|} \leq \frac{|x-a|}{(|a| - |x-a|)|a|}. $$ The right side goes to $0$ as $|x-a| \to 0$ (with $a$ fixed). Concretely, sharpen $|x-a|< |a|$ to $|x-a| \leq |a|/2$ and we get $|a| - |x-a| \geq |a| - |a|/2 = |a|/2$, so $$ \left|\frac{1}{x} - \frac{1}{a}\right| \leq \frac{|x-a|}{|a|^2/2} = \frac{2}{|a|^2}|x-a|. $$

A similar argument shows inversion is continuous on $\mathbf C^\times$ and ${\rm GL}_n(\mathbf R)$, although some extra care is needed for the matrix case (when $n > 1$) since matrix multiplication is not commutative.

Example 3: If $\{a_n\}$ is a sequence of numbers where $|a_n - a_{n+1}| \leq 1/2^n$, we can write each $a_m$ as a telescoping sum of the differences $a_n - a_{n+1}$ for $n \geq m$, which amounts to using infinitely many propitious zeros: $$ a_m = (a_m - a_{m+1}) + (a_{m+1} - a_{m+2}) + (a_{m+2} - a_{m+3}) + \cdots = \sum_{k \geq m} (a_k - a_{k+1}). $$ This by itself does not seem very interesting, but using this idea with functions in place of numbers is how you prove in measure theory that an $L^1$-convergent sequence of functions has a subsequence that is pointwise convergent almost everywhere. The argument for that is written in the accepted answer here.


We use a similar trick in teaching first semester calculus. To obtain the well-known product rule for derivatives, we have to deal with the expression:

$$\frac{f(x+h)g(x+h) - f(x)g(x)}{h}$$

This is inconvenient, as the two terms in the numerator have nothing in common to let us do any factoring. Thus, we add and subtract a term that shares something with each:

$$=\frac{f(x+h)g(x+h) - f(x+h)g(x) + f(x+h)g(x) - f(x)g(x)}{h}$$

Now the first two terms of the numerator have a common factor, and the second two terms have a common factor. Thus, we are able to complete the needed derivation.


This may not be an example of what the OP wants, but there is an inside-out version of completing the square. Given the expression


we recognize that adding the middle term $4a^2b^2$ forms a square and at the same time, the middle term itself is a square. Thus




  • 1
    $\begingroup$ In your first equation, you meant to write $a^4 + 4b^4 = (a^4 + 4a^2b^2 + 4b^4) - 4a^2b^2$. $\endgroup$ Commented Jul 10, 2022 at 16:45
  • $\begingroup$ Thanks for the catch. $\endgroup$ Commented Jul 10, 2022 at 17:09
  • 1
    $\begingroup$ In my high school math club this was called "disguised difference of squares". $\endgroup$ Commented Jul 10, 2022 at 21:58
  • 2
    $\begingroup$ Aurifeuille. $\endgroup$ Commented Jul 11, 2022 at 19:52

One example is multiplying an expression by some term and dividing it out again, like:

$$\begin{align} \frac1{\sqrt{n+1}+\sqrt n} &= \frac{\sqrt{n+1}-\sqrt n}{(\sqrt{n+1}+\sqrt n)(\sqrt{n+1}-\sqrt n)} \\ &= \frac{\sqrt{n+1}-\sqrt n}{n+1 - n} \\ &= \sqrt{n+1}-\sqrt n\\ \end{align}$$

This also involves a binomic formula, namely $(a+b)(a-b) = a^2-b^2$. This is useful when calculating sums which can be turned into telescoping sums:

$$\begin{align} \sum_{k=1}^n\frac1{\sqrt{k+1}+\sqrt k} &= \frac1{\sqrt2 + 1}+\frac1{\sqrt3 + \sqrt 2}+\frac1{\sqrt4 + \sqrt 3}+\cdots\\ &= \sum_{k=1}^n (\sqrt{k+1}-\sqrt k) \\ &= \sqrt{n+1}-1 \end{align}$$

  • $\begingroup$ +1 for an example that might be more understandable to the OP. $\endgroup$
    – Joe
    Commented Jul 13, 2022 at 15:45

Evaluating recurrence relations using generating functions.

To evaluate $F_n = F_{n-1} + F_{n-2}$ ($F_0 = 0, F_1 = 1$), we can construct the generating function $F(x) = \sum_{n=0}^\infty F_n x^n$. Note that the $x^n$ terms have been added and they will be taken away at the final step of the process.

$$F(x) = \sum_{n=0}^\infty \color{green}{F_n} x^n = F_0 + F_1 x + \sum_{n = 2}^\infty F_n x^n$$ $$xF(x) = \sum_{n = 1}^\infty F_{n-1}x^n = F_0x + \sum_{n=2}^\infty F_{n-1}x^n$$ $$x^2F(x) = \sum_{n=2}^\infty F_{n-2}x^n$$


$$F(x) - xF(x) - x^2F(x) = F_0 + F_1 x - F_0x + \sum_{n = 2}^\infty (F_n - F_{n-1} - F_{n-2}) x^n$$

From the recurrence, it follows that $F_n - F_{n-1} - F_{n-2} = 0$. Therefore, substituting values, we get

\begin{align} F(x) - xF(x) - x^2F(x) &= x\\ F(x) &=\frac{x}{1-x-x^2}\\ &= \frac{1}{\sqrt{5}}\left(\frac{1}{1-\varphi x} - \frac{1}{1 - \psi x}\right), \varphi = \frac{1 + \sqrt{5}}{2}, \psi = \frac{1 - \sqrt{5}}{2}\\ &= \frac{1}{\sqrt{5}}\left(\sum_{n=0}^\infty (\varphi x)^n - \sum_{n=0}^\infty (\psi x)^n\right)\\ &= \sum_{n=0}^\infty \color{green}{\frac{\varphi^n - \psi^n}{\sqrt{5}}}x^n \end{align}

Now, all we have to do is take away the $x^n$ terms we previously put in. And we get the Fibonacci sequence

$$\boxed{F_n = \frac{\varphi^n - \psi^n}{\sqrt{5}}}$$


With tensors/matrices, we often do this to provide various identities. For example, every matrix is the sum of a symmetric matrix $A_{ij} = A_{ji}$ and a skew-symmetric matrix $A_{ij} = -A_{ji}.$ The easiest proof is, $$ \begin{align} A_{ij} &= \frac12 A_{ij} + \frac12 A_{ij}\\ &= \left(\frac12 A_{ij} + \frac12 A_{ji}\right) + \left(\frac12 A_{ij} - \frac12 A_{ji}\right) \end{align} $$ And the first term is manifestly symmetric while the second is manifestly antisymmetric.

The product rule of calculus is sometimes used in this way, it says that $${\mathrm d\phantom t\over\mathrm dt}\big(u(t)~v(t)\big) = u~{\mathrm d v\over\mathrm dt} + v~{\mathrm d u\over\mathrm dt}$$and the problem is that you usually have something of the form $u~\mathrm dv/\mathrm dt$ which by itself is not strong enough to use this, so you add the other term. So for instance $$ \begin{align} x~\frac{\mathrm d^2x}{\mathrm dt^2} &= x~\frac{\mathrm d^2x}{\mathrm dt^2} + \left(\frac{\mathrm dx}{\mathrm dt}\right)^2 - \left(\frac{\mathrm dx}{\mathrm dt}\right)^2\\ &= \frac{\mathrm d\phantom t}{\mathrm dt}\left( x~\frac{\mathrm dx}{\mathrm dt} \right) - \left(\frac{\mathrm dx}{\mathrm dt}\right)^2 \\ &= \frac{\mathrm d^2}{\mathrm dt^2}\left(\frac12 x^2 \right) - \left(\frac{\mathrm dx}{\mathrm dt}\right)^2 \end{align}$$ The very last step is essentially the same process applied over again, that is one can observe that $x~\frac{\mathrm dx}{\mathrm dt} = \frac{\mathrm d}{\mathrm dt}(x^2) - \frac{\mathrm dx}{\mathrm dt}~x$ and then collect the like terms on the left-hand-side and divide by 2.

If this reminds you of something it is probably integration by parts, which is this exact procedure under an integral sign. A lot of times folks don't realize that the integral sign is kind of formally unnecessary and will insist on doing the above manipulation by first forming the definite integral, then manipulating it with integration by parts, and finally differentiating it. But yeah there it looks like:$$ \begin{align} \int u~\frac{\mathrm dv}{\mathrm dt}\mathrm dt &= \int \left(u~\frac{\mathrm dv}{\mathrm dt} + v\frac{\mathrm du}{\mathrm dt}\right)\mathrm dt - \int v~\frac{\mathrm du}{\mathrm dt}~\mathrm dt\\ &= u~v- \int v~\frac{\mathrm du}{\mathrm dt}~\mathrm dt \end{align} $$ although, as with the quadratic formula, many folks just memorize the result.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .