Fact-checked by Grok 2 weeks ago

Completing the square

Completing the square is an algebraic technique for solving equations of the form ax^2 + bx + c = 0 by transforming the quadratic expression into a trinomial plus or minus a constant, allowing the use of the square root property to find the roots. This method dates back to ancient civilizations, with evidence of geometric approaches to completing squares appearing in Old Babylonian tablets around 1900 BC, where problems involving areas were solved by filling L-shaped regions to form squares. Later, in the , the Persian mathematician formalized the process in his treatise Al-Kitab al-mukhtasar fi hisab al-jabr wa-l-muqabala, using geometric constructions to handle cases of quadratic equations without negative numbers. The primary purpose of completing the square is to rewrite a polynomial ax^2 + bx + c in form a(x - h)^2 + k, where the of the associated parabola is at (h, k) with h = -b/(2a) and k = c - b^2/(4a). This form facilitates graphing parabolas, evaluating definite integrals involving quadratic expressions, and Laplace transforms in more advanced . Although less commonly used for direct equation solving due to its procedural complexity compared to the , it serves as the foundational derivation for that formula by applying the steps to the general . To complete the square, first ensure the leading a = 1 by dividing the equation by a if necessary; for example, in $2x^2 + 6x + 7 = 0, divide by 2 to get x^2 + 3x + 3.5 = 0. Move the constant term to the other side, then add \left(\frac{b}{2}\right)^2 (half the of x, squared) to both sides to form the : for x^2 + 4x = -3, add $4 to both sides yielding (x + 2)^2 = 1, which solves as x + 2 = \pm 1 or x = -1, -3. For non-monic quadratics, factor out a from the x^2 and x terms before completing the square inside the parentheses. This method is particularly efficient when the of the linear term is even, ensuring values during the process.

Introduction

Definition and purpose

Completing the square is an algebraic technique used to rewrite a quadratic polynomial of the form ax^2 + bx + c into its vertex form, a(x - h)^2 + k, where h and k are constants determined by the coefficients a, b, and c. This transformation involves manipulating the expression to form a perfect square trinomial, revealing the structural properties of the quadratic. The process assumes a basic understanding of quadratic polynomials and their standard form. The primary purpose of completing the square is to facilitate the solution of quadratic equations by converting them into a form that can be solved using square roots, thereby avoiding direct reliance on the . It also aids in graphing parabolas by directly identifying the vertex coordinates (h, k), which represent the and of of the curve. Furthermore, this method provides insights into the minimum or maximum values of the , occurring at the : a minimum if a > 0 or a maximum if a < 0.

Basic example

To illustrate the process of completing the square, consider the quadratic equation x^2 + 6x + 5 = 0. This monic quadratic provides a straightforward case to demonstrate the method's steps, which transform the equation into a form that reveals its roots and vertex. Begin by isolating the quadratic and linear terms on one side of the equation: x^2 + 6x + 5 = 0 \implies x^2 + 6x = -5 Here, the constant term is moved to the right side to prepare for forming a perfect square trinomial on the left. Next, take half of the coefficient of x (which is 6, so half is 3) and square it to get 9. Add this value to both sides of the equation: x^2 + 6x + 9 = -5 + 9 \implies x^2 + 6x + 9 = 4 The left side now factors as a perfect square: (x + 3)^2 = 4 This step completes the square by adjusting the expression to match the form (x + \frac{b}{2})^2, where b = 6. To solve for x, take the square root of both sides, accounting for both positive and negative roots: x + 3 = \pm \sqrt{4} \implies x + 3 = \pm 2 Subtract 3 from both sides to isolate x: x = -3 + 2 = -1 \quad \text{or} \quad x = -3 - 2 = -5 The roots are x = -1 and x = -5. Additionally, the completed square form of the original equation is (x + 3)^2 - 4 = 0, which highlights the vertex at (-3, -4) in the related quadratic function y = x^2 + 6x + 5.

Historical Development

Origins in ancient mathematics

The earliest known methods resembling the completion of the square emerged in Babylonian mathematics around 2000 BCE, where scholars solved quadratic equations through geometric dissections depicted on clay tablets. These ancient Mesopotamians interpreted quadratic problems geometrically, often framing them as finding dimensions of rectangles or fields with given areas and side differences. For instance, a typical problem involved a rectangle whose area was 60 and whose length exceeded its width by 7, leading to a geometric construction where half the difference was used to form a square added to the area, effectively completing a larger square whose side gave the solution. This approach, preserved on Old Babylonian tablets, relied on cut-and-paste manipulations of areas rather than symbolic algebra, demonstrating an intuitive grasp of quadratic relationships through visual and proportional reasoning. In ancient Greece, Euclid formalized similar geometric techniques in his Elements around 300 BCE, particularly in applications of the . Book I, Proposition 47 provides a proof by constructing squares on the sides of a right-angled triangle and rearranging parallelograms and triangles to equate areas, a process that geometrically completes squares to demonstrate that the square on the hypotenuse equals the sum of the squares on the other two sides. Euclid's method involved drawing lines parallel to the sides and equating composite figures, such as showing that certain parallelograms equal the squares on the legs, thereby balancing areas without algebraic notation. This rigorous geometric framework influenced subsequent Western mathematics, emphasizing deduction from axioms to verify quadratic equalities. By the 7th century CE, Indian mathematician Brahmagupta advanced quadratic solutions in his Brahmasphutasiddhanta (628 CE), introducing algebraic rules that echoed completion of the square for equations like ax^2 + c = y^2. He provided general formulas for positive and negative solutions, treating cases where the constant term is added or subtracted, and generated infinite sequences of integer solutions for indeterminate equations, such as deriving pairs like (1, 3) and (6, 17) from $8x^2 + 1 = y^2. While Brahmagupta's approach was more arithmetic than purely geometric, it resembled completing the square by isolating terms to form perfect squares, marking a shift toward symbolic manipulation in non-European traditions.

Contributions from medieval and early modern scholars

During the Islamic Golden Age, the Persian scholar Muhammad ibn Musa al-Khwarizmi made foundational contributions to algebra in his treatise Al-Kitāb al-mukhtaṣar fī ḥisāb al-jabr wa-l-muqābala (The Compendious Book on Calculation by Completion and Balancing), composed around 820 CE. In this work, al-Khwarizmi systematically classified quadratic equations into six types and introduced the method of al-jabr—meaning "completion"—to solve them by eliminating negative terms and balancing equations, a process equivalent to completing the square. This approach involved geometric constructions alongside verbal descriptions, laying the groundwork for algebraic manipulation and directly inspiring the modern term "algebra." Building on this tradition in the 11th century, the Persian mathematician advanced the geometric-algebraic synthesis in his Treatise on Demonstration of Problems of Algebra, completed around 1070 while in . Khayyam extended al-Khwarizmi's methods by classifying higher-degree equations and solving cubic equations through intersections of conic sections, which provided rigorous geometric proofs for algebraic solutions. His work emphasized the limitations of radical solutions for certain equations, promoting a unified framework that integrated completing the square with broader algebraic problems. In Renaissance Europe, the adoption and refinement of these Islamic algebraic techniques occurred in the 16th century, notably through Italian and French scholars. Girolamo Cardano, in his 1545 publication Ars Magna, incorporated completing the square as a preliminary step in deriving radical solutions for cubic and quartic equations, adapting al-Khwarizmi's methods to handle negative roots and complex quantities for the first time. Similarly, François Viète advanced symbolic notation in works like In artem analyticam isagoge (1591), enabling more abstract applications of completion techniques to quadratics and higher degrees, which facilitated systematic equation transformations and influenced the shift toward modern algebraic symbolism.

Core Method

General procedure for monic quadratics

A monic quadratic equation is one where the coefficient of the x^2 term is 1, typically expressed as x^2 + bx + c = 0, with b and c as constants. The completing the square procedure rewrites this equation to reveal its roots by forming a perfect square trinomial on one side, facilitating solution via square roots. To begin, isolate the constant term by moving c to the right side, yielding x^2 + bx = -c. This step prepares the left side for adjustment into a perfect square while preserving equality. Next, add \left(\frac{b}{2}\right)^2 to both sides: x^2 + bx + \left(\frac{b}{2}\right)^2 = -c + \left(\frac{b}{2}\right)^2. This addition completes the square on the left, as the binomial expansion of \left(x + \frac{b}{2}\right)^2 = x^2 + b x + \left(\frac{b}{2}\right)^2 matches the original quadratic terms exactly; halving b works because the middle term in the expansion is $2 \cdot \frac{b}{2} \cdot x = b x, aligning the coefficients precisely. The left side now factors as \left(x + \frac{b}{2}\right)^2 = -c + \left(\frac{b}{2}\right)^2. To solve for x, take the square root of both sides: x + \frac{b}{2} = \pm \sqrt{-c + \left(\frac{b}{2}\right)^2}, then subtract \frac{b}{2} from both sides to isolate x. This yields the roots explicitly, provided the expression under the radical is non-negative for real solutions. In general, without setting the equation to zero, the monic quadratic x^2 + b x + c can be rewritten as \left(x + \frac{b}{2}\right)^2 + \left(c - \left(\frac{b}{2}\right)^2\right). This vertex form highlights the quadratic's minimum or maximum at x = -\frac{b}{2}, with the constant term adjusting for the original c. The rationale again stems from the binomial expansion, ensuring the transformation preserves the polynomial's value for all x.

Formula derivation

To derive the vertex form of a monic quadratic function f(x) = x^2 + bx + c, begin by considering the expanded form of the vertex form (x + h)^2 + k. Expanding this gives: (x + h)^2 + k = x^2 + 2hx + h^2 + k. Matching coefficients with the standard form x^2 + bx + c requires $2h = b, so h = \frac{b}{2}, and the constant term h^2 + k = c, yielding k = c - \left(\frac{b}{2}\right)^2 = c - \frac{b^2}{4}. For the full derivation via completing the square, start with x^2 + bx + c and focus on the quadratic and linear terms: x^2 + bx. To complete the square, add and subtract \left(\frac{b}{2}\right)^2: x^2 + bx = x^2 + bx + \left(\frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4}. Incorporating the constant term then gives: x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4} + c = \left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right). This establishes the vertex form (x + h)^2 + k with h = \frac{b}{2} and k = c - \frac{b^2}{4}. To verify equivalence, expand the completed form back: \left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right) = x^2 + bx + \frac{b^2}{4} + c - \frac{b^2}{4} = x^2 + bx + c. This confirms the algebraic identity holds for all b and c.

Extensions to Non-Standard Forms

Non-monic quadratic case

When the leading coefficient a of a quadratic equation ax^2 + bx + c = 0 is not equal to 1, the completing the square method requires an initial adjustment to transform the equation into a monic form before proceeding with the standard procedure. This step ensures the coefficient of the x^2 term is 1, allowing the familiar monic completing the square technique to be applied. The procedure begins by dividing the entire equation by a (assuming a \neq 0) to yield x^2 + \frac{b}{a}x + \frac{c}{a} = 0. Rearranging gives x^2 + \frac{b}{a}x = -\frac{c}{a}. To complete the square, add \left(\frac{b}{2a}\right)^2 = \frac{b^2}{4a^2} to both sides, resulting in \left(x + \frac{b}{2a}\right)^2 = -\frac{c}{a} + \frac{b^2}{4a^2} = \frac{b^2 - 4ac}{4a^2}. Multiplying through by a to return to the original scale produces the completed form a\left(x + \frac{b}{2a}\right)^2 + \left(c - \frac{b^2}{4a}\right) = 0. In expanded vertex form, the quadratic expression is ax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 + \left(c - \frac{b^2}{4a}\right). For an illustrative example, consider $3x^2 - 12x + 7 = 0. Dividing by 3 gives x^2 - 4x + \frac{7}{3} = 0, or x^2 - 4x = -\frac{7}{3}. Adding \left(\frac{-4}{2}\right)^2 = 4 to both sides yields (x - 2)^2 = -\frac{7}{3} + 4 = \frac{5}{3}. Multiplying back by 3 results in $3(x - 2)^2 + \left(7 - \frac{(-12)^2}{4 \cdot 3}\right) = 3(x - 2)^2 - 5 = 0, confirming the form. The sign of a influences the geometric interpretation and root behavior. If a > 0, the parabola opens upward, with a minimum at the vertex; if a < 0, it opens downward, featuring a maximum. In the completed form a(x - h)^2 + k = 0 where h = -\frac{b}{2a} and k = c - \frac{b^2}{4a} = -\frac{D}{4a} with discriminant D = b^2 - 4ac, the nature of real roots depends on D: D > 0 implies two distinct real roots, D = 0 one real root (repeated), and D < 0 no real roots, regardless of the sign of a. This relation arises directly from the completed square, as solving requires the right side -\frac{k}{a} to be non-negative for real solutions. When a < 0, the procedure may alternatively involve factoring out -|a| from the x^2 and x terms first to ensure a positive inner coefficient, though the division method yields equivalent results. For instance, in -2x^2 + 8x - 5 = 0, dividing by -2 gives x^2 - 4x + \frac{5}{2} = 0, leading to (x - 2)^2 = \frac{3}{2}, or in form -2(x - 2)^2 + 3 = 0. This highlights the downward-opening parabola and confirms D = 24 > 0 for two real roots.

Matrix completion of squares

In multivariable calculus and optimization, completing the square extends to quadratic forms, which are second-degree polynomials in vector variables of the form \mathbf{x}^T A \mathbf{x} + \mathbf{b}^T \mathbf{x} + c, where \mathbf{x} \in \mathbb{R}^n, A \in \mathbb{R}^{n \times n} is a symmetric matrix, \mathbf{b} \in \mathbb{R}^n is a vector, and c \in \mathbb{R} is a scalar. This representation captures interactions between variables through the off-diagonal elements of A. Assuming A is invertible, the quadratic form can be rewritten by completing the square as (\mathbf{x} + A^{-1} \mathbf{b}/2)^T A (\mathbf{x} + A^{-1} \mathbf{b}/2) + (c - \mathbf{b}^T A^{-1} \mathbf{b}/4). The linear term vanishes after the shift \mathbf{x}' = \mathbf{x} + A^{-1} \mathbf{b}/2, isolating the quadratic and constant terms. This transformation is derived algebraically by expanding the squared term and matching coefficients, analogous to the scalar case but using matrix inversion. Alternatively, it follows from properties of the Schur complement in the associated block matrix or from eigenvalue decomposition to diagonalize A, though the direct expansion suffices for the completion. If A is positive definite, the completed form attains a global minimum at \mathbf{x} = -A^{-1} \mathbf{b}/2, with the minimum value c - \mathbf{b}^T A^{-1} \mathbf{b}/4. For example, consider the $2x^2 + 4xy + 2y^2, which has no linear or constant terms and corresponds to \mathbf{x}^T \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix} \mathbf{x} where \mathbf{x} = \begin{pmatrix} x \\ y \end{pmatrix}. This simplifies to $2(x + y)^2, a completed square expression equivalent to (\mathbf{x} + \mathbf{0})^T A (\mathbf{x} + \mathbf{0}) + 0, highlighting the rank-one structure of A and the absence of adjustment needed.

Applications in Equation Solving

Extracting roots from quadratics

Completing the square provides a direct method to extract the roots of a quadratic equation by transforming it into a perfect square form, from which the solutions can be obtained using the square root property. For a monic quadratic equation x^2 + bx + c = 0, after completing the square, the equation becomes (x + \frac{b}{2})^2 = \frac{b^2}{4} - c. The roots are then given by x = -\frac{b}{2} \pm \sqrt{\frac{b^2}{4} - c}, where the expression under the square root is the negative of the constant term adjusted for the completion process. For the general quadratic ax^2 + bx + c = 0 with a \neq 0, the process involves first dividing through by a to make the leading coefficient 1, then proceeding as above. This yields the completed square form (x + \frac{b}{2a})^2 = \frac{b^2 - 4ac}{4a^2}, and are x = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a}. Here, b^2 - 4ac is the , which determines the nature of the roots: if it equals zero, there is a repeated at x = -\frac{b}{2a}; if positive, two distinct real roots; if negative, the roots are (though this method focuses on real extraction). This approach offers advantages over directly applying the , as it avoids the need to memorize the expression x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} and instead derives the roots step-by-step through algebraic manipulation. It also visually emphasizes the repeated root case when the right side of the completed equation is zero, providing intuitive insight into the equation's solution structure. The roots obtained via completing the square are mathematically equivalent to those from the , as the latter is precisely derived by applying this completion process to the general . For instance, consider x^2 + 6x + 5 = 0: completing the square gives (x + 3)^2 = 4, so x = -3 \pm 2, yielding x = -1 and x = -5. This equivalence holds without altering the , but the method reinforces understanding of the underlying .

Handling irrational and complex roots

Completing the square provides a direct way to identify irrational roots in quadratic equations when the discriminant is positive but not a perfect square, resulting in square roots of non-square integers. For instance, starting with the equation x^2 - 10x + 18 = 0, move the constant term to obtain x^2 - 10x = -18, then add ( -10/2 )^2 = 25 to both sides: x^2 - 10x + 25 = 7, which factors as (x - 5)^2 = 7. Taking square roots yields x - 5 = \pm \sqrt{7}, so the roots are x = 5 \pm \sqrt{7}, both irrational numbers. This process highlights the irrationality without invoking the full quadratic formula, as the non-integer square root emerges naturally from the completed form. For cases where the discriminant is negative, completing the square reveals complex roots by leading to a square equal to a negative value, necessitating the imaginary unit i = \sqrt{-1}. Consider the equation x^2 + 4x + 5 = 0: rearrange to x^2 + 4x = -5, add (4/2)^2 = 4 to both sides: x^2 + 4x + 4 = -1, or (x + 2)^2 = -1. The solutions are x + 2 = \pm \sqrt{-1} = \pm i, hence x = -2 \pm i. Similarly, for x^2 + 1 = 0, it simplifies directly to x^2 = -1, so x = \pm i. This technique demonstrates that no real solutions exist while providing the exact complex roots. The ability of completing the square to uncover both and roots underscores its role in revealing the full of equations, independent of the . In particular, when real roots are absent, the method aligns with the , which guarantees that every has two roots (counting multiplicity) in the numbers. This approach not only determines the nature of the roots—real or non-real —but also ties directly to the ensuring solvability over the complexes.

Graphical and Geometric Interpretations

Relation to parabola graphs

Completing the square provides a method to rewrite a from its standard form ax^2 + bx + c into the vertex form f(x) = a(x - h)^2 + k, which is particularly useful for graphing parabolas as it immediately identifies the and other graphical properties. In this form, the coordinates of the are (h, k), representing the highest or lowest point of the parabola depending on the sign of a. The of symmetry is the vertical line x = h, which divides the parabola into two mirror-image halves. Additionally, the value of a determines the direction of opening: if a > 0, the parabola opens upward, indicating a minimum at the ; if a < 0, it opens downward, indicating a maximum. The vertex form also highlights the transformations that shape the parabola relative to the parent function y = x^2. A horizontal shift occurs by h units to the right if h > 0 or to the left if h < 0, while a vertical shift by k units moves the graph up if k > 0 or down if k < 0. The coefficient a scales the graph vertically by a factor of |a|: values of |a| > 1 cause compression toward the x-axis, $0 < |a| < 1 cause stretching away from it, and a negative a reflects the parabola over the x-axis. These transformations allow for quick sketching by starting from the vertex and plotting symmetric points, such as those at x = h \pm 1, without needing to solve for intercepts initially. For example, consider the function f(x) = x^2 + 6x + 5. Completing the square transforms it to f(x) = (x + 3)^2 - 4, revealing a at (-3, -4) and a = 1 > 0, so the parabola opens upward with its axis of symmetry at x = -3. This form shows a shift left by 3 units and a vertical shift down by 4 units from y = x^2, enabling efficient graphing by marking the and adding points like f(-2) = -3 and f(-4) = -3.

Geometric construction

The geometric construction of completing the square originates from ancient mathematical practices, where expressions were visualized using areas of squares and rather than algebraic symbols. In this approach, the term x^2 + bx is represented as the area of a square with side length x adjacent to a rectangle with dimensions x by b. The constant term c is treated as an additional rectangular or square area to be incorporated. This allows for a physical of shapes to reveal the of a . To complete the square, a smaller square with side length b/2 (area (b/2)^2) is added to the figure and simultaneously subtracted in the algebraic sense, transforming the original shape into a larger square with side length x + b/2. Visually, the initial square and form an incomplete L-shaped region, often called a in ancient , which lacks piece. Adding this missing square completes the L-shape into the full larger square, while the subtracted area adjusts for the constant term, leaving a that equals c - (b/2)^2. For instance, in solving x^2 + 10x = 39, the of area 10x is halved along its , and a 5 by 5 square (area 25) is added to form a square of side x + 5 with total area 64, yielding the side 8 and solution x = 3. This method was employed in Old Babylonian tablets around 1900 BC, such as YBC 6967, where areas were manipulated similarly to solve quadratics. The construction ties directly to the Pythagorean theorem through the use of gnomons, the L-shaped regions that represent the difference in areas between consecutive squares. Algebraically, this manifests in the identity x^2 + 2hx = (x + h)^2 - h^2, where the left side is the area of a square plus an L-shaped gnomon of width $2h, and the right side subtracts the smaller square to form the larger one, mirroring geometric proofs of a^2 + b^2 = c^2 by successive gnomon additions. Such techniques were later formalized by mathematicians like al-Khwarizmi in the 9th century, who illustrated quadratic solutions with diagrams of squares and appended rectangles completed via added squares.

Further Applications

In calculus and integration

Completing the square provides a method to rewrite the indefinite of a in a form that highlights its , facilitating and evaluation. For the \int (ax^2 + bx + c) \, dx, first complete the square on the expression to obtain a(x - h)^2 + k, where h = -b/(2a) and k = c - b^2/(4a). This transforms the to a \int (x - h)^2 \, dx + k \int dx = \frac{a}{3}(x - h)^3 + kx + C. Using the u = x - h, the simplifies further to \frac{a}{3}u^3 + k(u + h) + C, which can be expressed back in terms of x. Consider the example \int (x^2 + 4x + 3) \, dx. Completing the square gives x^2 + 4x + 3 = (x + 2)^2 - 1, so the integral becomes \int [(x + 2)^2 - 1] \, dx = \frac{1}{3}(x + 2)^3 - x + C. Another important application is in integrals involving exponentials of quadratic forms, such as the Gaussian integral. For \int_{-\infty}^{\infty} e^{-(a x^2 + b x + c)} \, dx with a > 0, completing the square in the exponent gives -(a x^2 + b x + c) = -a (x + \frac{b}{2a})^2 + \frac{b^2}{4a} - c. Thus, the integral is e^{\frac{b^2}{4a} - c} \int_{-\infty}^{\infty} e^{-a (x + \frac{b}{2a})^2} \, dx = e^{\frac{b^2}{4a} - c} \sqrt{\frac{\pi}{a}}, using the known result \int_{-\infty}^{\infty} e^{-a u^2} \, du = \sqrt{\frac{\pi}{a}}. This technique is essential for evaluating error functions and in probability for normal distributions. A primary application in arises when evaluating \int \frac{1}{ax^2 + bx + c} \, dx, where completing the square converts the denominator to a(u^2 + p) or a(u^2 - p^2), with u = x - h. If the b^2 - 4ac < 0, yielding u^2 + p^2 (p > 0), leads to \frac{1}{a} \int \frac{1}{u^2 + p^2} \, du = \frac{1}{ap} \arctan\left(\frac{u}{p}\right) + C. If the > 0, it results in a logarithmic form \frac{1}{2ap} \ln \left| \frac{u - p}{u + p} \right| + C. This approach avoids for irreducible quadratics, simplifying the process directly. In broader calculus contexts, completing the square aids in computing arc lengths of curves where the integrand involves \sqrt{1 + (y')^2} and y is quadratic, producing a \sqrt{\text{quadratic}} that benefits from the technique followed by trigonometric or hyperbolic substitutions. Such calculations are relevant in physics for determining the actual path length of parabolic trajectories, as in projectile motion.

In complex analysis and numbers

In the context of complex quadratic equations, completing the square provides a method to express the polynomial in a form that reveals its roots within the complex numbers, often as elements of the Gaussian integers \mathbb{Z}, the ring of integers in \mathbb{Q}(i). For a quadratic equation z^2 + bz + c = 0 with complex coefficients, the technique involves adding and subtracting (b/2)^2 to rewrite it as (z + b/2)^2 = (b/2)^2 - c, yielding roots z = -b/2 \pm \sqrt{(b/2)^2 - c}. If the coefficients b and c are Gaussian integers, the roots frequently lie in \mathbb{Z} as well, facilitating factorization in this unique factorization domain. A representative example is the equation z^2 + 2z + 2 = 0. Completing the square gives z^2 + 2z + 1 + 1 = 0, or (z + 1)^2 = -1, so z + 1 = \pm i and z = -1 \pm i, both Gaussian integers. This process not only solves but also demonstrates how completing the square aligns with the of \mathbb{Z}, where the N(a + bi) = a^2 + b^2 aids in verifying irreducibility and . In , completing the square simplifies the evaluation of integrals via the , particularly for integrals involving Gaussian-like exponents. For instance, to compute \int_{-\infty}^{\infty} e^{-x^2} \cos(2bx) \, dx for b > 0, consider the complex f(z) = e^{-z^2 + 2ibz} over a semicircular in the upper half-plane. Completing the square in the exponent yields -z^2 + 2ibz = -(z - ib)^2 - b^2, allowing a shift of the to w = z - ib, where the reduces to e^{-b^2} \int_{-\infty}^{\infty} e^{-w^2} \, dw = \sqrt{\pi} e^{-b^2} by Cauchy's theorem, as the is entire and the arc contribution vanishes. This factors the exponent over the complexes, enabling residue computations or deformations without poles. Furthermore, completing the square connects to the Eisenstein integers \mathbb{Z}[\omega], where \omega = e^{2\pi i / 3}, by aiding the analysis of quadratic forms and units essential for unique factorization. In \mathbb{Q}(\sqrt{-3}), the norm form N(a + b\omega) = a^2 - ab + b^2 leads to equations like (2a + b)^2 + 3b^2 = 4N(\epsilon) for units \epsilon, solved via completing the square to identify the six units \{\pm 1, \pm \omega, \pm \omega^2\}. This structural insight supports the proof that \mathbb{Z}[\omega] is a unique factorization domain, where non-unit elements factor uniquely into irreducibles up to units, with irreducibles classified by norms congruent to primes modulo 3.

Variations and Generalizations

Completing higher powers like cubes

To generalize the completing the square to cubic equations of the form x^3 + ax^2 + bx + c = 0, the first step is to depress the cubic by substituting x = y - \frac{a}{3}, which eliminates the term and yields a depressed cubic y^3 + py + q = 0, where p = b - \frac{a^2}{3} and q = c - \frac{ab}{3} + \frac{2a^3}{27}. This transformation simplifies the equation but does not directly allow for a straightforward "completing the cube" analogous to the case. Attempts to complete the cube involve assuming a form like y^3 + py + q = (y + k)^3 + ry + s and solving for constants k, r, s, but this generally fails to simplify the equation fully for arbitrary p and q, as linear substitutions cannot transform it into a pure y^3 + C = 0. Instead, more advanced substitutions, such as y = w + \frac{p}{3w}, reduce the depressed cubic to a in w^3, which is the basis of Cardano's formula: the roots are given by \sqrt{{grok:render&&&type=render_inline_citation&&&citation_id=3&&&citation_type=wikipedia}}{-\frac{q}{2} + \sqrt{\left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3}} + \sqrt{{grok:render&&&type=render_inline_citation&&&citation_id=3&&&citation_type=wikipedia}}{-\frac{q}{2} - \sqrt{\left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3}}. This process can be viewed as a partial , where the cubic is expressed as a involving cube roots rather than a single perfect . For illustration, consider the x^3 - 3x^2 + 2x. This can be partially completed by noting that (x-1)^3 = x^3 - 3x^2 + 3x - 1, so rearranging gives x^3 - 3x^2 + 2x = (x-1)^3 - x + 1. Such partial decompositions highlight the method's utility for specific coefficients but do not extend generally. Unlike completing the square, no universal "completing the cube" exists for arbitrary cubics due to the invariants under , such as a^2 - 3b remaining unchanged, preventing to a perfect cube form. Historical efforts, including those by in the late 16th century, explored substitutions like y = z - \frac{p}{3z} for depressed cubics to facilitate solutions, motivated by problems involving sums and sums of cubes, but these led to resolvents rather than full completions. Completing the square extends to biquadratic equations of the form x^4 + a x^2 + b = 0, where the even powers allow y = x^2 to reduce it to a y^2 + a y + b = 0. To solve, complete the square on the in y: y^2 + a y + b = \left(y + \frac{a}{2}\right)^2 - \left(\frac{a}{2}\right)^2 + b = 0 \left(y + \frac{a}{2}\right)^2 = \frac{a^2}{4} - b Assuming the right side is nonnegative for real solutions, take square roots: y + \frac{a}{2} = \pm \sqrt{\frac{a^2}{4} - b}, \quad y = -\frac{a}{2} \pm \sqrt{\frac{a^2}{4} - b} The roots for x are then x = \pm \sqrt{y} for each positive y, yielding up to four real or roots depending on the \frac{a^2}{4} - b. This approach leverages the completing-the-square method after substitution and is detailed in resources for handling such quartics. Another application arises in optimization, particularly for minimizing sums like x + \frac{1}{x} where x > 0. Substitute t = \sqrt{x} (so t > 0) to rewrite the expression as t^2 + \frac{1}{t^2}. Completing the square gives: t^2 + \frac{1}{t^2} = \left(t - \frac{1}{t}\right)^2 + 2 \geq 2, since \left(t - \frac{1}{t}\right)^2 \geq 0, with equality when t = 1 (i.e., x = 1). Thus, the minimum value is 2. This technique provides an elementary proof of the two-term AM-GM inequality, as \frac{x + 1/x}{2} \geq \sqrt{x \cdot 1/x} = 1 implies x + 1/x \geq 2, with equality under the same condition, connecting algebraic manipulation to inequality bounds in optimization contexts.

References

  1. [1]
    Algebra - Quadratic Equations - Part II - Pauls Online Math Notes
    Nov 16, 2022 · We can derive the quadratic formula by completing the square on the general quadratic formula in standard form. Let's do that and we'll take it ...
  2. [2]
    Completing the Square: The prehistory of the quadratic formula
    "Consider the equation x x + 2 a x = b b ; add to one and to the other sides the square of half the coefficient of the second term, i.e. a a , and it becomes x ...<|control11|><|separator|>
  3. [3]
    Completing the Square - Department of Mathematics at UTSA
    Jan 15, 2022 · In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form.
  4. [4]
    Deciding which method to use when solving quadratic equations
    Next, if the coefficient of the squared term is 1 and the coefficient of the linear (middle) term is even, completing the square is a good method to use.
  5. [5]
    Vertex Form - Ximera - The Ohio State University
    In order to convert a quadratic from standard form to vertex form, we will use a technique called completing the square. Consider a generic , with , and ...
  6. [6]
    Quadratics - Student Academic Success - Monash University
    Completing the square is not primarily a direct method for solving a quadratic equationA mathematical statement that shows two expressions are equal, connected ...
  7. [7]
    Babylonian mathematics - MacTutor - University of St Andrews
    The clay tablet BM 85200+ containing 36 problems of this type, is the earliest known attempt to set up and solve cubic equations. Hoyrup discusses this ...
  8. [8]
    Euclid's Elements, Book I, Proposition 47 - Clark University
    In right-angled triangles the square on the side opposite the right angle equals the sum of the squares on the sides containing the right angle.
  9. [9]
    Brahmagupta (598 - 670) - Biography - MacTutor
    For the equation 11 x 2 + 1 = y 2 11x^{2} + 1 = y^{2} 11x2+1=y2 Brahmagupta obtained the solutions ( x , y ) = ( 3 , 10 ) , ( 161 5 , 534 5 ) , . .
  10. [10]
    Al-Khwarizmi (790 - 850) - Biography - MacTutor
    Here "al-jabr" means "completion" and is the process of removing negative terms from an equation. For example, using one of al-Khwarizmi's own examples, "al- ...
  11. [11]
    Omar Khayyam (1048 - 1131) - Biography - MacTutor
    Indeed Khayyam did produce such a work, the Treatise on Demonstration of Problems of Algebra which contained a complete classification of cubic equations ...
  12. [12]
    Girolamo Cardano - Biography
    ### Summary of Cardano's Contributions to Algebra
  13. [13]
    François Viète - Biography
    ### Summary of François Viète's Contributions to Algebra
  14. [14]
    Quadratic Forms - Ximera - The Ohio State University
    Oct 9, 2025 · Completing the square is an algebraic procedure. Later in this section, we will take a functional viewpoint of this (which will be more direct ...
  15. [15]
    [PDF] Quadratic equations
    This process of determining a constant to add to a quadratic expression to obtain a perfect square is known as completing the square.
  16. [16]
    None
    ### Summary of Vertex Form Derivation via Completing the Square (Monic Case)
  17. [17]
    ORCCA Completing the Square - Portland Community College
    To solve the quadratic equation \(x^2+6x=16\text{,}\) on the left side we can complete the square by adding \(\left(\frac{b}{2}\right)^2\text{;}\) note that \(b ...
  18. [18]
    [PDF] Quadratic Polynomials - Penn Math
    This procedure is the generalization of “completing the square” to quadratic polynomials in several variables. Just as for a quadratic polynomial in one ...
  19. [19]
    [PDF] 16. Quadratic Forms and Definite Matrices
    Nov 11, 2022 · There is a unique maximum at x = 0. Finally, if f(x) = ax2 + bx + c is a function on R, we can complete the square to rewrite ...
  20. [20]
    [PDF] Completing the Square - GitHub Pages
    It turns out that we can generalize this process to quadratic expressions involving matrices and vectors. 2 Completing the Square (Multivariate). Proposition 1.
  21. [21]
    Express a quadratic form as a sum of squares using Schur ...
    May 4, 2015 · Write the symmetric matrix representing this quadratic form. Now, express this as a sum of squares by using this symmetric matrix and Schur complements.Using Schur's Complement to Reformulate Semidefinite ...Quadratic forms - Completing squares - Mathematics Stack ExchangeMore results from math.stackexchange.com
  22. [22]
    [PDF] More than you wanted to know about quadratic forms
    Nov 11, 2018 · A symmetric matrix A (or its associated quadratic form) is called ... Then, completing the square, we get x. ′. Ax = a11x2. 1 + 2a12x1x2 + ...
  23. [23]
    3-04 Solve Quadratic Equations by Completing the Square (3.3)
    Completing the square is a method that solves all quadratic equations. Solving by Completing the Square. A perfect square is something like x2. It could be ...
  24. [24]
    Quadratic Equations - College Algebra - West Texas A&M University
    Dec 17, 2009 · Solve quadratic equations by completing the square. Solve quadratic equations by using the quadratic formula. Find the discriminant of a ...
  25. [25]
    [PDF] Completing the Square: From the Roots of Algebra
    Sep 24, 2019 · In the task outlined in this Appendix, you will apply a method similar to al-Khw¯arizm¯ı's formulaic solution of the form “squares plus roots ...
  26. [26]
    1.2: Square Root Property, Complete the Square, and The Quadratic ...
    Nov 1, 2021 · Completing the Square · Add the square of half the coefficient of x to both sides of the equation. · Factor the resulting trinomial into a ...
  27. [27]
    Parabolas - Algebra - Pauls Online Math Notes
    Nov 16, 2022 · ... and give a process for graphing parabolas. We also illustrate how to use completing the square to put the parabola into the form f(x)=a(x-h)^2+k
  28. [28]
    Completing the Square - BioMath: Quadratic Functions
    Completing the square is a method that can be used to transform a quadratic equation in standard form to vertex form.
  29. [29]
    Parabolas - Graphing - Worked Examples
    Completing the square. Going from the standard form to the vertex form of a quadratic equation involves "completing the square", as illustrated below:
  30. [30]
    Completing a Square Geometrically - IntoMath
    Mar 17, 2021 · We literally complete the square by adding a missing square piece to an existing quadratic geometric formation.<|control11|><|separator|>
  31. [31]
    [PDF] The Methods of Pythagoras and of Plato via Gnomons
    Nov 27, 2017 · The term gnomon was also associated with an L-shaped instrument, sometimes called a 'set square,' that was used in architecture for the ...
  32. [32]
  33. [33]
    infty}^{\infty}e^{-x^2}\cos(2bx)\,\mathrm{d}x$ using residue theorem ...
    Oct 10, 2020 · Commented Oct 10, 2020 at 20:52. After completing the square and a change of variables z=x−ib you basically want to prove ∫∞−∞e−z2dz ...Residue Theorem - complex analysis - Math Stack ExchangeHow to use a contour integral to evaluate $\frac{2}{\pi }\int\limits_0 ...More results from math.stackexchange.com
  34. [34]
    [PDF] Contents 8 Quadratic Integer Rings - Evan Dummit
    ... completing the square, this equation is equivalent to (2a + b)2 + 3b2 = 4 ... The Gaussian integers provide another important example of a Euclidean domain:.
  35. [35]
    Solving cubic equations - DPMMS
    What would be the natural generalization to cubics of the process of completing the square? To answer a question of this kind, the following tactic is often ...
  36. [36]
    [PDF] A historical survey of methods of solving cubic equations - CORE
    This history brings together the most important aspects in the development of solutions to the cubio equation and presents a selected list of literature and.
  37. [37]
    Biquadratic Equation -- from Wolfram MathWorld
    ### Summary: Solving Biquadratic Equations Using Completing the Square
  38. [38]
  39. [39]