Completing the Square Calculator
Convert a quadratic a·x^2 + b·x + c into vertex form a·(x - h)^2 + k via completing the square. Enter real numbers for a, b, c. (Must have a ≠ 0.)
1, 2, -0.5.
6, -8, 4.
5, 3, -6.
x or t). Used in the output.
a·x^2 + b·x + c = a·(x - h)^2 + k (formatted by math.js, not LaTeX).
Result
Vertex Form
Vertex (h, k)
h = -b/(2a), k = c - b^2/(4a).
What is a Completing the Square Calculator?
A Completing the Square Calculator transforms a general quadratic into a perfect-square form that exposes geometric and algebraic structure. Starting with the standard equation $$y=ax^2+bx+c,\quad a\neq 0,$$ completing the square rewrites it as the vertex form $$y=a(x-h)^2+k,$$ where \((h,k)\) is the vertex and the axis of symmetry is \(x=h\). This method is foundational for graphing parabolas, solving quadratic equations, deriving the quadratic formula, analyzing transformations, and modeling optimization problems. Because the perfect-square structure makes the minimum/maximum value immediate (depending on the sign of \(a\)), it is widely taught in algebra, precalculus, and calculus.
About the Completing the Square Calculator
The calculator accepts coefficients \(a,b,c\) and produces a step-by-step completion. It factors out \(a\) from the quadratic and linear terms, adds and subtracts the square of half the linear coefficient, and simplifies to obtain \(h\) and \(k\). The core algebra is
The same structure also leads directly to the roots. Setting \(y=0\) and isolating the square gives
When embedded in a live page, show these formulas with MathJax for responsive rendering; use math.js for precise numeric evaluation while preserving the same formulas.
How to Use this Completing the Square Calculator
- Enter \(a\), \(b\), and \(c\) from \(y=ax^2+bx+c\).
- Factor \(a\) from the quadratic and linear terms: $$y=a\!\left[x^2+\frac{b}{a}x\right]+c.$$
- Add–subtract the square of half the linear coefficient: $$\left(\frac{b}{2a}\right)^2.$$
- Simplify to vertex form: $$y=a(x-h)^2+k,\quad h=-\frac{b}{2a},\ k=c-\frac{b^2}{4a}.$$
- Read vertex \((h,k)\), axis \(x=h\), and opening (up if \(a>0\), down if \(a<0\)).
- Optionally solve \(y=0\) using the completed square to find real or complex roots.
Examples (using the same formulas)
Example 1: \(y=2x^2-8x+5\).
\(h=-\frac{-8}{2\cdot 2}=2,\quad k=5-\frac{(-8)^2}{4\cdot 2}=5-8=-3.\)
Vertex form: $$y=2(x-2)^2-3,\quad \text{vertex }(2,-3),\ \text{axis }x=2.$$
Example 2: \(y=-x^2+6x-10\).
\(h=-\frac{6}{2(-1)}=3,\quad k=-10-\frac{6^2}{4(-1)}=-10+9=-1.\)
Vertex form: $$y=-(x-3)^2-1.$$
Example 3: \(y=\tfrac12 x^2+x+4\).
\(h=-\frac{1}{2\cdot \tfrac12}=-1,\quad k=4-\frac{1^2}{4\cdot \tfrac12}=4-\tfrac12=\tfrac{7}{2}.\)
Vertex form: $$y=\tfrac12(x+1)^2+\tfrac{7}{2}.$$
FAQs
Q1: Why complete the square if I already know the quadratic formula?
Completing the square reveals the vertex and transformations directly and underpins the derivation of the quadratic formula.
Q2: What if \(a\neq 1\)?
Always factor out \(a\) before forming the perfect square; then use \(h=-\frac{b}{2a}\) and \(k=c-\frac{b^2}{4a}\).
Q3: Can this handle negative or fractional coefficients?
Yes. The formulas above are exact for any real (or complex) \(a\), \(b\), and \(c\).
Q4: How does this help graphing?
Vertex form \(y=a(x-h)^2+k\) gives the vertex, axis, direction, and stretch/compression at a glance for quick, accurate sketches.