Home › Math & Science › Algebra Calculator

Algebra Calculator

Our free algebra calculator does two jobs in one place: it evaluates expressions that contain x, and it solves simple linear equations of the form ax + b = 0. Type an expression, give x a value, and see the answer with the substitution shown — or solve for x and check your homework in seconds.

Evaluate an expression

Use + − * / ^ and parentheses. You can write 2x or 2*x, and x^2 for x squared.

2x + 3 = 13 when x = 5
Substituting x = 5: 2(5) + 3 = 10 + 3 = 13

Solve a linear equation: ax + b = 0

x = 3
3x − 9 = 0  →  3x = 9  →  x = 9 ÷ 3 = 3

How it works

Algebra is arithmetic with a placeholder. Instead of working with a fixed number, you work with a letter — usually x — that stands for a number you do not know yet, or a number that can change. A phone plan that costs $30 a month plus $0.10 per text is 30 + 0.10x, where x is the number of texts. Change x and the total changes, but the expression stays the same.

Evaluating an expression means putting a real number in place of x and doing the arithmetic. The calculator substitutes your value of x, then follows the order of operations: parentheses first, then powers, then multiplication and division from left to right, then addition and subtraction from left to right. That order is the whole game — it is why 2 + 3 × 4 is 14 and not 20, because the multiplication happens before the addition. The calculator also understands the shorthand every algebra class uses: 2x means 2 times x, and 3(x + 1) means 3 times the whole bracket.

Evaluate: replace x, then follow PEMDAS — Parentheses, Exponents, Multiplication & Division, Addition & Subtraction   •   Solve ax + b = 0: x = −b ÷ a

Solving a linear equation is the reverse job: instead of being given x and finding the answer, you are given the answer (zero, after moving everything to one side) and you have to find x. The method is to undo the operations one at a time, doing the same thing to both sides so the equation stays balanced. For ax + b = 0, add or subtract to get ax alone on one side, then divide by a. The calculator shows each of those steps, so you can follow the reasoning instead of just copying a number.

Two edge cases are worth knowing. If a is zero, the x term disappears, so the equation is either always true (if b is also zero, every value of x works) or never true (if b is not zero, no value of x works). And if the equation has x on both sides, such as 2x + 3 = x + 8, subtract x from both sides first to collect the x terms together — that turns it into the ax + b = 0 form this calculator solves.

Algebra shows up constantly in American daily life, even when nobody calls it algebra. A contractor in Florida pricing a fence at $18 per foot plus a $150 delivery fee is using 18x + 150. A driver in California working out whether a $45 tank of gas at $3.75 a gallon is right is solving 3.75x = 45. Once you can evaluate an expression and solve for x, both of those are thirty-second problems.

Worked example

A bakery in Chicago sells a cake for $2 per slice plus a $3 packaging fee, so the cost of x slices is 2x + 3 dollars. How much do 5 slices cost? Enter the expression 2x+3 and set x = 5.

Step 1 — substitute: 2(5) + 3. Step 2 — multiply first, following the order of operations: 2 × 5 = 10, giving 10 + 3. Step 3 — add: 10 + 3 = 13. Five slices cost $13, and the calculator gives the same answer: 2x + 3 = 13 when x = 5.

Now the equation side. A different bakery charges $3 per cupcake and gives a $9 discount on a bulk box, so the total is 3x − 9. For what number of cupcakes is the total exactly $0? That is 3x − 9 = 0. Add 9 to both sides: 3x = 9. Divide both sides by 3: x = 9 ÷ 3 = 3. Enter a = 3 and b = −9 in the solver and you get x = 3 — three cupcakes exactly cancel the discount.

FAQ

How do you evaluate an algebraic expression?

Replace the variable with its value, then work through the arithmetic using the order of operations: parentheses first, then powers, then multiplication and division, then addition and subtraction. For example, 2x + 3 with x = 5 becomes 2 x 5 + 3 = 10 + 3 = 13.

How do you solve a linear equation ax + b = 0?

Move the constant to the other side and divide by the coefficient of x: x = -b / a. For 3x - 9 = 0, add 9 to both sides to get 3x = 9, then divide by 3 to get x = 3. If a is zero, there is no solution unless b is also zero.

What does 2x mean in algebra?

2x means 2 multiplied by x. When a number sits directly in front of a letter with no symbol between them, multiplication is understood. So 2x with x = 5 is 2 x 5 = 10, and 3x - 9 with x = 3 is 9 - 9 = 0.

What is the order of operations?

The order of operations is parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. It is often remembered as PEMDAS. It is what makes 2 + 3 x 4 equal 14, not 20.

Can this calculator handle parentheses and powers?

Yes. You can use parentheses, the four basic operations, and the ^ symbol for powers, for example (x + 2)^2 or 3*(x - 1) + 5. The calculator follows the order of operations and shows the result after substituting your value of x.