How do you solve an algebra equation?
Type an algebra equation such as 4(x - 3) + 12 = 15 - 5(x + 6). The page gives every real solution, exactly where it can, and checks each one in the equation as you typed it.
- Solutions
- x = -5/3
Solving 4(x - 3) + 12 = 15 - 5(x + 6) gives x = -5/3.
- As decimals
- x ≈ -1.666666667
- Number of real solutions
- 1
Solutions: x = -5/3. Solving 4(x - 3) + 12 = 15 - 5(x + 6) gives x = -5/3.
How to calculate
Solves an algebra equation in one variable and checks every solution.
Example with the default inputs (Equation 4(x - 3) + 12 = 15 - 5(x + 6)): Solving 4(x - 3) + 12 = 15 - 5(x + 6) gives x = -5/3.
Method: A computer algebra system; each root is checked, and a numeric scan finds any missed.
- Only real solutions; no answer for sin, cos or tan of the variable.
Worked examples
Each example is checked against the calculator on every build.
- Equation 4(x - 3) + 12 = 15 - 5(x + 6) gives Solutions x = -5/3, As decimals x ≈ -1.666666667, Number of real solutions 1.Source: OpenStax College Algebra 2e, 2.2, Ex. 2. https://openstax.org/books/college-algebra-2e/pages/2-2-linear-equations-in-one-variable
- Equation 3/(x - 6) = 5/x gives Solutions x = 15, Number of real solutions 1.
How it works
The algebra calculator finds every real number that makes the two sides of your equation equal. It works in three steps, and shows an answer only when all three agree.
- Algebra. Everything is moved to one side, left − right = 0, and every fraction with the letter in its denominator is multiplied out, so the algebra sees one expression with no such fractions. A computer algebra system (nerdamer, open source) solves that. The algebra runs after you start typing, in the background. If it finds no formula (eˣ = x + 3), the page goes on with the scan alone; if a root it gives fails its own check, the page says "No verified answer".
- Check each root in the equation as typed. A root from the algebra counts only if both sides are real numbers there and either differ by exactly 0 (for an exact root) or change sign across it: left − right has opposite signs at r − h and r + h, with h = 10⁻⁷ × max(1, |r|), and differs by at most 10⁻⁸ × max(1, s) at r, where s is the sum of the sizes of the terms of left − right. A root where a side is not a real number (a denominator of 0, the square root or logarithm of a negative number) is excluded. A root that fails the check is dropped: x = 0 for x² = 2 × 10⁻²⁰ (left − right is −2 × 10⁻²⁰ there, and positive on both sides), and the rounded roots next to 0 for eˣ = x + 1.
- Scan for solutions the algebra missed. The page evaluates left − right at every 0.005 from −10 to 10, then at 120 points per power of ten out to −10¹² and 10¹², and, next to any place where the sides stop being real numbers, at points halving the distance to that edge down to the last digit a computer number holds.
- A sign change is narrowed down by halving 1,100 times; if both sides agree there, that is a solution.
- A point where left − right is exactly 0, next to a nonzero value, is a solution (√(x − 1/3) = 0 at x = 1/3, the edge of its domain).
- Where |left − right| has a local minimum without a sign change (its two neighbouring values both above 10⁻¹⁰⁰ in size, so a function that only fades towards 0, such as e^(2x) far to the left, does not count), the page searches for the lowest point. If left − right crosses 0 there by more than 10⁻¹² × s, there are two solutions, found by halving on each side (x² = 2 × 10⁻²⁰ gives ±1.414213562 × 10⁻¹⁰). If it only reaches within 10⁻¹² × max(1, s) of 0 and the algebra gave no solution there, the page cannot tell a double root from a near miss and says "No verified answer".
- If left − right is 0 to within 10⁻¹⁴ × s at two scan points in a row, the solutions fill an interval (|x| = x for every x ≥ 0), or the equation is an identity (x + 1 = x + 1); the page says "The solutions fill an interval." and lists none.
- If left − right is infinite just past the edge of the domain with the other sign from its value at the edge, a solution lies closer to that edge than a computer number can hold (ln(x) = −1000 at x = e^(−1000)); the page says "No verified answer: a possible solution could not be confirmed."
- A solution the scan finds and the algebra did not give is added as a decimal. A scan solution counts as one the algebra gave when an algebra root lies in the interval where the scan found it.
- One entry per solution. A decimal root (a rounded root from the algebra, or a root from the scan) gives way to an exact root within 10⁻⁷ × max(1, |x|) of it: e^(2x) − 3eˣ + 2 = 0 gives x = 0 and x ≈ 0.6931471806, not the rounded 1.19 × 10⁻¹⁷ the algebra also returns. Two roots within 10⁻¹² × max(1, |x|) of each other count as one. A rounded root from the algebra that passes step 2 is written from its own value: x = 1.0000000005 gives x ≈ 1.000000001.
The same solve model runs the equation solver and the solve for x calculator.
What you can type
- An equation with one = sign, such as 2x + 7 = 19. With no = sign, the page solves expression = 0.
- One variable. Use one lowercase letter as the unknown: x, t, y, and so on. The page solves for whichever letter you use. Two different letters (such as x and y) give no answer. The letter e is Euler’s number, and pi (or π) is π.
- Numbers can have decimals (2.5) and powers of ten (1e-3).
- Operations: + − * / and ^ for powers. Brackets group. A number or bracket next to a letter multiplies: 2x, 3(x + 1).
- Functions: sqrt, cbrt, ln (and log, the same natural logarithm), log10, exp, abs (or |x|), the inverse trig functions asin, acos, atan (arcsin, arccos, arctan also work), sinh, cosh and tanh.
- Not allowed: sin, cos, tan, sec, csc or cot of the unknown. Such equations usually have infinitely many solutions, so the page gives no answer. The same functions of a number, such as sin(1), are fine.
- Only real numbers count. A fractional power with an odd denominator is the real root: x^(1/3) at x = −8 is −2.
How answers are written
- Solutions lists each different real solution once (a double root once), in increasing order, separated by commas:
x = -3, x = -3/4. The letter is the one you used. - A solution the algebra gives exactly is written with =, in the syntax you type: fractions a/b, sqrt(u), powers with ^, with the terms of each solution in the order the algebra gives them:
x = 3/2 - sqrt(29)/2,x = sqrt(29)/2 + 3/2. - A solution with no exact form found is written with ≈ and 10 significant figures:
x ≈ 1.167303978. The page also uses the decimal when the algebra returns a rounded number (a fraction whose denominator, after removing factors 2 and 5, is over 1,000,000, or whose numerator times that denominator is over 10¹²), because such a fraction is not exact. - As decimals repeats every solution with ≈ and 10 significant figures. It appears when at least one exact solution is not a plain whole or decimal number.
- Number of real solutions counts the different real solutions.
- When there is none, Solutions reads no real solution and the count is 0: x + 1 = x + 2 and x² + x + 2 = 0 have none.
What gets no answer
- Equations with sin, cos, tan, sec, csc or cot of the unknown.
- An equation whose solutions fill an interval, or an identity.
- An equation that takes over 3 seconds.
- A root from the algebra that the check rejects is dropped, not shown. A possible solution that the scan finds but cannot confirm (a dip of left − right towards 0 with no sign change, where the algebra gave nothing), or one too close to the edge of the domain to compute, gives "No verified answer".
- Solutions beyond −10¹² or 10¹² are listed only when the algebra finds them.
Assumptions
- Only real solutions; complex solutions are left out.
- Angles are in radians and log is the natural logarithm.
Worked examples by hand
4(x − 3) + 12 = 15 − 5(x + 6) (OpenStax College Algebra 2e, section 2.2, Example 2). Expand both sides: 4x − 12 + 12 = 15 − 5x − 30, so 4x = −5x − 15. Add 5x: 9x = −15, so x = −15/9 = −5/3 ≈ −1.666666667.
3/(x − 6) = 5/x (OpenStax College Algebra 2e, section 2.2, Example 6a). x = 6 and x = 0 make a denominator 0, so they are excluded. Multiply both sides by x(x − 6): 3x = 5(x − 6) = 5x − 30, so 2x = 30 and x = 15. Check: 3/9 = 1/3 and 5/15 = 1/3.
2/(x + 1) − 1/(x − 1) = 2x/(x² − 1) (OpenStax College Algebra 2e, section 2.2, Example 7). Since x² − 1 = (x + 1)(x − 1), the values 1 and −1 are excluded. Multiply by (x + 1)(x − 1): 2(x − 1) − (x + 1) = 2x, so x − 3 = 2x and x = −3. Check: 2/(−2) − 1/(−4) = −3/4, and 2(−3)/8 = −3/4.
Other questions people ask
How does an algebra calculator solve an equation?
It moves everything to one side, clears the fractions, and hands the result to a computer algebra system, which uses the same rules you learn in class: collecting like terms, factoring, the quadratic formula, and inverse operations such as taking a logarithm. The page then puts each solution back into your equation as you typed it and scans the number line for any solution the algebra missed.
Can it solve equations with fractions?
Yes. For 3/(x − 6) = 5/x it multiplies out the denominators, which gives 3x = 5(x − 6), so x = 15. It then rejects any value that makes a denominator 0 in the original equation. In 2/(x + 1) − 1/(x − 1) = 2x/(x² − 1), the values 1 and −1 are excluded, and the only solution is −3.
Why does it show an exact answer and a decimal?
An exact answer such as −5/3 or 3/2 + √29/2 keeps every digit. The decimal, −1.666666667, is easier to compare or to use in a later step. Both describe the same number, and the decimal is rounded to 10 significant figures.
Does it simplify expressions too?
This page solves equations. To simplify an expression such as (x² − 9)/(x² + 4x + 3), use the simplify calculator; to factor a polynomial, use the factoring calculator. The math calculator does all of these from one box.
Can I use a letter other than x?
Yes. Type the equation in any one lowercase letter, such as 3t − 4 = 11 or y² = 49, and the page solves for that letter. Two different letters, such as x + y = 3, give no answer: that needs a value for one of them. The letter e always means Euler’s number, 2.718…
What does "No verified answer" mean?
Every solution is checked before it is shown. If a solution fails the check, if the scan finds a possible solution it cannot confirm, or if the work takes over 3 seconds, the page says "No verified answer" rather than show a list it could not check.