# Quadratic Equation Steps Example

Solve a quadratic equation in Calcul.io by calculating the discriminant first, then evaluating the positive and negative roots in separate steps.

## Quadratic equation in steps

Split the quadratic formula into named lines instead of entering one long expression. This example solves **3x² − 4x − 10 = 0**.

```calculio
a = 3
b = -4
c = -10
discriminant = b ^ 2 - 4 * a * c
rootPlus = (-b + sqrt(discriminant)) / (2 * a)
rootMinus = (-b - sqrt(discriminant)) / (2 * a)
```

## How it works

1. Enter the coefficients `a`, `b`, and `c`.
2. Calculate the discriminant once and reuse it in both root lines.
3. Compare `rootPlus` and `rootMinus` as the two possible solutions.

Change one coefficient to explore how the discriminant changes the number and type of roots.

[Back to all Calcul.io examples](https://calcul.io/examples/index.md)
