Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Completing the Square Calculator (Vertex, Axis of Symmetry, Max and Min)

Enter the coefficients a, b and c of the quadratic function y = ax² + bx + c. The equation below is linked to the input fields, so you can also edit the coefficients in the equation directly.

Enter numbers only. Decimals, negative numbers and fractions such as 3/4 are OK. A blank a counts as 1 (x² is the same as 1x²), and a blank b or c counts as 0.
Result and graph
Enter the coefficients a, b and c in the fields on the left and press "Calculate". The steps for completing the square, the vertex and a graph will appear here.

What you can do on this page

  • Enter the coefficients, and the quadratic function \(y = ax^{2} + bx + c\) is rewritten in the form \(y = a(x - p)^{2} + q\) (vertex form) by completing the square
  • The steps follow the textbook method line by line: factor out the leading coefficient, add and subtract the square of half the \(x\) coefficient, then write the perfect square
  • You also get the vertex \((p,\ q)\), the axis of symmetry \(x = p\), which way the graph opens (upward or downward) and the maximum or minimum value, along with a graph of the parabola
  • Answers are shown both as reduced fractions (exact values) such as \(-\dfrac{5}{4}\) and as decimals. Coefficients can be decimals, negative numbers or fractions such as 3/4
  • The calculator shows the equation the way you would write it by hand, and you can edit the coefficients right in the equation
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are also on this page
This page is for quadratic functions (the x² coefficient a is not 0). To solve an equation of the form ax²+bx+c = 0, use the Quadratic Formula Calculator in the related tools.

What is this calculation used for?

Finding the highest point of a ball or a fountain (physics and sports)

The height of a ball thrown upward, or of the water in a fountain, is often modeled as a quadratic function of time. For example, if the height is \(h = -16t^{2} + 64t\) (in feet, with \(t\) in seconds, ignoring air resistance), completing the square gives \(h = -16(t - 2)^{2} + 64\). You can read off that the ball reaches its highest point, 64 feet, after 2 seconds.
Pulling the vertex, "the highest point and when it happens", straight out of the equation is the strength of completing the square, and projectile problems in physics are a classic use of it.

Finding the price that maximizes profit (business and economics)

When "raising the price increases the profit per item but reduces how many you sell", profit can sometimes be modeled as a quadratic function of price that opens downward. The price that gives the most profit is exactly the vertex of the parabola. For example, if the profit is \(y = -x^{2} + 60x - 500\) dollars (with \(x\) the price in dollars), the vertex \(x = 30\) is the price that maximizes profit: $30.
Real markets are more complicated, but "look for the best value at the vertex" is a starting point for thinking about pricing and how to split an ad budget.

Making the largest garden bed with a fixed length of fence (design and DIY)

For a rectangle with a fixed perimeter, the area is a quadratic function of the side length. For example, with 40 feet of fence, if the width is \(x\) feet, the length is \(20 - x\) feet, and the area is \(y = x(20 - x) = -x^{2} + 20x\). Completing the square gives \(y = -(x - 10)^{2} + 100\), so the largest area is 100 square feet when \(x = 10\) (a square).
This is the most basic form of an optimization problem: getting the most out of limited materials or a limited budget.

Designing antennas and light reflectors (engineering)

Satellite dishes and the reflectors in car headlights and flashlights have the shape of a parabola spun around its axis (a paraboloid). They use a property of the parabola: radio waves or light coming in parallel to the axis all bounce to one point on the axis (the focus), and light sent out from the focus travels straight out parallel to the axis.
In design, a parabola is described by where its vertex is and how wide it opens in which direction, so the idea of vertex form \(y = a(x - p)^{2} + q\), built around the vertex, is the foundation.

Formulas and graphs

Completing the square (converting to vertex form)
Graph
Standard notation (the usual math form)
\(y\) \(=\) \(a\) \(\left(x - p\right)^{2}\) \(+\) \(q\)
In words (symbols replaced with words)
④ \(y\): value of the quadratic function \(=\) ① \(a\): \(x^{2}\) coefficient ② square of \(x\) minus the vertex \(x\)-coordinate \(p\) \(+\) ③ \(q\): \(y\)-coordinate of the vertex
The formula in words
① Take the \(x^{2}\) coefficient \(a\)
② multiply it by the square of \(x\) minus the vertex \(x\)-coordinate \(p\)
③ add the \(y\)-coordinate of the vertex \(q\)
④ and you get the value of the quadratic function \(y\) (in this form, you can see the vertex \((p,\ q)\) and the axis \(x = p\) at a glance)
Quick example
Completing the square on \(y = 2x^{2} - 8x + 3\) gives \(y = 2(x - 2)^{2} - 5\) (vertex \((2,\ -5)\))
value of the function \(y\) \(=\) \(x^{2}\) coefficient (2) square of \(x\) minus 2 \(+\) \(y\)-coordinate of the vertex (−5)
\(y = 2x^{2} - 8x + 3 = 2\left(x^{2} - 4x\right) + 3\)
\(y = 2\left(x^{2} - 4x + 4 - 4\right) + 3 = 2\left\{\left(x - 2\right)^{2} - 4\right\} + 3\)
\(y = 2\left(x - 2\right)^{2} - 8 + 3 = 2\left(x - 2\right)^{2} - 5\)
Key idea
Completing the square rewrites a quadratic function as "a squared part plus a constant". Since \((x - p)^{2}\) is a square, it is always 0 or more, and it is 0 only when \(x = p\). So if \(a > 0\), \(y\) is smallest at \(x = p\) (minimum value \(q\)), and if \(a < 0\), \(y\) is largest there (maximum value \(q\)). The value of this rewrite is that you can read the vertex and the maximum or minimum from the form of the equation alone. The form \(y = ax^{2} + bx + c\) is called standard form, and \(y = a(x - p)^{2} + q\) is called vertex form (the vertex can be seen at a glance). When you graph a quadratic or look for its maximum or minimum, converting to vertex form is the usual first move. (Many textbooks write vertex form as \(y = a(x - h)^{2} + k\), with the vertex \((h,\ k)\).)
\(x\)-coordinate of the vertex (the axis of symmetry)
Standard notation (the usual math form)
\(p\) \(=\) \(-b\) \(\div\) \((\) \(2a\) \()\)
In words (symbols replaced with words)
③ \(p\): \(x\)-coordinate of the vertex \(=\) ① \(-b\): \(x\) coefficient with its sign changed \(\div\) \((\) ② \(2a\): twice the \(x^{2}\) coefficient \()\)
The formula in words
① Take the \(x\) coefficient with its sign changed, \(-b\)
② divide it by twice the \(x^{2}\) coefficient, \(2a\)
③ and you get the \(x\)-coordinate of the vertex \(p\) (the axis of symmetry is the line \(x = p\))
Quick example
The \(x\)-coordinate of the vertex of \(y = 2x^{2} - 8x + 3\) (\(a = 2,\ b = -8\)) is
\(x\)-coordinate of the vertex \(p\) \(=\) \(b\) with its sign changed (8) \(\div\) \((\) twice \(a\) (4) \()\)
\(p = -\dfrac{b}{2a} = -\dfrac{-8}{2 \times 2} = \dfrac{8}{4} = 2\)
Key idea
This is the vertex formula you get by completing the square all the way with letters instead of numbers. Without rewriting the equation every time, you can find the \(x\)-coordinate of the vertex straight from \(a\) and \(b\). (This calculator also finds \(p\) with this formula.) A parabola is symmetric about its axis (the line \(x = p\)), so \(p\) is also where the graph folds over. It has the same form as \(-\dfrac{b}{2a}\), the part before the "±" in the quadratic formula \(x = \dfrac{-b \pm \sqrt{b^{2} - 4ac}}{2a}\). This shows that the axis is exactly halfway between the two solutions.
\(y\)-coordinate of the vertex (maximum or minimum value)
Graph
Standard notation (the usual math form)
\(q\) \(=\) \(c\) \(-\) \(b^{2}\) \(\div\) \((\) \(4a\) \()\)
In words (symbols replaced with words)
④ \(q\): \(y\)-coordinate of the vertex \(=\) ① \(c\): constant \(-\) ② \(b^{2}\): square of the \(x\) coefficient \(\div\) \((\) ③ \(4a\): 4 times the \(x^{2}\) coefficient \()\)
The formula in words
① From the constant \(c\)
② subtract the square of the \(x\) coefficient \(b\)
③ divided by 4 times the \(x^{2}\) coefficient, \(4a\)
④ and you get the \(y\)-coordinate of the vertex \(q\) (the minimum value if \(a > 0\), the maximum value if \(a < 0\))
Quick example
The \(y\)-coordinate of the vertex of \(y = 2x^{2} - 8x + 3\) (\(a = 2,\ b = -8,\ c = 3\)) is
\(y\)-coordinate of the vertex \(q\) \(=\) constant (3) \(-\) \(b\) squared (64) \(\div\) \((\) 4 times \(a\) (8) \()\)
\(q = c - \dfrac{b^{2}}{4a} = 3 - \dfrac{(-8)^{2}}{4 \times 2} = 3 - \dfrac{64}{8} = 3 - 8 = -5\)
Key idea
\(q\) is the value of \(y\) when \(x = p\), so plugging \(x = p\) into the original equation gives the same answer. This is a handy way to check your work. A parabola that opens upward (\(a > 0\)) has its lowest point at the vertex, so \(q\) is the minimum value. A parabola that opens downward (\(a < 0\)) has its highest point at the vertex, so \(q\) is the maximum value. But when the domain (the values \(x\) is allowed to take) is limited, the vertex may fall outside it, and you need to compare with the values at the ends of the domain.
By completing the square, the quadratic function \(y = ax^{2} + bx + c\) can be rewritten in vertex form \(y = a(x - p)^{2} + q\), where \(p = -\dfrac{b}{2a}\) and \(q = c - \dfrac{b^{2}}{4a}\). The vertex is \((p,\ q)\) and the axis of symmetry is the line \(x = p\). If \(a > 0\), the minimum value is \(q\) at \(x = p\); if \(a < 0\), the maximum value is \(q\).

Symbols and terms

Symbols

\(a,\ b,\ c\) a, b, c The coefficients of the quadratic function \(y = ax^{2} + bx + c\). \(a\) is the \(x^{2}\) coefficient (not 0), \(b\) is the \(x\) coefficient, and \(c\) is the constant. Letters from the start of the alphabet, \(a,\ b,\ c\), are usually used for fixed numbers.
\(x,\ y\) x, y Variables. \(x\) is the input and \(y\) is the output. Letters from the end of the alphabet, \(x,\ y,\ z\), are usually used for numbers that can take many values.
\(p\) pee The \(x\)-coordinate of the vertex, which is also where the axis of symmetry (the line \(x = p\)) is. Many US textbooks use \(h\) for this.
\(q\) cue The \(y\)-coordinate of the vertex. It is the minimum value if \(a > 0\) and the maximum value if \(a < 0\). It is the letter after \(p\), so the two are used as a pair. Many US textbooks use \(k\) for this.
\((x - p)^{2}\) x minus p, squared The squared part made by completing the square. As a square it is always 0 or more, and it is 0 only when \(x = p\). This is exactly why the maximum or minimum is at the vertex.
\(x^{2}\) x squared \(x\) multiplied by itself (\(x^{2} = x \times x\)). The small raised number (the exponent) tells how many times it is multiplied.

Terms

quadratic function A function of the form \(y = ax^{2} + bx + c\) (\(a \neq 0\)). Its graph is a parabola. It is taught in Algebra 1 and Algebra 2.
parabola The symmetric U-shaped curve that is the graph of a quadratic function. It is the same shape as the path of a thrown ball.
vertex The turning point of a parabola: the lowest point if it opens upward, the highest point if it opens downward. Its coordinates are \((p,\ q)\).
axis of symmetry The vertical line \(x = p\) that a parabola is symmetric about. The parabola is a mirror image of itself across this line, and the vertex lies on it.
completing the square Rewriting \(y = ax^{2} + bx + c\) in the form \(y = a(x - p)^{2} + q\). The name comes from "making a perfect square". It is the basic tool for finding the vertex, the axis and the maximum or minimum, and the quadratic formula itself is derived with it.
perfect square An expression that is something squared, such as \((x - 2)^{2} = x^{2} - 4x + 4\). A square is a number times itself: the square of \(3\) is \(3^{2} = 9\).
standard form The form \(y = ax^{2} + bx + c\). It is the usual expanded form, and you can easily read where it crosses the \(y\)-axis (\(y = c\) when \(x = 0\)).
vertex form The form \(y = a(x - p)^{2} + q\) (often written \(y = a(x - h)^{2} + k\)). You can see the vertex \((p,\ q)\) at a glance. Completing the square converts standard form into vertex form.
opens upward The graph opens like a valley. This happens when \(a > 0\), and the vertex is the lowest point.
opens downward The graph opens like a hill. This happens when \(a < 0\), and the vertex is the highest point.
maximum value The largest value the function \(y\) can take. For a quadratic that opens downward, the \(y\)-coordinate of the vertex \(q\) is the maximum value.
minimum value The smallest value the function \(y\) can take. For a quadratic that opens upward, the \(y\)-coordinate of the vertex \(q\) is the minimum value.
coefficient The number in front of a letter. In \(2x^{2}\), 2 is the coefficient. A term with no number written, such as \(x^{2}\), has coefficient 1.
constant term A number-only term without \(x\), such as the 3 in \(2x^{2} - 8x + 3\). It is called constant because it does not change whatever the value of \(x\).
symmetric Matching exactly when folded over. If you fold a parabola along its axis, the left and right sides match exactly (line symmetry).
domain The set of values \(x\) is allowed to take. When the domain is limited (for example, \(0 \le x \le 3\)), the maximum or minimum may be at an end of the domain instead of at the vertex.
translation Sliding a figure without changing its shape (also called a shift). The graph of \(y = a(x - p)^{2} + q\) is the graph of \(y = ax^{2}\) shifted \(p\) in the \(x\) direction and \(q\) in the \(y\) direction.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.

Functions and graphs (Grade 8 and Algebra 1)
  • Picturing a function as a rule that takes a number in and gives exactly one number back
  • Knowing that the graph of \(y = x^{2}\) is a parabola with its vertex at the origin
Expanding and factoring (Algebra 1)
  • Being able to use the perfect square pattern \((x + m)^{2} = x^{2} + 2mx + m^{2}\) (completing the square uses this pattern in reverse)
  • Being able to factor out a common number with the distributive property (for example, \(2x^{2} - 8x = 2(x^{2} - 4x)\))
Signed numbers and algebraic expressions (Grades 6–7)
  • Knowing that the square of a negative number is positive (for example, \((-3)^{2} = 9\))
  • Being able to remove parentheses (for example, \(2(x - 3) = 2x - 6\) and \(-(x - 1) = -x + 1\))
Working with fractions (Grades 5–6)
  • Being able to find common denominators and reduce fractions (when the \(x\) coefficient is odd, the vertex has fractions such as \(-\dfrac{3}{2}\))
  • Being able to square a fraction (for example, \(\left(\dfrac{3}{2}\right)^{2} = \dfrac{9}{4}\))
Graphs of quadratic functions (Algebra 1 and Algebra 2)
  • Knowing that the graph of \(y = ax^{2}\) opens upward if \(a > 0\) and opens downward if \(a < 0\)
  • If you know about shifting graphs (\(y = a(x - p)^{2} + q\) is \(y = ax^{2}\) shifted \(p\) in the \(x\) direction and \(q\) in the \(y\) direction), you can see why the vertex is \((p,\ q)\)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to complete the square (vertex p, q)
x² coefficient a 2
x coefficient b -8
Constant c 3
Vertex x-coordinate p =-B2/(2*B1)
Vertex y-coordinate q =B3-B2^2/(4*B1)
Table to find the x-coordinate of the vertex (axis of symmetry)
x² coefficient a 1
x coefficient b -6
Vertex x-coordinate p = −b/(2a) =-B2/(2*B1)
Table to find the y-coordinate of the vertex (max or min)
x² coefficient a 1
x coefficient b -6
Constant c 5
Vertex y-coordinate q = c − b²/(4a) =B3-B2^2/(4*B1)
Table to check that vertex form matches the original
x² coefficient a 2
x coefficient b -8
Constant c 3
x value to check 1
Vertex x-coordinate p =-B2/(2*B1)
Vertex y-coordinate q =B3-B2^2/(4*B1)
Value of ax²+bx+c =B1*B4^2+B2*B4+B3
Value of a(x−p)²+q =B1*(B4-B5)^2+B6
After pasting, the upper rows (coefficients) are your inputs and the lower rows are calculated automatically.
"^" is a power, "*" is multiplication and "/" is division.
The first table is the example y = 2x² − 8x + 3. p is 2 and q is −5 (so y = 2(x − 2)² − 5).
The second and third tables are the example y = x² − 6x + 5. p is 3 and q is −4.
The fourth table is a check. For the same x (1 in the example), "value of ax²+bx+c" and "value of a(x−p)²+q" are both −3, so the two forms match.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to complete the square (vertex p, q)
x² coefficient a 2
x coefficient b -8
Constant c 3
Vertex x-coordinate p =-B2/(2*B1)
Vertex y-coordinate q =B3-B2^2/(4*B1)
Table to find the x-coordinate of the vertex (axis of symmetry)
x² coefficient a 1
x coefficient b -6
Vertex x-coordinate p = −b/(2a) =-B2/(2*B1)
Table to find the y-coordinate of the vertex (max or min)
x² coefficient a 1
x coefficient b -6
Constant c 5
Vertex y-coordinate q = c − b²/(4a) =B3-B2^2/(4*B1)
Table to check that vertex form matches the original
x² coefficient a 2
x coefficient b -8
Constant c 3
x value to check 1
Vertex x-coordinate p =-B2/(2*B1)
Vertex y-coordinate q =B3-B2^2/(4*B1)
Value of ax²+bx+c =B1*B4^2+B2*B4+B3
Value of a(x−p)²+q =B1*(B4-B5)^2+B6
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the coefficients with your own numbers.

How to calculate it in Python

from fractions import Fraction

# Coefficients of the quadratic function y = ax² + bx + c (a fraction such as 3/4 can be written as Fraction(3, 4))
coef_a = Fraction(2)   # x² coefficient (not 0)
coef_b = Fraction(-8)  # x coefficient
coef_c = Fraction(3)   # constant

vertex_x = -coef_b / (2 * coef_a)                # vertex x-coordinate p = −b/(2a)
vertex_y = coef_c - coef_b ** 2 / (4 * coef_a)   # vertex y-coordinate q = c − b²/(4a)

print(f"Vertex x-coordinate p: {vertex_x}")
print(f"Vertex y-coordinate q: {vertex_y}")
print(f"Vertex form: y = {coef_a} * (x - ({vertex_x}))**2 + ({vertex_y})")
if coef_a > 0:
    print(f"Opens upward, so the minimum is {vertex_y} at x = {vertex_x}")
else:
    print(f"Opens downward, so the maximum is {vertex_y} at x = {vertex_x}")
With the fractions module from the standard library, the calculation stays in exact fractions with no rounding error. This example completes the square on y = 2x² − 8x + 3. Running it shows p = 2 and q = −5 (so y = 2(x − 2)² − 5, with minimum −5). Change the coefficients and run it again.

How to write it in LaTeX and other math languages (copy and paste)

Completing the square (converting to vertex form)
y = a(x − p)² + q
y = a(x - p)^{2} + q
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>y</mi>
    <mo>=</mo>
    <mi>a</mi>
    <msup>
      <mrow><mo>(</mo><mi>x</mi><mo>&#x2212;</mo><mi>p</mi><mo>)</mo></mrow>
      <mn>2</mn>
    </msup>
    <mo>+</mo>
    <mi>q</mi>
  </mrow>
</math>
y = a(x - p)^2 + q
a*(x - p)^2 + q
y := a*(x - p)^2 + q;
y = a*(x - p)^2 + q;
y = a(x - p)^2 + q
\(x\)-coordinate of the vertex (the axis of symmetry)
p = −b/(2a)
p = -\frac{b}{2a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>p</mi>
    <mo>=</mo>
    <mo>&#x2212;</mo>
    <mfrac>
      <mi>b</mi>
      <mrow><mn>2</mn><mi>a</mi></mrow>
    </mfrac>
  </mrow>
</math>
p = -b/(2a)
-b/(2*a)
p := -b/(2*a);
p = -b/(2*a);
p = −b/(2a)
\(y\)-coordinate of the vertex (maximum or minimum value)
q = c − b²/(4a)
q = c - \frac{b^{2}}{4a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>q</mi>
    <mo>=</mo>
    <mi>c</mi>
    <mo>&#x2212;</mo>
    <mfrac>
      <msup><mi>b</mi><mn>2</mn></msup>
      <mrow><mn>4</mn><mi>a</mi></mrow>
    </mfrac>
  </mrow>
</math>
q = c - b^2/(4a)
c - b^2/(4*a)
q := c - b^2/(4*a);
q = c - b^2/(4*a);
q = c − b^2/(4a)

How to have ChatGPT  do the calculation

You are a math assistant for quadratic functions. Do the following calculation by actually running Python, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

Complete the square on the quadratic function y = 2x² − 8x + 3.
Show each of the following:
1. The steps of completing the square (factor out the x² coefficient → add and subtract the square of half the x coefficient → write the perfect square)
2. The vertex form y = a(x − p)² + q, the vertex (p, q) and the axis of symmetry (as reduced fractions)
3. Which way the graph opens (upward or downward), and the maximum or minimum value

In Python, use the fractions module from the standard library to calculate exactly. Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.