# Cubic Equation Calculator

Created by Anna Szczepanek, PhD
Reviewed by Wojciech Sas, PhD and Jack Bowater
Last updated: Feb 10, 2023

Welcome to Omni's cubic equation calculator! Whenever you need to determine the roots of a cubic equation or find the equation of a cubic graph, don't hesitate to shamelessly use this cubic equation solver! Our calculator can also plot graphs of cubic polynomials!

Need to learn what a cubic equation is? Looking for the cubic equation formula? Wonder how to solve cubic equations, or rather how to write a cubic equation from a graph? Scroll down to find a concise & precise article explaining what the solution of a cubic equation looks like and how to factorize a cubic equation. We've included a bunch of cubic equation examples as well!

## What is a cubic equation?

Recall that a polynomial is an algebraic expression of the form

$\scriptsize a_n x^n + a_{n-1} x^{n-1} + ... + a_2 x^2 + a_1 x + a_0$

where $a_n,..., a_0$ are called coefficients. We assume that the coefficients are real numbers.

Examples of polynomials are:

• $3x + 5$;
• $x^2 + 5x - 2$;
• $2x^3 + x^2 - x + 3$.

The largest number $n$ such that $a_n \not = 0$ is called the degree of the polynomial. The degrees of the above examples are: $1, 2$ and $3$, respectively.

A polynomial of degree $3$ is called a cubic polynomial. And a cubic equation is the equation saying that a cubic polynomial is equal to zero:

$\scriptsize a_3 x^3 + a_2 x^2 + a_1 x + a_0 = 0,$

or, using the notation from our cubic equation calculator:

$\scriptsize ax^3 + bx^2 + cx + d = 0.$

Cubic equations appear in many different areas of maths and science. For instance:

• The characteristic polynomials of a 3×3 matrix are the roots of a cubic polynomial.

• Cubic regression is a statistical model that uses a cubic polynomial to describe relationships in data sets.

## What are the roots of a cubic equation?

A root of a cubic equation is every argument $x$ that satisfies this cubic equation.
For instance, $2$ is a root of

$x^3 - 8 = 0$

because

$2^3 - 8 = 8 - 8 = 0$.

It follows from the fundamental theorem of algebra that every cubic equation has exactly three complex roots. Some of these roots, however, may be equal. For instance, the equation

$x^3 = 0$

has a root $0$ with multiplicity three.

A cubic equation always has at least one real root. The other two roots might be real or complex. In the latter case, they are a pair of conjugate numbers, i.e., their real parts are equal, and their imaginary parts have opposite signs. For instance, the other two roots of

$x^3 - 8 = 0$

are $-1 + 1.73205i$ and $-1 - 1.73205i$.

In general, finding the roots of cubic equations may be challenging. It's definitely more complicated than in the case of quadratic trinomials, where we have the well-known quadratic formula. Fortunately, there's Omni's cubic equation calculator, which can find the roots of any cubic equation in no time!

## How to use this cubic equation calculator?

We've designed this cubic equation calculator to be as intuitive to use as possible! Here's a brief instruction on how to use it most effectively:

1. Enter the coefficients of the cubic equation you want to solve.

2. The roots appear beneath the cubic equation calculator. These are the solutions to your cubic equation!

3. You will also see the discriminant of your cubic equation.

Discriminants encode some important information about the properties of cubic polynomials. See below for details.

4. At the very bottom of this cubic equation solver, you will also find the graph of your cubic polynomial. You can even adjust the portion of the x-axis covered by the plot!

## How to solve a cubic equation by hand?

If you are somehow able to determine one root, then finding the other two poses no problem since your task reduces to solving a quadratic equation, which you can do either by factoring (as in the factoring trinomials calculator) ​or by using the quadratic formula.

Here's how to perform this reduction. Assume you have found a root $q$. Then you need to divide your cubic polynomial by $x - q$ to arrive at a quadratic polynomial. To perform the division, you may want to use the method described in the synthetic division calculator.

But how to find the initial root? Well, there are no easy and 100% successful recipes. If your polynomial has rational coefficients, try performing the rational root test (or use the rational zeros calculator to do it for you). Should the polynomial have a rational root, this method will find it. You may also try plotting the polynomial and guessing its root from the graph. If you don't succeed, use the cubic equation formula, which is not the most user-friendly method in mathematics but always yields the correct result!

## What is the cubic equation formula?

The cubic equation formula allows you to compute the roots of a cubic polynomial. It uses the polynomial coefficients, the four basic arithmetic operations (addition, subtraction, multiplication, division), the square root, √, and the cube root, ∛.

Let us consider the equation:

$\scriptsize ax^3 + bx^2 + cx + d = 0$

where $a_n \not = 0$. Its roots are:

$\scriptsize x_1 = S + T - \frac{b}{3a}$
$\scriptsize x_2 = -\frac{S+T}{2} + (S-T)i\frac{\sqrt{3}}{2} - \frac{b}{3a}$
$\scriptsize x_3 = -\frac{S+T}{2} - (S-T)i\frac{\sqrt{3}}{2} - \frac{b}{3a}$

where:

$\scriptsize S = \sqrt[3]{R + \sqrt{Q^3 + R^2}}$
$\scriptsize T = \sqrt[3]{R - \sqrt{Q^3 + R^2}}$

and:

$\scriptsize Q = \frac{3ac - b^2}{9a^2}$
$\scriptsize R = \frac{9abc - 27a^2 d - 2b^3}{54a^3}$

💡 This method is also known as the Cardano formula as it was published by Gerolamo Cardano in 1545. It is believed that this formula was first derived by Scipione del Ferro.

## Discriminant of a cubic equation

The discriminant of our cubic equation is given by the following formula:

$\scriptsize \Delta = b^2 c^2 - 4ac^3 - 4b^3 d - 27a^2 d^2 + 18abcd.$

💡 Did you know that Δ can tell us a lot about a polynomial and its solutions even before we actually find them? If not, check the discriminant calculator to learn more about it!

It turns out that the expression $Q^3 + R^2$ is closely related to the discriminant.
Indeed, by direct calculation, we obtain

$\scriptsize Q^3 + R^2 = \frac{-\Delta}{108a^4}$

In particular, the sign of $Q^3 + R^2$ is opposite to that of the discriminant.

The sign of $\Delta$ provides us with some knowledge about the roots of our polynomial. Namely:

• If $\Delta > 0$, then the polynomial has three distinct real roots.

• If $\Delta< 0$, then the polynomial has one real root and two non-real complex conjugate roots.

• If $\Delta = 0$, then the polynomial has three real roots, and at least two of them are equal.

• If $b^2 = 3ac$, then the polynomial has a triple root:

$x_1 = x_2 = x_3 = \frac{-b}{3a}$

• If $b^2 \not = 3ac$, then the polynomial has a double root:

$x_1 = x_2 = \frac{9ad - bc}{2b^2 - 6ac}$

and a simple root:
$x_3 = \frac{4abc - 9a^2 d - b^3}{ab^2 - 3a^2 c}$

Therefore, if you only need to know, for instance, whether a given cubic equation has three real roots, and you don't need the exact values of these roots, just calculate the discriminant and not the whole of the Cardano formula – you're gonna save a lot of time⏰!

## Cubic equation – examples

#### Example 1

Find the roots of the cubic equation $x^3 - 4x^2 + 4x = 0$.

Solution:

We can factor out $x$:

$x^3 - 4x^2 + 4x = x(x^2 - 4x + 4)$.

This means that $x = 0$ is one of the roots!

In order to find the other two roots, we need to factor the trinomial

$x^2 - 4x + 4$

After a moment of thought, we can recognize here the short multiplication formula

$(a-b)^2 = a^2 - 2ab + b^2$

with $a = x$ and $b = 2$. That is, we have

$x^2 - 4x + 4 = (x-2)^2$

Therefore, the two roots we've been looking for are both equal to $2$. We can also say that $2$ is a double root of our equation.

We can now answer the question, "How to factorize the cubic equation $x^3 - 4x^2 + 4x = 0$ ?" Namely, the factorization reads:

$x^3 - 4x^2 + 4x = x(x-2)^2$.

#### Example 2

Find the roots of the cubic equation $x^3 + 2x^2 + 3x + 2= 0$.

Solution:

The rational root test tells us that $-1$ is a root of our polynomial. This means that this polynomial is divisible by $(x + 1)$. We perform the division, using, e.g., synthetic division, and obtain:

$\frac{x^3 + 2x^2 + 3x + 2}{x+1}= x^2 + x + 2$.

It remains to factor the quadratic trinomial $x^2 + x + 2$. We use the quadratic formula to deduce that its roots are (approximately) equal to $-0.5 - 1.323i$ and $-0.5 + 1.323i$.

#### Example 3

Find the roots of the cubic equation $x^3 - 2x^2 - 3x + 2= 0$.

This time, the rational root test says that our polynomial has no rational roots. We will finally make use of the Cardano formula! Here it is, in all its glory:

We start by computing:

$Q = \frac{3 \cdot 1 \cdot (-3) - (-2)^2}{9 \cdot 1^2} = -\frac{13}{9}$

$R = \frac{9 \cdot 1 \cdot (-2) \cdot (-3) - 27 \cdot 1 \cdot 2 - 2 \cdot (-2)^3}{54 \cdot 1^3} = \frac{8}{27}$

and then:

$S \approx 1.07347 + 0.54047i$

$T \approx 1.07347 - 0.54047i$.

Finally, the roots of our cubic equation are:

$x_1 \approx 2.81361$

$x_2 \approx -1.34292$

$x_3 \approx 0.52932$

Observe that, even though $S$ and $T$ are complex, all three roots are real!

You can use our cubic equation calculator to generate many more examples and become the master of cubic polynomials 🥇!

## FAQ

### How do I write a cubic equation from a graph?

The roots of a cubic equation correspond to the points where the graph of the cubic polynomial crosses the horizontal axis. However, this method is not very precise! You should rather treat these points as guesses and verify them algebraically. If your graph appears to cross the x-axis at q, try dividing your cubic polynomial by x- q. If there is no remainder, then q is indeed a root. Otherwise, it's not.

### How do I factorize cubic equations?

To factorize a cubic equation, you need to know its roots. If these roots are
x₁, x₂, x₃, then the factorization reads a(x - x₁)(x - x₂)(x - x₃), where a is the leading coefficient of your polynomial. To find the roots, use the cubic equation formula (Cardano formula).

### How do I solve a cubic equation by hand?

Solutions to a cubic equation, i.e., the roots of a cubic polynomial, are given by the Cardano formula. If you already know one of the roots, say q, then factor out the corresponding binomial x - q and use the quadratic formula.

### How do I find a cubic equation when roots are given?

It's straightforward to find a cubic equation when roots are given!

1. Assume these roots are x₁, x₂, x₃.

2. Write down the product (x - x₁)(x - x₂)(x - x₃).

3. Perform the standard polynomial multiplication.

4. You have just obtained the desired cubic polynomial! Well done! :)

5. Tip: you can adjust the resulting polynomial to your needs by multiplying it by any number you wish. The roots will stay the same!