Skip to content
CornerTools

Algebra & Inequality Calculator

Solve equations and inequalities step by step — linear, quadratic, polynomial, rational, square root and absolute value — or simplify an expression.

Or an expression to simplify. Powers ^, sqrt( ), |x|, fractions with /; type ≤ as <= and ≥ as >=.

Type an equation or an inequality and the calculator solves it the way a textbook does, step by step: linear equations with brackets, fractions and decimals, quadratics, polynomials up to degree 6, rational equations, and equations and inequalities with up to two square roots or up to two absolute values, within the limits set out under the method. Every candidate is put back into the equation as typed, and one that does not satisfy it is struck out with the reason, so an extraneous root never slips into the answer.

An inequality is answered three ways, as inequalities, in interval notation and in set-builder form, and drawn on a number line, with the sign chart or test values behind it. Type an expression with no equals sign and it is simplified instead. Everything is worked out in your browser.

How to use it

The field takes one equation (2(x − 3) = x + 4), one inequality with <, ≤, > or ≥ (typed as <= and >= too), a compound inequality such as −3 < 2x + 1 ≤ 7, or an expression. Powers are ^ or ², square roots sqrt( ) or √, absolute values |x|, and a number before a letter or a bracket multiplies it. Decimals are read exactly, so 0.1 is 1/10. The line under the field shows how the input was read; where the grouping could be read two ways, such as x/2x, it says so.

Solve for appears when the input has more than one letter. The other letters are then treated as constants, and an equation linear in the chosen letter is solved for it, with the condition the last division needs: I = Prt for r gives r = I/(Pt), for Pt ≠ 0. log means appears when the input has a bare log, and chooses between ln, the default, and log₁₀.

Two equations separated by a comma are a system, which the Matrix Calculator solves. Exponential, logarithmic and trigonometric equations, and polynomials of degree 7 or more, are past this calculator: it says so, and opens both sides in the Graphing Calculator, where you can see where they meet.

How it works

Linear. Fractions and decimals are cleared by multiplying both sides by the lowest common denominator, the brackets are expanded, the letter's terms are moved to one side and the numbers to the other, and both sides are divided by the coefficient. If the letter cancels, what is left decides it: 0 = 0 is true for every number, and 0 = 7 for none.

Polynomial. Everything is moved to one side and factored over the rationals, by the common factor, special products, the AC method, grouping, and the rational root theorem with a synthetic division for each root found. Each factor is set to 0. A quadratic factor that does not split goes to the quadratic formula, and its roots are given exactly as surds, or as a complex pair when the discriminant is negative. A factor of degree 3 or more with no rational root has its real roots found numerically and given to 10 significant figures, marked ≈.

Rational. First the excluded values: each denominator as typed cannot be 0, even where a factor would cancel. Then both sides are multiplied by the lowest common denominator, and the polynomial left is solved. A candidate that makes a denominator 0 is extraneous.

Square roots and absolute values. A square root is isolated and both sides are squared; with two roots, the second is isolated and squared in turn. |u| = c becomes u = c or u = −c, and |u| = |w| becomes u = w or u = −w; with two absolute values otherwise, each is taken off by the sign of what is inside it, case by case. Squaring and splitting can add solutions the equation does not have, so every candidate is substituted back, exactly where its value is a surd, and the ones that fail are shown struck out.

The calculator takes, and past any of these says which limit was passed:

  • up to two different square roots, not nested one inside another, and never multiplied by each other; a root in a denominator only on its own, as in x/√(x + 1);
  • up to two absolute values, not nested, each with a number in front, and none in a denominator or raised to a power;
  • square roots or absolute values, not both together;
  • rational coefficients and constants: √2 or π is accepted only in a linear equation, solved exactly as x = 2/π, or under one square root of a linear side, as √(πx) = 2 gives x = 4/π;
  • polynomials up to degree 6;
  • square roots only: a cube root, or a power such as x^(1/3) or x^(2/5), is not solved.

Inequalities. A linear inequality is solved like an equation, except that multiplying or dividing both sides by a negative number reverses the sign, a step shown on its own. A polynomial or rational inequality is never multiplied by an expression whose sign is unknown: everything is moved to one side as one fraction, factored, and the zeros of the numerator and the denominator cut the number line into intervals. A test value in each interval gives each factor's sign, and the sign chart keeps the intervals with the sign asked for. The numerator's zeros are included for ≤ and ≥; the denominator's never are. For |u| < c the answer is −c < u < c, and for |u| > c it is u < −c or u > c. Any other inequality with roots or absolute values, within the limits above, is cut where its sides are equal or stop having a value, and tested in each piece.

Quadratic formula: x = (−b ± √(b² − 4ac)) ÷ 2a
|u| = c (c ≥ 0) ⟺ u = c or u = −c
|u| < c ⟺ −c < u < c;  |u| > c ⟺ u < −c or u > c
a < b and k < 0 ⟹ ka > kb

Examples

A linear equation with fractions

Equation
x/3 + 1/2 = (x + 4)/4

The denominators are 3, 2 and 4, so multiplying both sides by 12 clears every fraction. Collecting terms gives x = 6, and putting it back makes both sides 5/2.

  1. Multiply both sides by 12, the lowest common denominator, to clear the fractions: 4x + 6 = 3x + 12
  2. Subtract 3x from both sides: x + 6 = 12
  3. Subtract 6 from both sides: x = 6

A rational equation with an extraneous root

Equation
x^2/(x - 2) = 4/(x - 2)

Multiplying both sides by the denominator leaves a quadratic with two roots. But x = 2 is extraneous: it makes the denominator x − 2 equal 0, so the only solution is x = −2.

  1. A denominator can't be 0, so x ≠ 2
  2. Multiply both sides by the lowest common denominator, x − 2: x² = 4
  3. Move every term to one side: x² − 4 = 0
  4. Difference of squares: a² − b² = (a − b)(a + b): x² − 4 = x² − 2² = (x − 2)(x + 2) ​
  5. Write it in factored form: (x − 2)(x + 2) = 0 ​
  6. Set each factor equal to 0: x − 2 = 0 or x + 2 = 0 x = 2 or x = −2

A square root equation with an extraneous root

Equation
sqrt(x + 3) = x - 3

Squaring both sides gives a quadratic with two roots, but squaring also solves √(x + 3) = −(x − 3). At x = 1, the left side is 2 but the right side is −2: a square root is never negative, so it is struck out, and the answer is x = 6.

  1. Isolate the square root: √(x + 3) = x − 3
  2. Square both sides: x + 3 = (x − 3)²
  3. Move every term to one side: x² − 7x + 6 = 0
  4. AC method: −1 and −6 multiply to ac = 6 and add to b = −7, so the middle term splits in two and the terms group in pairs: x² − 7x + 6 = x² − x − 6x + 6 = x(x − 1) − 6(x − 1) = (x − 6)(x − 1) ​
  5. Write it in factored form: (x − 6)(x − 1) = 0 ​
  6. Set each factor equal to 0: x − 6 = 0 or x − 1 = 0 x = 6 or x = 1

A cubic by the rational root theorem

Equation
x^3 - 2x^2 - 5x + 6 = 0

A rational root p/q has p dividing the constant term and q the leading coefficient. Candidates: ±1, ±2, ±3, ±6. The first candidate that is a root is divided out by synthetic division, the quadratic left is factored by the AC method, and x = −2, x = 1 or x = 3.

  1. Rational root theorem: a rational root p/q of f(x) = x³ − 2x² − 5x + 6 has p dividing 6 and q dividing 1 Candidates: ±1, ±2, ±3, ±6
  2. Factor theorem: f(1) = 0, so x − 1 is a factor. Synthetic division by x − 1 gives the other: x³ − 2x² − 5x + 6 = (x − 1)(x² − x − 6) ​
  3. AC method: 2 and −3 multiply to ac = −6 and add to b = −1, so the middle term splits in two and the terms group in pairs: x² − x − 6 = x² + 2x − 3x − 6 = x(x + 2) − 3(x + 2) = (x − 3)(x + 2) ​
  4. Write it in factored form: (x − 3)(x − 1)(x + 2) = 0 ​ ​
  5. Set each factor equal to 0: x − 3 = 0 or x − 1 = 0 or x + 2 = 0 x = 3 or x = 1 or x = −2

A quadratic inequality by a sign chart

Inequality
x^2 - x - 6 > 0

It factors as (x − 3)(x + 2) > 0, so the sign can change only where a factor is 0. A test value in each interval gives the sign of each factor, and the product is positive on x < −2 or x > 3, which is (−∞, −2) ∪ (3, ∞) in interval notation.

Sign chart

Intervalx − 3x + 2(x − 3)(x + 2)> 0?
x < −2test x = −3−−+Yes
x = −2−00No
−2 < x < 3test x = 1−+−No
x = 30+0No
x > 3test x = 4+++Yes

Inequalities in interval notation

Each answer as the calculator writes it, with its number line
InequalityAnswerInterval notationSet-builderNumber line
x > 2x > 2(2, ∞){x | x > 2}an open dot at 2, shaded to the right
x ≥ 2x ≥ 2[2, ∞){x | x ≥ 2}a filled dot at 2, shaded to the right
x < 2x < 2(−∞, 2){x | x < 2}an open dot at 2, shaded to the left
−1 < x ≤ 3−1 < x ≤ 3(−1, 3]{x | −1 < x ≤ 3}open at −1, filled at 3, shaded between
−1 ≤ x ≤ 3−1 ≤ x ≤ 3[−1, 3]{x | −1 ≤ x ≤ 3}filled dots at −1 and 3, shaded between
x² − 2x − 3 > 0x < −1 or x > 3(−∞, −1) ∪ (3, ∞){x | x < −1 or x > 3}open dots at −1 and 3, shaded outward
x² + 1 > 0All real numbers(−∞, ∞){x | x ∈ ℝ}the whole line
x² + 1 < 0No solution∅∅nothing shaded

Frequently asked questions

Squaring both sides, splitting an absolute value or multiplying by a denominator can produce numbers that solve the new equation but not the one you typed. Such an extraneous root makes a denominator 0, or gives two sides that differ, such as a square root equal to a negative number. The calculator substitutes every candidate back and shows the rejected ones struck out, with the reason.
When the letter cancels, what is left is either always true, such as 0 = 0, so every number solves it, or always false, such as 0 = 7, so none does. With a denominator, “every number” leaves out the values that make it 0: (x² − 4)/(x − 2) = x + 2 holds for all real numbers except 2.
A filled dot, or a square bracket in interval notation, means the endpoint is included: ≤ and ≥. An open dot, or a round bracket, means it is not: < and >, and always at a value a denominator makes undefined. Infinity always takes a round bracket.
“or” joins separate pieces, either of which will do: x < −2 or x > 3 is the union (−∞, −2) ∪ (3, ∞). A compound inequality such as −2 < x ≤ 3 means both at once, the overlap of x > −2 and x ≤ 3.

See also