HomeMathematics & Algebra ToolsAlgebra Calculator & Algebra Solver with Steps (Free)

Algebra Calculator & Algebra Solver with Steps (Free)

Algebra Calculator

A free algebra calculator with steps and algebra solver. Type any expression, equation, inequality or system and get the exact answer, every step, a graph and a check. It simplifies, expands, factors, solves for x, puts lines in standard form, adds algebraic fractions and finds matrix rank.

Algebra SolverAlgebra 1 & 2Step by StepExact FractionsFactor & SimplifySolve for xFree

By StatsUnlock Team · Last updated 17 October 2026

⚡ 0. Quick Answer

An algebra calculator, also called an algebra solver, simplifies expressions, factors polynomials and solves equations step by step, keeping every answer as an exact fraction or surd.

Example: 2(3x − 5) = 4x + 6. Expand to 6x − 10 = 4x + 6, move terms to get 2x = 16, then divide by 2: x = 8.

ax + b = c  ⇒  x = (c − b) ÷ a

Rule of thumb: always check by substituting back. With x = 8, the left side is 2(24 − 5) = 38 and the right side is 32 + 6 = 38, so the answer is correct.

🔑 Key Takeaways

  • This algebra calculator and algebra solver handles 9 jobs in one box: simplify, expand, factor, solve, evaluate, inequalities, systems, standard form and matrix rank.
  • To solve a linear equation, do the same operation to both sides until x stands alone: 2x = 16 gives x = 8.
  • A quadratic has two, one or no real roots when the discriminant b² − 4ac is positive, zero or negative.
  • When you multiply or divide an inequality by a negative number, flip the sign: −2x ≤ 4 becomes x ≥ −2.
  • Never divide both sides by x: in x² = 9x that throws away the root x = 0. Factor instead: x(x − 9) = 0.

📚 1. What Is an Algebra Calculator?

An algebra calculator is a tool that works with letters as well as numbers. A normal calculator can only tell you that 3 × 4 = 12. An algebra calculator can tell you that 3(x + 4) = 3x + 12, that x² − 9 = (x − 3)(x + 3), and that 3x + 12 = 0 when x = −4.

Many students search for it as an algebra solver: the name is different, but the job is the same. You type the problem, and the solver finds the unknown and shows the working.

What it is used for: checking homework, building answer keys, learning the method from the steps, and getting an exact result fast. The letters stand for unknown numbers. The job of algebra is to find them, or to rewrite an expression in a simpler or more useful shape.

A worked one-liner: for 2(3x − 5) = 4x + 6, the calculator expands the bracket to 6x − 10, collects the x terms to get 2x = 16, divides to get x = 8, and then checks that both sides equal 38.

Graph of y = 2(3x minus 5) and y = 4x + 6 crossing at x = 8Two straight lines, the left side in blue and the right side in orange, meeting at the point (8, 38), which is the solution of the equation.024681001020304050(8, 38)
Solving an equation is the same as finding where two graphs meet. The lines y = 2(3x − 5) and y = 4x + 6 cross at x = 8, where both equal 38.

Who uses it: pre-algebra students (Grades 6 to 8) checking fractions and one-step equations; Algebra 1 students (Grades 8 and 9) solving linear equations, inequalities and systems; Algebra 2 students (Grades 10 and 11) factoring polynomials and solving quadratics with complex roots; IGCSE, GCSE, CBSE, SAT and ACT candidates; first-year university students in linear algebra; tutors and teachers building answer keys; and parents checking homework.

JobWhat it doesExampleUse it when
SimplifyExpands brackets and combines like terms3(x + 2) − 2(x − 4) = x + 14An expression is long or messy
FactorWrites a polynomial as a product6x² + 11x − 35 = (2x + 7)(3x − 5)You need the roots, or to cancel a fraction
SolveFinds the value of the letter that makes an equation true2(3x − 5) = 4x + 6 gives x = 8There is an = sign and one unknown
InequalityFinds every value that makes it true3 − 2x ≤ 7 gives x ≥ −2There is <, >, ≤ or ≥
SystemSolves several equations together2x + 3y = 12, x − y = 1 gives (3, 2)There are two or more unknowns
Standard formRewrites a line as Ax + By = Cy = 23x − 4 gives 2x − 3y = 12A teacher asks for standard form
Matrix rankCounts independent rows by row reduction[[1, 2], [2, 4]] has rank 1Linear algebra and systems

🧮 2. Enter Your Problem

Letters
Powers
Operations
Relations
Numbers
Edit

Type it the way you write it: 2x means 2 × x, x^2 means x², and 1/(x + 2) needs brackets around the bottom. Separate the equations of a system with commas. For a matrix type rank [[1,2],[3,4]].

Teachers use this to build an answer key: paste or upload many problems, press Solve, then Download Doc gives every answer with its full working.

📊 3. Results and Step-by-Step Solution

Answer
___
Press Solve to see the exact answer, the decimal answer and every step.

🧠 4. Understanding Your Answer, In Detail

___ Solve a problem above to fill this box with an explanation of your own answer.

4.1 What the answer means

A solution is a number that makes the equation true. For 2(3x − 5) = 4x + 6 the answer x = 8 means that if you put 8 in place of x, both sides give the same number, 38. Any other number gives two different sides. A simplified expression is different: it is not a number at all, but a shorter way of writing the same thing. 3(x + 2) − 2(x − 4) and x + 14 give the same value for every x you try.

4.2 What the solution type tells you

A linear equation (highest power 1) has exactly one solution, no solution, or every number as a solution. If the x terms cancel and leave something false like 6 = 5, there is no solution. If they cancel and leave something true like 6 = 6, the equation is an identity and every x works. A quadratic (highest power 2) can have two different roots, one repeated root, or two complex roots. The discriminant b² − 4ac decides which.

4.3 Exact answers versus decimals

The calculator keeps every number exact. It turns 0.75 into 34 before it starts, so 0.1 + 0.2 gives exactly 310, not 0.30000000000000004. Roots that are not whole numbers stay as surds, for example 3 ± √174. Teachers usually want the exact form. Use the decimal only when the question says “to 2 decimal places” or when the number is a measurement.

4.4 How to check the answer yourself

Substitute the answer into the original equation, not into one of your working lines, because a mistake in an early line would carry through. For a factorisation, multiply the brackets back out. For a simplified expression, put in a simple number like x = 2 in both the original and the answer. If the two values match, you are almost certainly right. The green Verified badge means the calculator has done this check exactly.

4.5 What the graphs show

Chart 1 draws the expression as a curve. Its x-intercepts (where the curve crosses the horizontal axis) are the roots. Chart 2 draws the left side and the right side as two separate curves; the solution is where they meet. Chart 3 places every root on the complex plane: real roots sit on the horizontal axis, and complex roots appear as a mirror pair above and below it. Chart 4 shows the size and sign of each coefficient.

4.6 Excluded values and extraneous roots

When an equation has x in a denominator, some values are banned because they would divide by zero. In xx − 2, x cannot be 2. If clearing the fractions produces x = 2 as an answer, that root is extraneous: it came from the algebra, not from the original equation. The calculator lists excluded values first and crosses out any extraneous root.

4.7 How the answer changes if you change the numbers

For ax + b = c the solution is x = (c − b) ÷ a. Raising c by 1 raises x by 1 ÷ a. So when a is small, x is very sensitive to the other numbers, and when a is 0 the equation stops being solvable for x at all. For a quadratic, a small change in c moves the parabola up or down. That can turn two roots into one repeated root and then into a complex pair.

4.8 Where this leads next

Linear equations lead to systems of equations and to graphs of straight lines. Factoring leads to solving quadratics, cancelling algebraic fractions and finding the zeros of polynomials. Matrix rank leads into linear algebra. If your answer here came out as a quadratic, the natural next step is the quadratic formula; if it came out as two unknowns, the next step is a system of equations.

✍ 5. How to Write the Answer

▶ Solve a problem above to fill all five cards with your own answer.

Card 1, Exam or homework working
___
📌 Conventions
  • Write one step per line and keep the = signs lined up.
  • Show the substitution check at the end; many mark schemes give a mark for it.
  • Box or underline the final answer.
Card 2, Final answer only
___
📌 Conventions
  • Two roots: write x = −1 or x = 3, or the set {−1, 3}.
  • Inequalities: give both x ≥ −2 and the interval [−2, ∞) if the question does not say which.
  • Leave surds and fractions exact unless decimals are asked for.
Card 3, Teacher's answer key line
___
📌 Conventions
  • Give the answer and the one key step that earns the method mark.
  • List accepted equivalent forms, such as 0.5 for 12.
Card 4, Report or lab write-up sentence
___
📌 Conventions
  • State the equation, the method and the result in one sentence.
  • Give decimals to the precision of your measurements, usually 2 to 4 places.
Card 5, Plain text for a forum or chat
___
📌 Conventions
  • Use ^ for powers, sqrt() for roots and brackets around every numerator and denominator.
  • Write 3/(2x) rather than 3/2x, which many readers take as (3/2)x.

∑ 6. Formulas Used

①
Linear Equation Solution
ax + b = c  ⇒  x = (c − b) ÷ a
aCoefficient of x after collecting x terms on one side, a real number, a ≠ 0
b, cThe constant terms on the left and right sides
xThe unknown, the value that makes both sides equal
Example6x − 10 = 4x + 6 ⇒ 2x − 10 = 6 ⇒ x = (6 + 10) ÷ 2 = 8
NoteIf a = 0 there is no solution (b ≠ c) or every x works (b = c)
②
Distributive Property (Expanding Brackets)
a(b + c) = ab + ac    −(b − c) = −b + c
aThe number or term outside the bracket, multiplied by every term inside
b, cThe terms inside the bracket
Example2(3x − 5) = 6x − 10;   −2(x − 4) = −2x + 8
RuleA minus in front of a bracket changes the sign of every term inside
③
Quadratic Formula
x = (−b ± √(b² − 4ac)) ÷ 2a
a, b, cCoefficients of ax² + bx + c = 0, real numbers, a ≠ 0
xThe two roots, one for + and one for −
RequiresThe equation rearranged so one side is 0
Example2x² − 3x − 1 = 0 ⇒ x = (3 ± √17) ÷ 4
NoteThe whole numerator is divided by 2a, not only the √ part
④
Discriminant
D = b² − 4ac
D > 0Two different real roots (rational if D is a perfect square)
D = 0One repeated real root, x = −b ÷ 2a
D < 0No real roots; two complex roots p ± qi
Examplex² + 2x + 5: D = 4 − 20 = −16, so x = −1 ± 2i
⑤
Factoring Patterns
a² − b² = (a − b)(a + b)   a² ± 2ab + b² = (a ± b)²   a³ − b³ = (a − b)(a² + ab + b²)
a, bAny terms, numbers or letters
Example4x² − 12x + 9 = (2x − 3)²;   x³ − 8 = (x − 2)(x² + 2x + 4)
RuleAlways take out the greatest common factor first: 2x³ − 8x = 2x(x − 2)(x + 2)
Notea² + b² does not factor over the real numbers
⑥
Check by Substitution, and Sum and Product of Roots
LHS(x₀) = RHS(x₀)    x₁ + x₂ = −b ÷ a    x₁x₂ = c ÷ a
x₀Your answer, put back into the original equation
x₁, x₂The two roots of ax² + bx + c = 0
Examplex = 8: 2(3 × 8 − 5) = 38 and 4 × 8 + 6 = 38 ✓
Use forChecking quadratic roots in 10 seconds without substituting
⑦
Standard Form and Slope-Intercept Form of a Line
Ax + By = C  ⇔  y = mx + b,   m = −A ÷ B,   b = C ÷ B
A, B, CIntegers with no common factor, A ≥ 0
mSlope, the rise for every 1 unit to the right
bThe y-intercept, where the line crosses the y axis
Exampley = (2/3)x − 4 ⇒ 2x − 3y = 12

🔀 7. Algebra Equation Flowchart, Step by Step

This flowchart shows how the algebra solver in this calculator works through a linear equation step by step, from the raw problem to a checked answer. Every box uses the same worked example as the Excel, R, Python and by-hand sections: 2(3x − 5) = 4x + 6.

Start or result Data step Calculation step Yes or no check
Start An equation with one unknown 2(3x − 5) = 4x + 6
CheckAre there brackets or fractions?
YesExpand the brackets (or multiply by the common denominator) first. Here there is a bracket.
NoGo straight to collecting terms.
1
Expand the brackets a(b + c) = ab + ac 2 × 3x − 2 × 5 = 6x − 10, so 6x − 10 = 4x + 6
2
Subtract 4x from both sides collect x terms on the left 6x − 4x − 10 = 6 ⇒ 2x − 10 = 6
3
Add 10 to both sides move the numbers to the right 2x = 6 + 10 = 16
CheckIs the coefficient of x zero?
NoHere it is 2, so you can divide. Carry on.
Yes, stop0 = 0 means every x works (identity). 0 = 5 means no solution.
4
Divide both sides by the coefficient x = 16 ÷ 2 x = 8
5
Substitute into the original equation LHS = 2(3 × 8 − 5),   RHS = 4 × 8 + 6 LHS = 2 × 19 = 38, RHS = 32 + 6 = 38
CheckDo both sides match?
Yes38 = 38, so the answer is correct.
No, stopGo back and look for a sign error, usually when a term crossed the = sign.
Result x = 8 One solution Verified 38 = 38 Solution set {8}. Graphically, the lines y = 6x − 10 and y = 4x + 6 meet at (8, 38).

Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return x = 8 with both sides equal to 38. Section 14 shows the same working by hand.

📝 8. How to Use This Calculator

  1. Type your problem or pick a sample. Enter an expression, equation, inequality, system or matrix in the box, or choose one of the 10 sample problems.
  2. Use the keypad on a phone. The keys add x, y, powers, brackets, the = sign and the inequality signs without hunting for symbols.
  3. Choose what to do. Leave the mode on Auto detect, or pick Simplify, Factor, Solve, Inequality, System, Standard form, Evaluate or Matrix rank.
  4. Set the letter to solve for. If the equation has more than one letter, type the one you want in the Solve for box, for example x in ax + b = c.
  5. Add values to evaluate. For Evaluate mode, type values like x = 2, y = -1 in the Evaluate at box.
  6. Choose decimal places and answer form. Pick 2, 4, 6 or 10 decimal places, and exact and decimal or decimal only.
  7. Press Solve. Nothing is calculated until you press Solve or Enter. Changing the sample clears the old results.
  8. Read the answer and the steps. The green box gives the exact answer first, then the decimal, the solution type and a Verified badge.
  9. Check the four charts. They show the graph, both sides of the equation, the roots and the coefficients.
  10. Copy or download the working. Section 5 gives five ready-to-copy answer formats, and Download Doc or Download PDF saves every step.

📈 9. How to Solve Algebra Equations in Excel

Excel has no “solve for x” button and no symbolic algebra, so it cannot simplify or factor. It can still solve equations in three reliable ways: write the two sides as formulas and use Goal Seek, use the coefficient formula for a linear equation, or type the quadratic formula. Matrix functions solve systems. Every example uses the headline equation 2(3x − 5) = 4x + 6, and every route gives x = 8.

The whole thing in one line: collect the x terms and numbers yourself, then type =(6+10)/(6-4). Excel returns 8. For any linear equation ax + b = c this is =(c-b)/a.

9.1 The functions you need

You wantExcel function or toolNote
Solve any one-unknown equationData → What-If Analysis → Goal SeekSet the difference cell to 0 by changing the x cell
Linear equation ax + b = c=(C2-B2)/A2Fails with #DIV/0! when a = 0
Quadratic roots=(-B2+SQRT(B2^2-4*A2*C2))/(2*A2)Brackets around 2*A2 are essential
Complex roots=IMSQRT(B2^2-4*A2*C2)Returns text like 0+4i; use IMSUM, IMDIV
System of equations=MMULT(MINVERSE(A2:B3),C2:C3)Fails with #NUM! when the matrix is singular
Determinant=MDETERM(A2:B3)0 means no unique solution
Polynomial fit or many roots=LINEST or the Solver add-inSolver handles several unknowns at once
Exact fraction displayFormat Cells → Fraction → Up to three digitsDisplay only; Excel still stores a decimal
The RANK trap. Excel's RANK function sorts numbers in a list. It does not find the rank of a matrix. Excel has no matrix rank function; use the row reduction in this calculator, R's qr(M)$rank or Python's Matrix.rank().

9.2 Step by step

1 Write each side of the equation as a formula

Put a trial value of x in A2 (any number, 0 is fine). In B2 type the left side, in C2 the right side, and in D2 their difference.

=2*(3*A2-5)=4*A2+6=B2-C2
Xalgebra.xlsx - ExcelD2fx=B2-C2ABCD1xLHS 2(3x-5)RHS 4x+6LHS - RHS20-106-16

With x = 0 in A2, the left side is −10, the right side is 6 and the difference in D2 is −16. We want D2 to be 0.

2 Use Goal Seek to make the difference zero

Choose Data → What-If Analysis → Goal Seek. Set cell D2, To value 0, By changing cell A2. Press OK.

Xalgebra.xlsx - ExcelA2fx8ABCD1xLHS 2(3x-5)RHS 4x+6LHS - RHS2838380

Goal Seek changes A2 to 8. Both sides now read 38 and the difference is 0, which is the check.

3 Or use the exact formula for a linear equation

After expanding, 6x − 10 = 4x + 6. Put the x coefficients and constants in cells and let Excel do (c − b) ÷ a. This is exact, with no trial value.

=(B6-B5)/(B3-B4)
Xalgebra.xlsx - ExcelB7fx=(B6-B5)/(B3-B4)AB1PartValue23x coefficient, left64x coefficient, right45constant, left-106constant, right67x8

With 6 and 4 as the x coefficients and −10 and 6 as the constants, the formula returns 8.

4 Solve a quadratic with the formula

For 2x² − 3x − 1 = 0 put a, b and c in B2:B4. One formula uses +SQRT, the other uses −SQRT.

=(-B3+SQRT(B3^2-4*B2*B4))/(2*B2)
Xquadratic.xlsx - ExcelB6fx=(-B3+SQRT(B3^2-4*B2*B4))/(2*B2)AB1NameValue2a23b-34c-15D176x11.78087x2-0.2808

The roots are 1.7808 and −0.2808, the decimal values of (3 ± √17) ÷ 4.

5 Solve a system with MINVERSE and MMULT

For 2x + 3y = 12 and x − y = 1, type the coefficients in A2:B3 and the constants in C2:C3. Select two cells and type the formula. In Excel 365 it spills automatically; in Excel 2016 or earlier press Ctrl+Shift+Enter.

=MMULT(MINVERSE(A2:B3),C2:C3)
Xsystem.xlsx - ExcelE2fx=MMULT(MINVERSE(A2:B3),C2:C3)ABCDE1x coefy coefconstanswer22312331-112

The result is x = 3 and y = 2. Check: 2(3) + 3(2) = 12 and 3 − 2 = 1.

9.3 The awkward cases

Complex roots. SQRT of a negative number gives #NUM!. When b² − 4ac is negative, use =IMSQRT(B3^2-4*B2*B4) and build the roots with IMSUM and IMDIV, or simply report that there are no real roots.

Goal Seek finds only one root. A quadratic has two. Run Goal Seek twice from two different starting values of x, one on each side of the vertex, to find both.

Rounding. Goal Seek stops when the difference is very small, not exactly 0, so it may show 7.99999. Round with =ROUND(A2,6) or use the exact formula in step 3.

Array formulas. MMULT and MINVERSE return several cells. Older Excel needs Ctrl+Shift+Enter; Excel 365 spills the answer down by itself and shows #SPILL! if a cell below is not empty.

9.4 Why Excel might disagree with R, Python or your textbook

SituationWhat happensFix
=-3^2Excel gives 9, because it applies the minus sign before the power. R, Python and every textbook give −9.Write =-(3^2). This is the most famous spreadsheet trap in algebra.
=ROUND(2.5,0)Excel rounds half up to 3. R and Python round(2.5) give 2 (half to even).Say which rounding rule you used, or keep exact fractions
0.1 + 0.2Stored as 0.30000000000000004 in all three programsThis calculator converts decimals to exact fractions first
=MOD(-7,3)Excel and R give 2 (sign of the divisor); some languages give −1Check the sign convention before you rely on MOD
=LOG(100)Excel's LOG is base 10; R's log() is base eUse log10() in R, LN() in Excel
Goal Seek answerShows 7.99999 instead of 8Tighten Options → Formulas → Maximum Change, or use the exact formula

9.5 Charting it in Excel

To see the solution, fill A2:A12 with x = 0 to 10, put the two sides in B and C, select all three columns and insert a Scatter with Straight Lines chart. Never use a Line chart: it spaces the x values evenly whatever they are. The lines cross at (8, 38). Two fixes help: set the horizontal axis bounds to 0 and 10, and add data labels to the crossing point only.

9.6 Excel errors you will probably hit

ErrorCauseFix
#NUM!SQRT of a negative discriminant, or MINVERSE of a singular matrixUse IMSQRT, or check MDETERM is not 0
#DIV/0!The x coefficient is 0, or 2a is 0The equation is not linear or not quadratic; recheck the coefficients
#VALUE!Text such as “2x” typed into a cell used in arithmeticType only the number 2 and keep the x in the header
#SPILL!MMULT result has no empty cells to spill intoClear the cells below the formula
Goal Seek may not have found a solutionNo root near the start value, or the sides never meetTry another start value, or check the chart for a crossing

📈 10. How to Solve Algebra Equations in R

Base R solves linear and polynomial equations numerically and systems exactly enough for most work, with no packages to install. The script solves the headline equation 2(3x − 5) = 4x + 6, checks it, then shows a quadratic, a system and a matrix rank, and saves a 300 dpi figure of both sides meeting at x = 8.

Copy the whole block. It runs top to bottom in RStudio, Posit Cloud or plain Rscript. Change the two lines that define lhs and rhs to solve your own equation.

10.1 The complete script

R, base only, saves algebra_solution.png

# ============================================================
# Algebra calculator in R: solve, check, quadratic, system, rank
# StatsUnlock - https://statsunlock.com/algebra-calculator/
# Base R only. No packages to install.
# ============================================================

# ---- 1. The equation: 2(3x - 5) = 4x + 6 -------------------
lhs <- function(x) 2 * (3 * x - 5)
rhs <- function(x) 4 * x + 6
f   <- function(x) lhs(x) - rhs(x)      # solve f(x) = 0

# ---- 2. Linear shortcut: intercept and slope of f -----------
b0 <- f(0)                  # -16
b1 <- f(1) - f(0)           # 2
x  <- -b0 / b1              # 8
cat("Solution: x =", x, "\n")

# ---- 3. Check by substitution -------------------------------
cat("Check: LHS =", lhs(x), " RHS =", rhs(x), "\n")
if (isTRUE(all.equal(lhs(x), rhs(x)))) cat("Verified: both sides are equal.\n")

# ---- 4. Same answer with a numeric root finder --------------
r <- uniroot(f, c(-100, 100), tol = 1e-10)
cat("uniroot gives x =", round(r$root, 6), "\n")

# ---- 5. Quadratic 2x^2 - 3x - 1 = 0 -------------------------
# polyroot wants ascending order: c, b, a
roots <- polyroot(c(-1, -3, 2))
print(sort(round(Re(roots), 4)))     # -0.2808  1.7808

# ---- 6. System: 2x + 3y = 12, x - y = 1 ---------------------
A <- matrix(c(2,  3,
              1, -1), nrow = 2, byrow = TRUE)
b <- c(12, 1)
print(solve(A, b))                   # 3 2

# ---- 7. Matrix rank -----------------------------------------
M <- matrix(c(1, 2, 3,
              2, 4, 6,
              1, 0, 1), nrow = 3, byrow = TRUE)
cat("rank =", qr(M)$rank, "\n")      # 2

# ---- 8. Fractions in the output (MASS ships with R) ---------
A2 <- matrix(c(3, 2,
               1, 4), nrow = 2, byrow = TRUE)
print(MASS::fractions(solve(A2, c(1, 2))))   # 0 1/2

# ---- 9. Figure: both sides as lines, meeting at x = 8 -------
png("algebra_solution.png", width = 2000, height = 1400, res = 300)
xs <- seq(0, 10, by = 0.1)
plot(xs, lhs(xs), type = "l", lwd = 2.5, col = "#2563eb",
     xlab = "x", ylab = "value of each side",
     main = "2(3x - 5) = 4x + 6", ylim = c(-12, 52))
lines(xs, rhs(xs), lwd = 2.5, col = "#ea580c")
abline(h = 0, col = "#475569")
points(x, lhs(x), pch = 19, cex = 1.6, col = "#16a34a")
text(x, lhs(x), labels = paste0("(", x, ", ", lhs(x), ")"), pos = 2)
legend("topleft", c("LHS = 2(3x - 5)", "RHS = 4x + 6"),
       col = c("#2563eb", "#ea580c"), lwd = 2.5, bty = "n")
dev.off()

10.2 What each part does

PartWhat it doesWatch out for
1. lhs, rhs, fWrites each side as a function and moves everything to one sideR needs *: write 2 * (3 * x - 5), never 2(3x - 5)
2. Linear shortcutReads the intercept f(0) = −16 and slope 2, then x = 16 ÷ 2 = 8Works only when f is linear
3. CheckSubstitutes x back and compares the two sidesUse all.equal(), not ==, for decimals
4. uniroot()Finds a root between two numbers where f changes signGives one root only, to about 4 decimal places by default
5. polyroot()All roots of a polynomialCoefficients in ascending order (c, b, a), the opposite of NumPy; results are complex, so take Re()
6. solve(A, b)Solves a linear systemError “system is exactly singular” means no unique solution
7. qr(M)$rankMatrix rankUses a tolerance, so near-dependent rows may count as dependent
8. MASS::fractions()Prints decimals as fractionsIt approximates; it cannot write a surd
9. png(..., res = 300)Saves the figure at 300 dpiAlways finish with dev.off() or the file stays empty

10.3 What the figure shows

The blue line is the left side 2(3x − 5) and the orange line is the right side 4x + 6. They cross at the green point (8, 38). The x value of the crossing is the solution, and the y value is the number both sides equal, which is the check.

10.4 Common R problems and fixes

ProblemFix
Error: could not find function “2”You wrote 2(x). R needs 2 * (x).
uniroot: f() values at end points not of opposite signWiden the interval, or plot f to see where it crosses 0
polyroot gives the wrong rootsThe coefficients are in the wrong order; R wants c, b, a
Roots print as 1.78+0iUse Re(roots) when the imaginary parts are about 0
round(2.5) gives 2R rounds half to even; this is correct behaviour
Empty PNG fileRun dev.off() after plotting
Need exact factoring or simplifyingInstall caracas (SymPy from R) and use factor_() and simplify()

10.5 Useful one-liners

TaskR code
Solve ax + b = c(c - b) / a
All roots of x³ − 6x² + 11x − 6Re(polyroot(c(-6, 11, -6, 1)))
Discriminantb^2 - 4 * a * c
Determinantdet(A)
Evaluate at x = 2f(2)
Exact symbolic factor (caracas)library(caracas); x <- symbol("x"); factor_(6*x^2 + 11*x - 35)

📈 11. How to Solve Algebra Equations in Python

Python with SymPy does real symbolic algebra: it solves, expands, factors and simplifies with exact fractions and surds, the same way this calculator does. The script solves the headline equation, checks it, repeats every sample type from Section 2, and saves a 300 dpi figure.

sympynumpymatplotlib

Install once with pip install sympy numpy matplotlib. Google Colab already has all three.

11.1 The complete script

Python 3, SymPy, saves algebra_solution.png

# ============================================================
# Algebra calculator in Python: solve, simplify, factor, systems
# StatsUnlock - https://statsunlock.com/algebra-calculator/
# pip install sympy numpy matplotlib
# ============================================================
from sympy import symbols, Eq, solve, expand, factor, together, Rational, Matrix, linsolve
import numpy as np
import matplotlib
matplotlib.use("Agg")          # save to file; remove this line in Jupyter
import matplotlib.pyplot as plt

x, y = symbols("x y")

# ---- 1. The headline equation: 2(3x - 5) = 4x + 6 ----------
eq = Eq(2*(3*x - 5), 4*x + 6)
sol = solve(eq, x)
print("Solution:", sol)                                   # [8]

# ---- 2. Check by substitution -------------------------------
x0 = sol[0]
lhs, rhs = eq.lhs.subs(x, x0), eq.rhs.subs(x, x0)
print("Check: LHS =", lhs, " RHS =", rhs)                 # 38 and 38
assert lhs == rhs
print("Verified: both sides are equal.")

# ---- 3. Simplify (expand and combine like terms) ------------
print(expand(3*(x + 2) - 2*(x - 4) + x**2))              # x**2 + x + 14

# ---- 4. Factor ----------------------------------------------
print(factor(6*x**2 + 11*x - 35))                         # (2*x + 7)*(3*x - 5)

# ---- 5. Quadratic with exact surds --------------------------
print(solve(Eq(x**2/2 - Rational(3, 4)*x, Rational(1, 4)), x))  # [3/4 - sqrt(17)/4, 3/4 + sqrt(17)/4]

# ---- 6. Algebraic fractions ---------------------------------
print(together(1/x + 1/(x + 2)))                          # 2*(x + 1)/(x*(x + 2))

# ---- 7. System of equations ---------------------------------
print(linsolve([2*x + 3*y - 12, x - y - 1], [x, y]))      # {(3, 2)}

# ---- 8. Matrix rank -----------------------------------------
M = Matrix([[1, 2, 3], [2, 4, 6], [1, 0, 1]])
print("rank =", M.rank())                                 # 2

# ---- 9. Decimals become exact fractions first ---------------
d = solve(Eq(Rational("0.5")*x + Rational("1.25"), Rational("2.75") - Rational("0.25")*x), x)
print("Decimal equation:", d)                             # [2]

# ---- 10. Figure: both sides as lines, meeting at x = 8 ------
xs = np.linspace(0, 10, 200)
fig, ax = plt.subplots(figsize=(6.5, 4.5))
ax.plot(xs, 2*(3*xs - 5), color="#2563eb", lw=2.5, label="LHS = 2(3x - 5)")
ax.plot(xs, 4*xs + 6, color="#ea580c", lw=2.5, label="RHS = 4x + 6")
ax.scatter([8], [38], s=80, color="#16a34a", zorder=3)
ax.annotate("(8, 38)", (8, 38), textcoords="offset points", xytext=(-52, 6))
ax.axhline(0, color="#475569", lw=1)
ax.set(xlabel="x", ylabel="value of each side", title="2(3x - 5) = 4x + 6")
ax.legend(frameon=False)
fig.savefig("algebra_solution.png", dpi=300, bbox_inches="tight")
print("Saved algebra_solution.png")

11.2 What each part does

PartWhat it doesWatch out for
symbols("x y")Creates algebra lettersWithout it, x is an ordinary variable and SymPy cannot work with it
Eq(lhs, rhs)Builds an equationDo not write lhs == rhs; that just tests equality and returns False
solve(eq, x)Returns a list of solutionsThe list can contain complex values such as -1 - 2*I
**Power^ is XOR in Python, not power. x^2 is the most common beginner bug in maths code.
Rational(3, 4)Exact fraction3/4 becomes the float 0.75 and ruins exactness
expand, factor, togetherSimplify, factor, combine fractionssimplify() is slower and sometimes picks an odd form
linsolveSolves a linear systemReturns a set of tuples; an empty set means no solution
Matrix.rank()Exact rankExact with integers and fractions; NumPy's matrix_rank uses a tolerance
savefig(dpi=300)Saves the figureCall it before plt.show()

11.3 What the figure shows

The same picture as the R figure: the two sides as straight lines meeting at (8, 38). If you change the equation to one with no solution, such as 2(x + 3) = 2x + 5, the two lines become parallel and never meet.

11.4 Common Python problems and fixes

ProblemFix
TypeError: unsupported operand for ^Use ** for powers
Answer shows 0.333333333333333Use Rational(1, 3) or nsimplify()
solve returns []No solution, or the equation is an identity; check with simplify(lhs - rhs)
math.sqrt(-1) raises ValueErrorUse sympy.sqrt or cmath.sqrt
numpy.roots gives a different orderNumPy wants descending order (a, b, c), the opposite of R
Figure window never appears in a scriptThe script uses the Agg backend; open the saved PNG

11.5 Useful one-liners

TaskPython (SymPy)
Solve for xsolve(Eq(2*(3*x - 5), 4*x + 6), x)
Solve an inequalitysolve_univariate_inequality(3 - 2*x <= 7, x)
Expandexpand((x + 1)**2 - (x - 1)**2) gives 4*x
Factorfactor(x**4 + 4)
Evaluate(3*x**2 + 2*x - 7).subs(x, 2) gives 9
Numeric rootsnumpy.roots([1, -6, 11, -6])

Run it from a terminal with python algebra.py, in Jupyter (add plt.show() to see the figure inline), or paste it into Google Colab.

📋 12. Reference Tables

12.1 Properties of algebra

PropertyRuleExample
Commutativea + b = b + a,   ab = ba3x + 5 = 5 + 3x
Associative(a + b) + c = a + (b + c)(2x + 3) + 4 = 2x + 7
Distributivea(b + c) = ab + ac4(x − 2) = 4x − 8
Additive identity and inversea + 0 = a,   a + (−a) = 05x − 5x = 0
Multiplicative identity and inversea × 1 = a,   a × (1/a) = 1 for a ≠ 0(2/3) × (3/2) = 1
Zero product propertyIf ab = 0 then a = 0 or b = 0x(x − 9) = 0 ⇒ x = 0 or 9

How to use: every step of a solution is one of these rules. Naming the rule beside each line is what earns method marks.

12.2 Exponent rules

RuleFormulaExample
Productam · an = am+nx2 · x3 = x5
Quotientam ÷ an = am−nx7 ÷ x4 = x3
Power of a power(am)n = amn(x2)3 = x6
Zero exponenta0 = 1 (a ≠ 0)70 = 1
Negative exponenta−n = 1 ÷ anx−1 = 1x
Power of a product(ab)n = anbn(2x)3 = 8x3

12.3 Special products and factoring patterns

PatternExpandedFactoredExample
Square of a suma2 + 2ab + b2(a + b)2x2 + 6x + 9 = (x + 3)2
Square of a differencea2 − 2ab + b2(a − b)24x2 − 12x + 9 = (2x − 3)2
Difference of squaresa2 − b2(a − b)(a + b)x2 − 25 = (x − 5)(x + 5)
Sum of cubesa3 + b3(a + b)(a2 − ab + b2)x3 + 27 = (x + 3)(x2 − 3x + 9)
Difference of cubesa3 − b3(a − b)(a2 + ab + b2)x3 − 8 = (x − 2)(x2 + 2x + 4)
Simple trinomialx2 + (p + q)x + pq(x + p)(x + q)x2 − 7x + 12 = (x − 3)(x − 4)
Groupingax + ay + bx + by(a + b)(x + y)xy + 2x + 3y + 6 = (x + 3)(y + 2)

How to use: read across from the left column. Before any pattern, always take out the greatest common factor.

12.4 Discriminant cases for ax² + bx + c = 0

D = b² − 4acRootsGraphExample
Positive perfect squareTwo rational roots, it factorsCrosses the x axis twicex² − 5x + 6: D = 1, x = 2, 3
Positive, not a squareTwo irrational roots (surds)Crosses twicex² − 2: D = 8, x = ±√2
ZeroOne repeated rootTouches the axis oncex² − 4x + 4: D = 0, x = 2
NegativeTwo complex rootsNever touches the axisx² + 2x + 5: D = −16, x = −1 ± 2i

12.5 Inequality rules and interval notation

InequalityIntervalNumber lineRule
x > 3(3, ∞)Open circle at 3, arrow rightRound bracket: 3 is not included
x ≥ −2[−2, ∞)Filled circle at −2, arrow rightSquare bracket: −2 is included
x < 5(−∞, 5)Open circle, arrow left∞ always gets a round bracket
−1 ≤ x < 4[−1, 4)Filled at −1, open at 4A compound inequality
Multiply by −1−2x ≤ 4 becomes x ≥ −2Flip the sign when multiplying or dividing by a negative

12.6 Perfect squares and cubes from 1 to 15

n123456789101112131415
n²149162536496481100121144169196225
n³182764125216343512729100013311728219727443375

How to use: spotting these numbers is how you recognise a difference of squares, a perfect square trinomial or a sum or difference of cubes, and how you simplify a surd: √48 = √(16 × 3) = 4√3.

12.7 How to type maths into this calculator

You wantTypeNotes
3x² − 2x + 13x^2 - 2x + 1^ means “to the power of”
x + 1x − 2(x + 1)/(x - 2)Brackets around the top and the bottom
2⅓2 1/3A space makes a mixed number
x ≤ 5x <= 5Or use the ≤ key
A system2x + 3y = 12, x - y = 1Commas between equations
A matrixrank [[1,2],[3,4]]Or 1 2; 3 4 in Matrix mode
xyxy or x*yEvery letter is a separate variable

12.8 Common algebra problems with answers

The problems students search for most, each solved exactly. Tap Steps to open the full step-by-step working in the calculator above.

Linear equations

ProblemExact answerWorking
Solve 2x + 5 = 11x = 3Steps →
Solve 3x − 7 = 14x = 7Steps →
Solve 5(x − 2) = 3x + 4x = 7Steps →
Solve x/2 + 3 = 7x = 8Steps →
Solve 4x + 3 = 2x − 9x = −6Steps →
Solve 0.2x + 1.5 = 3.1x = 8Steps →
Solve 7 − 3x = 22x = −5Steps →
Solve 2(x + 4) = 5x − 7x = 5Steps →

Quadratic equations

ProblemExact answerWorking
Solve x2 − 5x + 6 = 0x = 2 or x = 3Steps →
Solve x2 + 4x − 12 = 0x = −6 or x = 2Steps →
Solve 2x2 + 3x − 2 = 0x = −2 or x = 12Steps →
Solve x2 − 16 = 0x = −4 or x = 4Steps →
Solve x2 + 6x + 9 = 0x = −3Steps →
Solve x2 + x + 1 = 0x = −1 − √3i2 or x = −1 + √3i2Steps →
Solve 3x2 − 2x − 4 = 0x = 1 − √133 or x = 1 + √133Steps →

Simplify and expand

ProblemExact answerWorking
Simplify 2(x + 3) + 4(x − 1)6x + 2Steps →
Simplify (x + 3)2x2 + 6x + 9Steps →
Simplify (2x − 1)(x + 4)2x2 + 7x − 4Steps →
Simplify 3x2 + 2x − x2 + 5x2x2 + 7xSteps →
Simplify (x2 − 9)/(x − 3)x + 3Steps →
Simplify 3/4 + 2/31712Steps →
Simplify 1/(x − 1) − 1/(x + 1)2x2 − 1Steps →

Factoring

ProblemExact answerWorking
Factor x2 + 7x + 12(x + 4)(x + 3)Steps →
Factor x2 − 3x − 10(x + 2)(x − 5)Steps →
Factor 2x2 − 82(x + 2)(x − 2)Steps →
Factor 4x2 + 12x + 9(2x + 3)2Steps →
Factor x3 − 27(x − 3)(x2 + 3x + 9)Steps →
Factor 6x2 − x − 2(2x + 1)(3x − 2)Steps →

Inequalities

ProblemExact answerWorking
Inequality 2x − 5 > 7x > 6Steps →
Inequality −3x + 4 ≤ 10x ≥ −2Steps →
Inequality x2 − 4 < 0(−2, 2)Steps →

Systems and lines

ProblemExact answerWorking
System x + y = 10, x − y = 2x = 6, y = 4Steps →
System 3x + 2y = 16, x − y = 2x = 4, y = 2Steps →
Standard form y = 3x − 53x − y = 5Steps →
Standard form y = −1/2x + 4x + 2y = 8Steps →

📈 13. Example Results

1
TEXTBOOK CASE

Simplify an expression with two brackets

The everyday simplify question.

Simplify 4(2x − 3) − 3(x − 5).

answer 5x + 32 brackets4 terms before2 terms after
StepResultWhy
Expand8x − 12 − 3x + 15Multiply into each bracket; −3 × −5 = +15
x terms8x − 3x = 5xCombine like terms
Numbers−12 + 15 = 3Combine like terms
Answer5x + 3Standard form
Like terms of 4(2x minus 3) minus 3(x minus 5) combine to 5x + 3x terms+8x−3x= 5xnumbers−12+15= 3
Each like term shown as a bar: the x terms add to 5x and the numbers add to 3.

What it means: The long expression and 5x + 3 are equal for every x. At x = 1 both give 8.

How to write it: 4(2x − 3) − 3(x − 5) = 5x + 3

2
EXAM WITH FRACTIONS

Solve x/3 + x/4 = 7

Clear the fractions first.

A typical exam equation with two fractions.

LCD 127x = 84x = 12
StepResultWhy
Multiply by 124x + 3x = 8412 is the lowest common denominator
Combine7x = 84Like terms
Dividex = 12Divide both sides by 7
Check4 + 3 = 7 ✓12/3 + 12/4
Number line showing the solution x = 120246810121416x = 12
The single solution x = 12 on a number line.

What it means: Only one number works. Multiplying by the LCD turns a fraction equation into an easy whole-number one.

How to write it: x/3 + x/4 = 7 ⇒ 7x = 84 ⇒ x = 12

3
DECIMALS

Solve 0.5x + 1.25 = 2.75 − 0.25x

Decimals become exact fractions.

A worksheet equation with decimal coefficients.

0.75x = 1.5x = 2exact
StepResultWhy
Collect x terms0.5x + 0.25x = 0.75xAdd 0.25x to both sides
Collect numbers2.75 − 1.25 = 1.5Subtract 1.25
Dividex = 1.5 ÷ 0.75 = 2As fractions: (3/2) ÷ (3/4) = 2
Checkboth sides 2.25 ✓Substitute x = 2
Lines y = 0.5x + 1.25 and y = 2.75 minus 0.25x crossing at x = 2The two sides meet at (2, 2.25).01234501234(2, 2.25)
The two sides as lines, meeting at (2, 2.25).

What it means: The answer is exactly 2, not 1.9999. Converting decimals to fractions avoids rounding error.

How to write it: 0.5x + 1.25 = 2.75 − 0.25x ⇒ x = 2

4
REAL WORLD

A garden with area 40 m²

A quadratic from a word problem.

A rectangular garden is 3 m longer than it is wide and has an area of 40 m². Find its width.

w(w + 3) = 40w = 5 mreject −8
StepResultWhy
Write the equationw² + 3w − 40 = 0Area = width × length
Factor(w + 8)(w − 5) = 08 × −5 = −40, 8 − 5 = 3
Rootsw = −8 or w = 5Zero product property
Contextw = 5 m, length 8 mA width cannot be negative
Rectangle 5 m wide and 8 m long with area 40 square metresArea = 40 m²length w + 3 = 8 mwidth w = 5 m
The garden drawn to scale: 5 m by 8 m.

What it means: The algebra gives two roots, but only the positive one makes sense for a length.

How to write it: The garden is 5 m wide and 8 m long.

5
SPECIAL CASE

A repeated root: x² − 6x + 9 = 0

When the discriminant is zero.

Solve x² − 6x + 9 = 0.

D = 0(x − 3)²x = 3 twice
StepResultWhy
Discriminant36 − 36 = 0b² − 4ac
Factor(x − 3)² = 0Perfect square trinomial
Rootx = 3Multiplicity 2
Check9 − 18 + 9 = 0 ✓Substitute
Parabola y = x squared minus 6x + 9 touching the x axis at x = 3A double root: the curve touches the axis at one point and turns back.0123456704812x = 3 (double)
The parabola touches the x axis at x = 3 and turns back.

What it means: There is only one distinct answer. The graph touches the axis instead of crossing it.

How to write it: x = 3 (a repeated root)

6
NO SOLUTION

Solve 3(x + 2) = 3x + 4

The x terms vanish.

Solve 3(x + 2) = 3x + 4.

3x + 6 = 3x + 46 = 4 is falseno solution
StepResultWhy
Expand3x + 6 = 3x + 4Distributive property
Subtract 3x6 = 4The x terms cancel
ConclusionNo solutionA false statement means no x works
Graphparallel linesSame slope 3, different intercepts
Parallel lines y = 3x + 6 and y = 3x + 4 never meetSame slope, different intercepts, so there is no solution.−4−202−50510
The two sides are parallel lines, so they never meet.

What it means: Whatever x you try, the left side is always 2 more than the right side.

How to write it: No solution; the solution set is ∅.

7
LARGE NUMBERS

Ticket sales: a 2 by 2 system

Two unknowns need two equations.

A school sold 250 tickets. Adult tickets cost 12 dollars and child tickets cost 7 dollars. Sales were 2500 dollars. How many of each?

a + c = 25012a + 7c = 2500a = 150, c = 100
StepResultWhy
Substitute12a + 7(250 − a) = 2500c = 250 − a
Simplify5a + 1750 = 2500Expand and combine
Solvea = 1505a = 750
Back-substitutec = 100250 − 150; check 1800 + 700 = 2500 ✓
Ticket lines a + c = 250 and 12a + 7c = 2500 crossing at (150, 100)The solution of the system is 150 adult and 100 child tickets.0501001502000100200300(150, 100)
The two equations as lines crossing at (150, 100).

What it means: Both conditions are met only by 150 adult and 100 child tickets.

How to write it: 150 adult tickets and 100 child tickets were sold.

8
TRAP

Solve x² = 5x without losing a root

Dividing by x loses an answer.

Solve x² = 5x. Many students divide both sides by x and get only x = 5.

x(x − 5) = 0x = 0x = 5
StepResultWhy
Wrong wayx = 5 onlyDividing by x assumes x is not 0
Right wayx² − 5x = 0Move everything to one side
Factorx(x − 5) = 0GCF is x
Rootsx = 0 or x = 5Zero product property
Parabola y = x squared minus 5x crossing the axis at 0 and 5Both roots, x = 0 and x = 5, are solutions of x squared = 5x.−20246−50510x = 0x = 5
The parabola y = x² − 5x crosses the axis at both 0 and 5.

What it means: There are two answers. x = 0 works: 0² = 5 × 0.

How to write it: x = 0 or x = 5

✏️ 14. How to Solve Algebra Equations by Hand, Step by Step

This is the pen and paper method a teacher expects to see in an exam, worked on the same example as Sections 7, 9, 10 and 11: 2(3x − 5) = 4x + 6.

14.1 The written method

  1. Copy the equation exactly. 2(3x − 5) = 4x + 6. Most lost marks start with a miscopied sign.
  2. Expand the brackets. Multiply the 2 by both terms inside: 2 × 3x = 6x and 2 × (−5) = −10. Now 6x − 10 = 4x + 6.
  3. Collect the x terms on one side. Subtract 4x from both sides: 2x − 10 = 6. Choose the side that keeps the x coefficient positive.
  4. Collect the numbers on the other side. Add 10 to both sides: 2x = 16.
  5. Divide by the coefficient of x. x = 16 ÷ 2 = 8.
  6. Check in the original equation. Left: 2(3 × 8 − 5) = 2 × 19 = 38. Right: 4 × 8 + 6 = 38. Both sides agree.
  7. Write the answer clearly. x = 8, or as a solution set {8}.

For a quadratic, the method changes after step 4: get everything on one side so it equals 0, take out any common factor, try to factor (two numbers that multiply to ac and add to b), and use the quadratic formula if it will not factor. Never divide both sides by x.

14.2 On a scientific calculator

CalculatorKeysWhat you see
Casio fx-991EX / fx-570EX (ClassWiz)In Calculate mode type 2 ( 3 ALPHA ) (X) − 5 ), then ALPHA CALC (=), then 4 ALPHA ) + 6. Press SHIFT CALC (SOLVE) and =X = 8, L−R = 0
Casio fx-991MS / fx-570MSType the equation the same way, with ALPHA ) for X and ALPHA CALC for =, then SHIFT CALC (SOLVE), = to accept a start value, and SHIFT CALC againX = 8
Casio fx-991EX, a systemMENU A (Equation/Func) 1 (Simul Equation) 2 (2 unknowns), then 2, 3, 12, 1, −1, 1, each followed by =x = 3, y = 2
TI-84 Plus CEMATH, scroll to Solver, enter 0 = 2(3X − 5) − (4X + 6), put a guess such as 0 in X, then ALPHA ENTERX = 8, left−rt = 0

The basic Casio fx-82MS and TI-30XIIS have no SOLVE function; work the steps by hand and use the calculator only for the arithmetic. Keystrokes differ slightly between models and software versions, so confirm them in your calculator's manual. SOLVE finds one root near the start value, so for a quadratic run it twice from different start values.

14.3 Practice problems with answers

1. 5x + 3 = 18

5x = 15, so x = 3.

2. 4(x − 2) = 2x + 6

4x − 8 = 2x + 6, 2x = 14, x = 7.

3. x/3 + x/4 = 7

Multiply by 12: 4x + 3x = 84, 7x = 84, x = 12.

4. 3 − 2x > 11

−2x > 8. Divide by −2 and flip: x < −4, or (−∞, −4).

5. Simplify 5(2x − 1) − 3(x + 4)

10x − 5 − 3x − 12 = 7x − 17.

6. Factor x² − 7x + 12

−3 × −4 = 12 and −3 + −4 = −7, so (x − 3)(x − 4).

7. x² + 4x − 1 = 0

D = 16 + 4 = 20. x = (−4 ± 2√5) ÷ 2 = −2 ± √5.

8. x + y = 10, x − y = 4

Add the equations: 2x = 14, x = 7, then y = 3.

9. 2(x + 1) = 2x + 7

2x + 2 = 2x + 7 gives 2 = 7, which is false. No solution.

10. Trap: x² = 4x

x² − 4x = 0, x(x − 4) = 0, so x = 0 or x = 4. Dividing by x loses x = 0.

14.4 Mistakes that lose marks

  • Multiplying only the first term inside a bracket: −2(x − 4) is −2x + 8, not −2x − 4 or −2x − 8.
  • Moving a term across the = sign without changing its sign.
  • Forgetting to flip an inequality when dividing by a negative number.
  • Dividing both sides by x, which throws away the root x = 0.
  • Cancelling terms instead of factors: x + 33 is not x.
  • Rounding a surd too early, which turns an exact answer into a slightly wrong decimal.
  • Keeping an extraneous root that makes a denominator zero.
  • Not checking. Substitution takes thirty seconds and catches nearly every slip.

🎯 15. When to Use Each Algebra Method

The right method depends on what the problem looks like. Picking well saves time and avoids messy arithmetic.

Use this algebra solver when:

  • ✓ You want to check homework and see exactly which step went wrong.
  • ✓ You need an exact answer with fractions or surds, not a rounded decimal.
  • ✓ You are building an answer key for many problems (Batch tab).
  • ✓ You want a graph that shows why the answer is right.
  • ✓ The problem is a polynomial, an algebraic fraction, a linear system or a matrix.

Use something else when:

  • ✗ The equation has sin, log, ex or √x: use a scientific or graphing calculator.
  • ✗ You need calculus (derivatives, integrals, limits).
  • ✗ You need to factor a polynomial with three or more letters that is not homogeneous or groupable.
  • ✗ The exam forbids calculators: practise with Section 14 until the steps are automatic.

Four real examples:

  1. Phone plans: plan A costs 20 + 0.05m and plan B costs 35 + 0.02m. Solve 20 + 0.05m = 35 + 0.02m to find the break-even, m = 500 minutes.
  2. Garden design: a rectangle has length 3 m more than its width and area 40 m². Solve w(w + 3) = 40 to get w = 5 m.
  3. Ticket sales: 250 tickets at 12 and 7 dollars raised 2500 dollars. A 2 by 2 system gives 150 adult and 100 child tickets.
  4. Physics: a ball's height is h = −5t² + 20t. Solve −5t² + 20t = 0 to find it lands at t = 4 seconds.

Decision tree

If the problem…Then use
Has no = sign and you want it shorterSimplify / expand
Has no = sign and you want a productFactor (GCF first, then patterns, then the ac method)
Has one = sign and the highest power is 1Solve: expand, collect, divide
Has one = sign and x², and b² − 4ac is a perfect squareFactor and use the zero product property
Has x² and it will not factorQuadratic formula, or completing the square if you need the vertex
Has x in a denominatorMultiply by the common denominator, then reject excluded values
Has <, >, ≤ or ≥Inequality: solve, flip on a negative, give interval notation
Has two or more equationsSystem: substitution for 2 unknowns, elimination or matrices for 3 or more

🔧 16. Common Mistakes and Troubleshooting

My answer is off by a sign

Cause: a term crossed the = sign without changing sign, or a minus in front of a bracket was applied to the first term only. Fix: compare your lines with the calculator's steps. The first line that differs is the mistake.

The calculator says it could not read my expression

Cause: two operators in a row, a missing bracket, or a symbol it does not know. Fix: use ^ for powers, put brackets around every numerator and denominator, and use one = sign. The message under the box says what to change.

I got a decimal but the book has a surd

Cause: you rounded √D. Fix: keep the root. Set Answer form to Exact and decimal: the calculator gives (3 ± √17) ÷ 4, which is the book's form.

The tool and my textbook disagree on a factored form

Cause: factored forms can differ by order or by a factor of −1, for example (x − 3)(2 − x) and −(x − 3)(x − 2). Fix: expand both. If they give the same polynomial, both are correct.

It says no solution, but I found one

Cause: your value makes a denominator zero (extraneous), or the x terms cancel to a false statement. Fix: substitute your value into the original equation and look for a division by zero.

My calculator says Math ERROR

Cause: square root of a negative discriminant, or division by zero. Fix: a negative discriminant means complex roots; this page shows them as p ± qi.

Excel shows #NUM!

Cause: SQRT of a negative number, or MINVERSE of a singular matrix. Fix: use IMSQRT, or check MDETERM; see Section 9.6.

I lost a root when I solved x² = 9x

Cause: dividing both sides by x. Fix: move everything to one side and factor: x(x − 9) = 0, so x = 0 or x = 9.

The inequality answer points the wrong way

Cause: you divided by a negative number without flipping the sign. Fix: −2x ≤ 4 becomes x ≥ −2. Test a value such as x = 0 in the original to confirm.

The calculator will not solve an equation with two letters

Cause: one equation cannot fix two unknowns. Fix: type the letter you want in Solve for, give a second equation for a system, or choose Standard form for a line.

Some roots show as long decimals

Cause: polynomials of degree 3 or more with no rational roots usually have no simple exact form. Fix: these roots are found numerically and marked Rounded. Increase Decimal places if you need more digits.

Charts do not appear

Cause: the chart library was blocked or has not loaded. Fix: allow cdnjs.cloudflare.com and press Solve again. The answer, steps and table still work without charts.

⚖ 17. Assumptions and Limitations

Assumptions

  1. Every letter is a variable. xy means x × y. Check: a word like “area” would be read as a × r × e × a. Use single letters.
  2. Numbers are exact. 0.333 is treated as 3331000, not 13. Type 1/3 when you mean a third.
  3. Roots are reported over the complex numbers. Real roots come first; complex roots are listed when the discriminant is negative. Inequalities use real numbers only.
  4. The domain excludes zeros of every denominator in the original problem, even when a factor later cancels.
  5. Exponents are whole numbers. x^-1 is fine and means 1/x; x^(1/2) is a root and is not simplified here.

Limitations

  1. No functions: sin, cos, log, ln, ex and √x are not handled. Use a scientific or graphing calculator.
  2. Polynomials of degree 5 or more usually have no formula for their roots (Abel-Ruffini theorem). The calculator finds rational roots exactly and the rest numerically.
  3. Factoring with three or more letters covers the common factor, grouping and homogeneous two-letter cases, not every multivariable polynomial.
  4. Equations with two letters are solved for one letter only when they are linear in that letter.
  5. Systems must be linear (no x², no xy). Non-linear systems need substitution by hand or a computer algebra system.
  6. Size limits: powers up to 60, matrices up to 8 by 8, and polynomials up to 3000 terms after expanding.

How this calculator was tested

  • Exact engine: every number is a fraction of two whole numbers (BigInt), so there is no rounding until the final decimal line.
  • 45 engine test cases covering every mode, error message and edge case (repeated roots, complex roots, extraneous roots, singular systems), plus the 35 problems in Section 12.8, all giving the expected answer.
  • Cross-checked against SymPy in Python and base R: the scripts in Sections 10 and 11 print the same answers as this page.
  • Self-check on every answer: the calculator substitutes its own answer back into your original problem before showing the Verified badge.

🏁 18. Conclusion

___ Solve a problem above and this box will summarise your own answer.

What the answer is

This algebra calculator gives an exact answer first, as a whole number, a fraction or a surd, then the decimal. For the headline problem 2(3x − 5) = 4x + 6, that answer is x = 8, and the check shows both sides equal 38.

What it tells you

The solution type matters as much as the number. One solution, no solution, every number, a repeated root or a complex pair each say something different about the problem. On a graph they are a crossing, two parallel lines, two identical lines, a curve touching the axis, or a curve that never reaches it.

Watch out for

Sign errors when terms cross the = sign, forgetting to flip an inequality, dividing by x, and extraneous roots from denominators cause most wrong answers. The step list shows each move on its own line, so you can find the exact line where your working first differs.

Next steps

If your equation turned out to be a quadratic, practise factoring and the quadratic formula. If it has two unknowns, move to systems of equations. For number work, the factor calculator, the mixed number calculator and the proportion calculator cover the arithmetic that algebra is built on. Whatever the problem, the algebra solver works the same way: exact answer, every step, and a check.

❓ 19. Frequently Asked Questions

What is an algebra calculator?

An algebra calculator is a tool that simplifies, factors and solves expressions and equations that contain letters, and shows each step. This one also solves inequalities and systems, writes lines in standard form, and finds the rank of a matrix, keeping every answer as an exact fraction or surd.

How do you solve an algebra equation step by step?

Expand any brackets, move the x terms to one side and the numbers to the other, then divide by the number in front of x. For 2(3x − 5) = 4x + 6 that gives 6x − 10 = 4x + 6, then 2x = 16, then x = 8. Finish by substituting back: both sides equal 38.

Is this algebra solver free with steps?

Yes, every step is shown free with no sign-up and no limit on problems. Many solver sites show only the answer and charge for the working; this page shows all of it, plus the check, the graphs and a downloadable copy of the steps.

How do you simplify an algebraic expression?

Expand the brackets, then combine like terms, which are terms with exactly the same letters and powers. For 3(x + 2) − 2(x − 4) you get 3x + 6 − 2x + 8 = x + 14. Write the result with the highest power first.

How do you factorise an algebraic expression?

Take out the greatest common factor first, then look for a pattern such as a difference of squares, then use the ac method for a trinomial. For 6x² + 11x − 35, find two numbers that multiply to −210 and add to 11: −10 and 21. Grouping gives (2x + 7)(3x − 5).

Can this calculator solve algebra with fractions?

Yes, it works with fractions exactly, both number fractions and algebraic fractions. It adds 1/x + 1/(x + 2) to (2x + 2)/(x(x + 2)), solves x/3 + x/4 = 7 to get x = 12, and turns decimals such as 0.75 into 3/4 before it starts so no rounding creeps in.

Does it work for pre-algebra?

Yes, it handles pre-algebra fractions, mixed numbers, order of operations and one-step and two-step equations. Type 2 1/3 + 1 1/2 to get 23/6, or 5x + 3 = 18 to get x = 3 with each step explained.

Can it do Algebra 2 problems?

Yes, it covers the core Algebra 2 topics of polynomials, quadratics with complex roots, rational expressions, polynomial inequalities and systems of three equations. It factors x³ − 8 as (x − 2)(x² + 2x + 4) and solves x² + 2x + 5 = 0 as x = −1 ± 2i. Logarithms and trigonometry need a scientific calculator.

How do you write an equation in standard form?

Move the x and y terms to the left and the number to the right, then clear fractions so A, B and C are whole numbers with A positive. For y = (2/3)x − 4, multiply by 3 and rearrange to get 2x − 3y = 12. Choose Standard form mode to do this automatically.

How do you find the rank of a matrix?

Row reduce the matrix to echelon form and count the non-zero rows. The matrix [[1, 2, 3], [2, 4, 6], [1, 0, 1]] has rank 2 because the second row is twice the first. Type rank [[1,2,3],[2,4,6],[1,0,1]] to see the row operations.

What calculator do you need for Algebra 1?

A scientific calculator is enough for Algebra 1, for example a Casio fx-991EX, Casio fx-300ES Plus or TI-30XS MultiView. Algebra 1 is mostly linear equations, inequalities and simple quadratics, which need fractions and square roots but no graphing. Always check your teacher's list first.

What calculator do you need for Algebra 2?

Many Algebra 2 courses use a graphing calculator such as the TI-84 Plus CE, because graphs of polynomials, exponentials and logs are part of the course. A good scientific calculator can still do all the arithmetic. The course syllabus, not the subject, decides what is required.

Do you need a graphing calculator for Algebra 2?

Not always, but it helps. You can pass Algebra 2 with a scientific calculator plus a free online grapher. The digital SAT has a built-in Desmos graphing calculator, and the ACT allows most graphing calculators but not models with a computer algebra system, such as the TI-89.

What is the best calculator for algebra?

For exams, the best value is a scientific calculator with an equation solver, such as the Casio fx-991EX, or a TI-84 Plus CE if graphing is required. For homework, an online algebra calculator with steps, like this one, is best because it shows the working and checks the answer.

How do you solve algebra equations in Excel?

Write each side as a formula in terms of an x cell, put their difference in another cell, and use Data, What-If Analysis, Goal Seek to set the difference to 0. For a linear equation ax + b = c you can use =(c-b)/a directly. Section 9 shows each step with screenshots.

How do you solve algebra equations in R?

Use uniroot() for one root of any equation, polyroot() for all roots of a polynomial, and solve(A, b) for a linear system. Remember that polyroot() wants the coefficients in ascending order. Section 10 has a complete script that solves 2(3x − 5) = 4x + 6.

How do you solve algebra equations in Python?

Use SymPy: create the letter with symbols("x"), build the equation with Eq(), and call solve(). SymPy also has expand(), factor() and linsolve(), and keeps answers exact. Use ** for powers, because ^ means something else in Python.

How do you solve an equation on a Casio scientific calculator?

Type the equation with ALPHA ) for X and ALPHA CALC for the = sign, then press SHIFT CALC (SOLVE) and =. On a Casio fx-991EX, 2(3X − 5) = 4X + 6 gives X = 8. For two equations use MENU, A, Simul Equation.

Why does my answer say no solution?

No solution means the x terms cancel and leave a false statement such as 6 = 5, or every candidate makes a denominator zero. For example 2(x + 3) = 2x + 5 gives 6 = 5, so no value of x works. On a graph the two sides are parallel lines.

Can I use this algebra calculator in Spanish (calculadora de álgebra)?

Yes, the maths works in any language: type the problem with numbers, letters and symbols and the answer is the same. The steps are written in plain English, and the notation (x, ^, =, fractions) is identical in Spanish, so it works as a calculadora de álgebra con pasos.

📑 20. Cite This Tool

APA 7th edition
StatsUnlock Team. (2026). Algebra calculator with steps [Interactive mathematics tool]. StatsUnlock. Retrieved 17 October 2026, from https://statsunlock.com/algebra-calculator/
BibTeX
@misc{statsunlock_algebra_2026, title={Algebra Calculator with Steps}, author={{StatsUnlock Team}}, year={2026}, publisher={StatsUnlock}, note={Interactive mathematics tool}, url={https://statsunlock.com/algebra-calculator/}}
Working sentence (fills with your answer)
The equation 2(3x − 5) = 4x + 6 was solved with the StatsUnlock Algebra Calculator (2026) using exact rational arithmetic, giving x = 8; the answer was verified by substitution (both sides equal 38).
Embed this calculator on your website (free)

Free algebra calculator with steps by StatsUnlock

Teachers and tutors: paste the embed code into a class page or blog. The embedded version shows only the calculator and the results.

🔗 21. Related Tools

📖 22. Glossary of Terms

TermPlain-English meaning
CoefficientThe number in front of a letter. In 7x², the coefficient is 7.
Complex rootA root of the form p + qi, where i² = −1. They come in pairs when the discriminant is negative.
ConstantA term with no letter, such as −5.
DegreeThe highest power of the variable. x³ + 2x has degree 3.
Discriminantb² − 4ac, the part under the square root in the quadratic formula. Its sign tells you how many real roots there are.
EquationA statement that two expressions are equal, with an = sign.
Excluded valueA value of the variable that makes a denominator zero, so it is not allowed.
ExpandRemove brackets by multiplying out. 2(x + 3) expands to 2x + 6.
ExpressionNumbers, letters and operations with no = sign, such as 3x + 5.
Extraneous rootAn answer produced by the algebra that does not work in the original equation, usually because it divides by zero.
FactorWrite as a product. x² − 9 factors to (x − 3)(x + 3).
GCFGreatest common factor, the largest term that divides every term. Called HCF in the UK and India.
IdentityAn equation true for every value of the variable, such as 2(x + 1) = 2x + 2.
InequalityA statement using <, >, ≤ or ≥ instead of =. Its answer is a range of values.
Interval notationA way to write a range: [−2, ∞) means −2 and everything above it.
Like termsTerms with exactly the same letters and powers, such as 3x² and −5x².
LinearHaving highest power 1. Its graph is a straight line.
PolynomialA sum of terms that are numbers times whole-number powers of the variables.
QuadraticA polynomial of degree 2, written ax² + bx + c with a ≠ 0.
RankThe number of independent rows of a matrix, found by row reduction.
RootA value that makes a polynomial equal 0. Also called a zero or a solution.
RREFReduced row echelon form, the simplest shape a matrix can be row reduced to.
SurdAn exact root that is not a whole number, such as √17 or 4√3.
System of equationsTwo or more equations solved together for the same unknowns.

📚 23. References

These peer-reviewed articles support the methods behind this algebra calculator and algebra solver: how students learn to solve equations and where they go wrong, exact polynomial arithmetic and factoring, numerical root finding, and the use of computer algebra in teaching.

  1. Booth, J. L., Barbieri, C., Eyer, F., & Paré-Blagoev, E. J. (2014). Persistent and pernicious errors in algebraic problem solving. Journal of Problem Solving, 7(1), Article 3. https://doi.org/10.7771/1932-6246.1161
  2. Herscovics, N., & Linchevski, L. (1994). A cognitive gap between arithmetic and algebra. Educational Studies in Mathematics, 27(1), 59–78. https://doi.org/10.1007/BF01284528
  3. Kieran, C. (1981). Concepts associated with the equality symbol. Educational Studies in Mathematics, 12(3), 317–326. https://doi.org/10.1007/BF00311062
  4. Linchevski, L., & Herscovics, N. (1996). Crossing the cognitive gap between arithmetic and algebra: Operating on the unknown in the context of equations. Educational Studies in Mathematics, 30(1), 39–65. https://doi.org/10.1007/BF00163752
  5. MacGregor, M., & Stacey, K. (1997). Students' understanding of algebraic notation: 11–15. Educational Studies in Mathematics, 33(1), 1–19. https://doi.org/10.1023/A:1002970913563
  6. Stacey, K., & MacGregor, M. (1999). Learning the algebraic method of solving problems. Journal of Mathematical Behavior, 18(2), 149–167. https://doi.org/10.1016/S0732-3123(99)00026-7
  7. Rittle-Johnson, B., & Star, J. R. (2007). Does comparing solution methods facilitate conceptual and procedural knowledge? An experimental study on learning to solve equations. Journal of Educational Psychology, 99(3), 561–574. https://doi.org/10.1037/0022-0663.99.3.561
  8. Star, J. R., & Rittle-Johnson, B. (2008). Flexibility in problem solving: The case of equation solving. Learning and Instruction, 18(6), 565–579. https://doi.org/10.1016/j.learninstruc.2007.09.018
  9. Tall, D., de Lima, R. N., & Healy, L. (2014). Evolving a three-world framework for solving algebraic equations in the light of what a student has met before. Journal of Mathematical Behavior, 34, 1–13. https://doi.org/10.1016/j.jmathb.2013.12.003
  10. Vaiyavutjamai, P., & Clements, M. A. (2006). Effects of classroom instruction on students' understanding of quadratic equations. Mathematics Education Research Journal, 18(1), 47–77. https://doi.org/10.1007/BF03217429
  11. Kieran, C., & Drijvers, P. (2006). The co-emergence of machine techniques, paper-and-pencil techniques, and theoretical reflection: A study of CAS use in secondary school algebra. International Journal of Computers for Mathematical Learning, 11(2), 205–263. https://doi.org/10.1007/s10758-006-0006-7
  12. Pierce, R., & Stacey, K. (2004). A framework for monitoring progress and planning teaching towards the effective use of computer algebra systems. International Journal of Computers for Mathematical Learning, 9(1), 59–93. https://doi.org/10.1023/B:IJCO.0000038246.98119.14
  13. Collins, G. E. (1967). Subresultants and reduced polynomial remainder sequences. Journal of the ACM, 14(1), 128–142. https://doi.org/10.1145/321371.321381
  14. Zassenhaus, H. (1969). On Hensel factorization, I. Journal of Number Theory, 1(3), 291–311. https://doi.org/10.1016/0022-314X(69)90047-X
  15. Lenstra, A. K., Lenstra, H. W., & Lovász, L. (1982). Factoring polynomials with rational coefficients. Mathematische Annalen, 261(4), 515–534. https://doi.org/10.1007/BF01457454
  16. Bareiss, E. H. (1968). Sylvester's identity and multistep integer-preserving Gaussian elimination. Mathematics of Computation, 22(103), 565–578. https://doi.org/10.1090/S0025-5718-1968-0226829-0
  17. Kerner, I. O. (1966). Ein Gesamtschrittverfahren zur Berechnung der Nullstellen von Polynomen. Numerische Mathematik, 8(3), 290–294. https://doi.org/10.1007/BF02162564
  18. Aberth, O. (1973). Iteration methods for finding all zeros of a polynomial simultaneously. Mathematics of Computation, 27(122), 339–344. https://doi.org/10.1090/S0025-5718-1973-0329236-7
  19. Jenkins, M. A., & Traub, J. F. (1970). A three-stage variable-shift iteration for polynomial zeros and its relation to generalized Rayleigh iteration. Numerische Mathematik, 14(3), 252–263. https://doi.org/10.1007/BF02163334
  20. Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM Computing Surveys, 23(1), 5–48. https://doi.org/10.1145/103162.103163
STATS UNLOCK · statsunlock.com · Algebra Calculator
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Important Plots & Charts

Most Popular