- Introduction
- What is a quadratic equation?
- Solving by factoring
- Square roots and completing the square
- The quadratic formula
- The discriminant
- Graphing a parabola
- Vertex form and transformations
- Real-world problems
- Choosing a method
- AI and machine learning
- Common mistakes
- Practice problems
- Conclusion
1. Introduction
Linear equations describe steady change. Many real situations are not steady. A ball thrown upward rises quickly, slows, stops and then falls faster and faster. The area of a square grows much faster than its side. A business's profit may rise and then fall as prices climb. These situations are described by quadratic equations, the next rung on the algebra ladder.
A quadratic equation contains a variable raised to the second power, and no higher. That single squared term bends a straight line into a curve called a parabola, and it also changes how we solve: a quadratic can have two solutions, one, or none that are real numbers.
This article covers what quadratics are, the four main ways to solve them, how the discriminant predicts the answer, how to graph a parabola, and how quadratics model motion and area. We finish with an important link to machine learning, where the quadratic shape is the reason many models can be trained reliably.
2. What is a quadratic equation?
A quadratic equation is any equation that can be written in the standard form ax² + bx + c = 0, where a, b and c are numbers and a ≠ 0. If a were zero, the squared term would vanish and we would be back to a linear equation. The number a is the leading coefficient, b the linear coefficient and c the constant term.
The solutions are called roots or zeros. They are the values of x that make the equation true, and they are also the places where the graph of y = ax² + bx + c crosses the x-axis.
| Form | Pattern | What it shows at a glance |
|---|---|---|
| Standard | y = ax² + bx + c | the y-intercept, c |
| Factored | y = a(x − r₁)(x − r₂) | the roots, r₁ and r₂ |
| Vertex | y = a(x − h)² + k | the vertex, (h, k) |
Each form is useful for a different question, and converting between them is a core skill.
3. Solving by factoring
Factoring rests on one fact, the zero product property: if two numbers multiply to zero, at least one of them is zero. So if (x − 2)(x − 3) = 0, then x − 2 = 0 or x − 3 = 0, which gives x = 2 or x = 3. The work is in turning the standard form into a product.
When a = 1, look for two numbers that multiply to c and add to b. For x² + 7x + 12 = 0 we need a pair that multiplies to 12 and adds to 7.
| Factor pair of 12 | Sum | Adds to 7? |
|---|---|---|
| 1 × 12 | 13 | no |
| 2 × 6 | 8 | no |
| 3 × 4 | 7 | yes |
The pair 3 and 4 works, so x² + 7x + 12 = (x + 3)(x + 4) and the roots are x = −3 and x = −4. Always rearrange to zero first. For x² − 5x + 6 = 0 the pair is −2 and −3, giving (x − 2)(x − 3) = 0 and roots 2 and 3. Notice that these roots add to 5 and multiply to 6, which matches −b and c. In general the roots of a quadratic with a = 1 always add to −b and multiply to c, a handy check.
When a ≠ 1, the same idea needs a little more care. For 2x² + 7x + 3 = 0, the numbers must multiply to a × c = 6 and add to 7, which are 1 and 6. Split the middle term: 2x² + x + 6x + 3, then group as x(2x + 1) + 3(2x + 1) = (2x + 1)(x + 3). The roots are x = −1/2 and x = −3.
| Pattern | Factored form | Example |
|---|---|---|
| Common factor | ax² + bx = x(ax + b) | x² − 4x = x(x − 4) |
| Difference of squares | x² − k² = (x − k)(x + k) | x² − 9 = (x − 3)(x + 3) |
| Perfect square | x² + 2kx + k² = (x + k)² | x² + 6x + 9 = (x + 3)² |
4. Square roots and completing the square
If the equation has no linear term, solve it by taking square roots. From x² = 49 we get x = ±7, and we must keep both signs because both 7 and −7 square to 49. From 2x² − 18 = 0, add 18 and divide by 2 to get x² = 9, so x = ±3. The same works when a bracket is squared: (x − 3)² = 16 gives x − 3 = ±4, so x = 7 or x = −1.
Any quadratic can be forced into that shape by completing the square. Take x² + 6x + 5 = 0. The expression x² + 6x is almost a perfect square, and half of 6 squared is 9, so adding 9 completes it.
| Step | Equation | What we did |
|---|---|---|
| 1 | x² + 6x = −5 | move the constant |
| 2 | x² + 6x + 9 = −5 + 9 | add (6/2)² = 9 to both sides |
| 3 | (x + 3)² = 4 | write the left side as a square |
| 4 | x + 3 = ±2 | take square roots |
| 5 | x = −1 or x = −5 | subtract 3 |
Check x = −1: 1 − 6 + 5 = 0. Check x = −5: 25 − 30 + 5 = 0. Both work. Completing the square is slower than factoring, but it always works, and it is how the quadratic formula is derived.
5. The quadratic formula
Doing the completing-the-square steps once, with letters instead of numbers, produces a formula that solves every quadratic: x = (−b ± √(b² − 4ac)) / (2a). The symbol ± means there are two answers, one with a plus and one with a minus.
Use it on 2x² − 4x − 6 = 0. Here a = 2, b = −4 and c = −6. Then b² − 4ac = 16 + 48 = 64, whose square root is 8, so x = (4 ± 8) / 4. That gives x = 3 and x = −1. Check: 2(9) − 12 − 6 = 0 and 2 + 4 − 6 = 0.
Sometimes the square root is not a whole number. For x² + 4x + 1 = 0, b² − 4ac = 16 − 4 = 12, so x = (−4 ± √12) / 2 = −2 ± √3, about −0.27 and −3.73. Leaving the answer as −2 ± √3 is exact, and the decimals are only approximations.
| Equation | a, b, c | b² − 4ac | Roots |
|---|---|---|---|
| 2x² − 4x − 6 = 0 | 2, −4, −6 | 64 | 3 and −1 |
| x² + 4x + 1 = 0 | 1, 4, 1 | 12 | −2 + √3 and −2 − √3 |
| x² − 4x + 4 = 0 | 1, −4, 4 | 0 | 2 (repeated) |
6. The discriminant
The expression under the square root, D = b² − 4ac, is called the discriminant because it discriminates between the possible outcomes before you do any real solving. A positive number has two square roots, zero has one, and a negative number has no real square root.
| Value of D | Number of real roots | The parabola | Example and its D |
|---|---|---|---|
| D > 0 | two | crosses the x-axis twice | x² − 3x + 1, D = 5 |
| D = 0 | one (repeated) | touches the x-axis once | x² − 4x + 4, D = 0 |
| D < 0 | none | never reaches the x-axis | x² + 2x + 5, D = −16 |
When D is negative, the equation still has solutions, but they are complex numbers that involve the square root of −1. For real-world measurements such as time and length we normally treat that case as "no solution."
7. Graphing a parabola
The graph of any quadratic is a parabola, a symmetric U-shaped curve. If a > 0 it opens upward and has a lowest point; if a < 0 it opens downward and has a highest point. A larger size of a makes the curve narrower and a smaller size makes it wider. That turning point is the vertex, and the vertical line through it is the axis of symmetry.
Four features are enough to sketch a parabola. The vertex has x-coordinate x = −b / (2a), and you find its y-coordinate by substituting that value back. The y-intercept is c. The roots, if any, come from solving the equation. The two sides mirror each other across the axis.
For y = x² − 4x + 3, the vertex is at x = 4/2 = 2, where y = 4 − 8 + 3 = −1. The y-intercept is 3 and the roots are 1 and 3, exactly symmetric about x = 2. A table of values confirms the shape.
| x | Calculation | y |
|---|---|---|
| -1 | (-1)² − 4(-1) + 3 | 8 |
| 0 | (0)² − 4(0) + 3 | 3 |
| 1 | (1)² − 4(1) + 3 | 0 |
| 2 | (2)² − 4(2) + 3 | -1 |
| 3 | (3)² − 4(3) + 3 | 0 |
| 4 | (4)² − 4(4) + 3 | 3 |
| 5 | (5)² − 4(5) + 3 | 8 |
8. Vertex form and transformations
Vertex form, y = a(x − h)² + k, makes the graph easy to read because the vertex is simply (h, k). Notice the sign: (x − 2)² moves the vertex to the right by 2, and (x + 2)² moves it left. Adding k lifts the whole curve, and a negative a flips it over.
| Parameter | Change | Effect on the graph |
|---|---|---|
| h | h > 0 | shifts right by h |
| h | h < 0 | shifts left by |h| |
| k | k > 0 | shifts up by k |
| k | k < 0 | shifts down by |k| |
| a | a < 0 | flips the parabola over |
| a | |a| > 1 | narrower |
| a | |a| < 1 | wider |
To convert from standard form, complete the square. For y = x² − 6x + 11, write x² − 6x + 9 + 2, which is (x − 3)² + 2, so the vertex is (3, 2). In the other direction, y = 2(x − 1)² − 3 expands to 2(x² − 2x + 1) − 3 = 2x² − 4x − 1.
9. Real-world problems
A ball is thrown upward from a platform 25 metres high. Its height after t seconds is h = −5t² + 20t + 25. The negative a reflects gravity pulling the ball back down. The vertex gives the peak: t = −20 / (2 × −5) = 2 seconds, at height −20 + 40 + 25 = 45 metres. The ball lands when h = 0, so −5t² + 20t + 25 = 0. Dividing by −5 gives t² − 4t − 5 = 0, which factors as (t − 5)(t + 1) = 0. The root t = −1 is before the throw, so we reject it, and the ball lands after 5 seconds.
| Time t (s) | Calculation | Height h (m) |
|---|---|---|
| 0 | −5(0)² + 20(0) + 25 | 25 |
| 1 | −5(1)² + 20(1) + 25 | 40 |
| 2 | −5(2)² + 20(2) + 25 | 45 |
| 3 | −5(3)² + 20(3) + 25 | 40 |
| 4 | −5(4)² + 20(4) + 25 | 25 |
| 5 | −5(5)² + 20(5) + 25 | 0 |
Quadratics also solve optimisation problems. You have 40 metres of fence to enclose a rectangle. If the width is x, the length is 20 − x, so the area is A = x(20 − x) = −x² + 20x. The vertex is at x = 10, giving a maximum area of 100 square metres, so the best rectangle is a square.
| Width x (m) | Length 20 − x (m) | Area (m²) |
|---|---|---|
| 2 | 18 | 36 |
| 5 | 15 | 75 |
| 8 | 12 | 96 |
| 10 | 10 | 100 |
| 12 | 8 | 96 |
| 15 | 5 | 75 |
| 18 | 2 | 36 |
10. Choosing a method
With four methods available, the question is which to use. A short decision path saves time. Check for the easy cases first, try factoring, and fall back on the formula, which never fails.
| Method | Strength | Weakness |
|---|---|---|
| Square roots | fastest when b = 0 | only works with no linear term |
| Factoring | quick with whole-number roots | not always possible |
| Completing the square | always works; gives vertex form | slower, more steps |
| Quadratic formula | always works, mechanical | easy to slip on signs |
11. AI and machine learning
Quadratics are one of the most important shapes in machine learning because of how models are trained. A model makes predictions, and a loss function scores how wrong they are. The most common choice is squared error, L = (ŷ − y)². For a one-weight model ŷ = wx, that loss is (wx − y)², which is a quadratic in w. Averaged over many data points it is still a quadratic, a single smooth bowl with one lowest point.
That bowl shape is the reason training works so reliably. Because the parabola has exactly one minimum and no other dips, an algorithm that keeps stepping downhill is guaranteed to reach it. This procedure is gradient descent. At each step it moves the weight against the slope of the loss, scaled by a step size called the learning rate.
Take L(w) = (w − 3)² + 2, whose minimum is at w = 3. The slope is 2(w − 3), so each update is w ← w − η · 2(w − 3). Starting at w = 0 with learning rate η = 0.25, every step halves the distance to 3.
| Step | Weight w | Loss L(w) |
|---|---|---|
| 0 | 0 | 11 |
| 1 | 1.5 | 4.25 |
| 2 | 2.25 | 2.5625 |
| 3 | 2.625 | 2.1406 |
| 4 | 2.8125 | 2.0352 |
The learning rate must be chosen well. The distance to the minimum is multiplied by 1 − 2η at every step. If that factor is between −1 and 1 the process converges, and a negative factor means it overshoots the minimum and bounces from side to side.
| Learning rate η | Factor (1 − 2η) | Behaviour |
|---|---|---|
| 0.25 | 0.5 | converges smoothly |
| 0.5 | 0 | lands on the minimum in one step |
| 0.9 | -0.8 | converges, but zigzags across the minimum |
| 1 | -1 | bounces between two values forever |
| 1.1 | -1.2 | diverges, getting worse each step |
Quadratics appear elsewhere in machine learning too. Ridge regularisation adds a quadratic penalty λw² to keep weights small. Variance, the basis of many statistics, is an average of squared deviations. And second-order optimisers approximate a loss locally by a quadratic, because a quadratic can be minimised exactly with the formula x = −b / 2a.
| Algebra | Machine learning |
|---|---|
| parabola | loss curve for squared error |
| vertex (lowest point) | best weight, the minimum loss |
| opens upward (a > 0) | convex loss: one minimum, safe to descend |
| slope at a point | gradient |
| step along the curve | weight update |
| x² term | squared error and quadratic penalties |
12. Common mistakes
| Mistake | Wrong | Right |
|---|---|---|
| Forgetting the second root | x² = 49 → x = 7 | x = ±7 |
| Not rearranging to zero first | x(x − 3) = 4 → x = 0 or x = 7 | x² − 3x − 4 = 0 → x = 4 or x = −1 |
| Dividing away a variable | x² = 3x → x = 3 | x(x − 3) = 0 → x = 0 or x = 3 |
| Sign slip with b | b = −4 → −b = −4 | −b = 4 |
| Expanding a square wrongly | (x + 3)² = x² + 9 | x² + 6x + 9 |
| Skipping the check | trusting the roots | substitute both back in |
13. Practice problems
Try these before looking at the answers.
- Solve x² − 7x + 10 = 0 by factoring.
- Solve x² = 81.
- Solve 2x² + 5x − 3 = 0 with the formula.
- Solve x² + 4x + 1 = 0 and leave the answer exact.
- Find the discriminant of 3x² − 2x + 5 and say how many real roots it has.
- Find the vertex of y = x² + 6x + 5.
- A ball's height is h = −5t² + 10t. When does it return to the ground, and what is its maximum height?
Answers.
- (x − 2)(x − 5) = 0, so x = 2 or x = 5.
- x = ±9.
- b² − 4ac = 25 + 24 = 49, so x = (−5 ± 7)/4, giving x = 1/2 or x = −3.
- D = 12, so x = −2 ± √3.
- D = 4 − 60 = −56, which is negative, so there are no real roots.
- x = −6/2 = −3 and y = 9 − 18 + 5 = −4, so the vertex is (−3, −4).
- −5t(t − 2) = 0, so it lands at t = 2 s. The peak is at t = 1, where h = −5 + 10 = 5 m.
14. Conclusion
Quadratic equations add a single squared term to the linear world, and that term curves the line into a parabola, brings in two solutions instead of one, and makes the discriminant a quick way to predict the outcome. Factoring, square roots, completing the square and the quadratic formula are four tools for the same job, and the formula is the one that never fails.
Beyond the classroom, the parabola models falling objects and best-area designs, and in machine learning its single smooth minimum is what lets models be trained by stepping downhill. With quadratics understood, you are ready for functions in general, where the equations you have studied become rules that turn inputs into outputs.