A Solver for a Quadratic Equation

This page contains a routine that solves a Quadratic Equation. It is written in JavaScript, so make sure that JavaScript is enabled in your browser.

Once the problem is arranged into the following form (a, b, and c are known constants), the equation can be solved for values of x that satisfy the equation.

a x 2 + b x + c = 0

Since the equation is a second degree equation (the equation's highest power is two), there will be two solutions, output as x1 and x2.

This utility is not required if a = 0. However, if for some reason 0 is input for a, only one solution exists, output as x1. In this case, x2 is meaningless.

Input the values for a, b, and c below, and then click the "Calculate Solutions" button to have the results calculated.

a: b: c:

The solutions are:

x1: +   i
x2: -   i

NOTE: The solutions may include a non-zero imaginary component, as indicated by the "i" field.

Return to Math Functions Page

Return to Thothworks Home Page