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.
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.
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.
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.
| Job | What it does | Example | Use it when |
|---|---|---|---|
| Simplify | Expands brackets and combines like terms | 3(x + 2) − 2(x − 4) = x + 14 | An expression is long or messy |
| Factor | Writes a polynomial as a product | 6x² + 11x − 35 = (2x + 7)(3x − 5) | You need the roots, or to cancel a fraction |
| Solve | Finds the value of the letter that makes an equation true | 2(3x − 5) = 4x + 6 gives x = 8 | There is an = sign and one unknown |
| Inequality | Finds every value that makes it true | 3 − 2x ≤ 7 gives x ≥ −2 | There is <, >, ≤ or ≥ |
| System | Solves several equations together | 2x + 3y = 12, x − y = 1 gives (3, 2) | There are two or more unknowns |
| Standard form | Rewrites a line as Ax + By = C | y = 23x − 4 gives 2x − 3y = 12 | A teacher asks for standard form |
| Matrix rank | Counts independent rows by row reduction | [[1, 2], [2, 4]] has rank 1 | Linear algebra and systems |
🧮 2. Enter Your Problem
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
🧠 4. Understanding Your Answer, In Detail
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.
📌 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.
📌 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.
📌 Conventions
- Give the answer and the one key step that earns the method mark.
- List accepted equivalent forms, such as 0.5 for 12.
📌 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.
📌 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
🔀 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.
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
- 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.
- Use the keypad on a phone. The keys add x, y, powers, brackets, the = sign and the inequality signs without hunting for symbols.
- Choose what to do. Leave the mode on Auto detect, or pick Simplify, Factor, Solve, Inequality, System, Standard form, Evaluate or Matrix rank.
- 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.
- Add values to evaluate. For Evaluate mode, type values like x = 2, y = -1 in the Evaluate at box.
- Choose decimal places and answer form. Pick 2, 4, 6 or 10 decimal places, and exact and decimal or decimal only.
- Press Solve. Nothing is calculated until you press Solve or Enter. Changing the sample clears the old results.
- Read the answer and the steps. The green box gives the exact answer first, then the decimal, the solution type and a Verified badge.
- Check the four charts. They show the graph, both sides of the equation, the roots and the coefficients.
- 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.
=(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 want | Excel function or tool | Note |
|---|---|---|
| Solve any one-unknown equation | Data → What-If Analysis → Goal Seek | Set the difference cell to 0 by changing the x cell |
| Linear equation ax + b = c | =(C2-B2)/A2 | Fails 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-in | Solver handles several unknowns at once |
| Exact fraction display | Format Cells → Fraction → Up to three digits | Display only; Excel still stores a decimal |
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
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.
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)
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)
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)
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
| Situation | What happens | Fix |
|---|---|---|
=-3^2 | Excel 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.2 | Stored as 0.30000000000000004 in all three programs | This calculator converts decimals to exact fractions first |
=MOD(-7,3) | Excel and R give 2 (sign of the divisor); some languages give −1 | Check the sign convention before you rely on MOD |
=LOG(100) | Excel's LOG is base 10; R's log() is base e | Use log10() in R, LN() in Excel |
| Goal Seek answer | Shows 7.99999 instead of 8 | Tighten 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
| Error | Cause | Fix |
|---|---|---|
| #NUM! | SQRT of a negative discriminant, or MINVERSE of a singular matrix | Use IMSQRT, or check MDETERM is not 0 |
| #DIV/0! | The x coefficient is 0, or 2a is 0 | The equation is not linear or not quadratic; recheck the coefficients |
| #VALUE! | Text such as “2x” typed into a cell used in arithmetic | Type only the number 2 and keep the x in the header |
| #SPILL! | MMULT result has no empty cells to spill into | Clear the cells below the formula |
| Goal Seek may not have found a solution | No root near the start value, or the sides never meet | Try 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.
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
| Part | What it does | Watch out for |
|---|---|---|
1. lhs, rhs, f | Writes each side as a function and moves everything to one side | R needs *: write 2 * (3 * x - 5), never 2(3x - 5) |
| 2. Linear shortcut | Reads the intercept f(0) = −16 and slope 2, then x = 16 ÷ 2 = 8 | Works only when f is linear |
| 3. Check | Substitutes x back and compares the two sides | Use all.equal(), not ==, for decimals |
4. uniroot() | Finds a root between two numbers where f changes sign | Gives one root only, to about 4 decimal places by default |
5. polyroot() | All roots of a polynomial | Coefficients in ascending order (c, b, a), the opposite of NumPy; results are complex, so take Re() |
6. solve(A, b) | Solves a linear system | Error “system is exactly singular” means no unique solution |
7. qr(M)$rank | Matrix rank | Uses a tolerance, so near-dependent rows may count as dependent |
8. MASS::fractions() | Prints decimals as fractions | It approximates; it cannot write a surd |
9. png(..., res = 300) | Saves the figure at 300 dpi | Always 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
| Problem | Fix |
|---|---|
| Error: could not find function “2” | You wrote 2(x). R needs 2 * (x). |
uniroot: f() values at end points not of opposite sign | Widen the interval, or plot f to see where it crosses 0 |
polyroot gives the wrong roots | The coefficients are in the wrong order; R wants c, b, a |
| Roots print as 1.78+0i | Use Re(roots) when the imaginary parts are about 0 |
round(2.5) gives 2 | R rounds half to even; this is correct behaviour |
| Empty PNG file | Run dev.off() after plotting |
| Need exact factoring or simplifying | Install caracas (SymPy from R) and use factor_() and simplify() |
10.5 Useful one-liners
| Task | R code |
|---|---|
| Solve ax + b = c | (c - b) / a |
| All roots of x³ − 6x² + 11x − 6 | Re(polyroot(c(-6, 11, -6, 1))) |
| Discriminant | b^2 - 4 * a * c |
| Determinant | det(A) |
| Evaluate at x = 2 | f(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.
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
| Part | What it does | Watch out for |
|---|---|---|
symbols("x y") | Creates algebra letters | Without it, x is an ordinary variable and SymPy cannot work with it |
Eq(lhs, rhs) | Builds an equation | Do not write lhs == rhs; that just tests equality and returns False |
solve(eq, x) | Returns a list of solutions | The 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 fraction | 3/4 becomes the float 0.75 and ruins exactness |
expand, factor, together | Simplify, factor, combine fractions | simplify() is slower and sometimes picks an odd form |
linsolve | Solves a linear system | Returns a set of tuples; an empty set means no solution |
Matrix.rank() | Exact rank | Exact with integers and fractions; NumPy's matrix_rank uses a tolerance |
savefig(dpi=300) | Saves the figure | Call 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
| Problem | Fix |
|---|---|
| TypeError: unsupported operand for ^ | Use ** for powers |
| Answer shows 0.333333333333333 | Use Rational(1, 3) or nsimplify() |
solve returns [] | No solution, or the equation is an identity; check with simplify(lhs - rhs) |
math.sqrt(-1) raises ValueError | Use sympy.sqrt or cmath.sqrt |
numpy.roots gives a different order | NumPy wants descending order (a, b, c), the opposite of R |
| Figure window never appears in a script | The script uses the Agg backend; open the saved PNG |
11.5 Useful one-liners
| Task | Python (SymPy) |
|---|---|
| Solve for x | solve(Eq(2*(3*x - 5), 4*x + 6), x) |
| Solve an inequality | solve_univariate_inequality(3 - 2*x <= 7, x) |
| Expand | expand((x + 1)**2 - (x - 1)**2) gives 4*x |
| Factor | factor(x**4 + 4) |
| Evaluate | (3*x**2 + 2*x - 7).subs(x, 2) gives 9 |
| Numeric roots | numpy.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
| Property | Rule | Example |
|---|---|---|
| Commutative | a + b = b + a, ab = ba | 3x + 5 = 5 + 3x |
| Associative | (a + b) + c = a + (b + c) | (2x + 3) + 4 = 2x + 7 |
| Distributive | a(b + c) = ab + ac | 4(x − 2) = 4x − 8 |
| Additive identity and inverse | a + 0 = a, a + (−a) = 0 | 5x − 5x = 0 |
| Multiplicative identity and inverse | a × 1 = a, a × (1/a) = 1 for a ≠ 0 | (2/3) × (3/2) = 1 |
| Zero product property | If ab = 0 then a = 0 or b = 0 | x(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
| Rule | Formula | Example |
|---|---|---|
| Product | am · an = am+n | x2 · x3 = x5 |
| Quotient | am ÷ an = am−n | x7 ÷ x4 = x3 |
| Power of a power | (am)n = amn | (x2)3 = x6 |
| Zero exponent | a0 = 1 (a ≠ 0) | 70 = 1 |
| Negative exponent | a−n = 1 ÷ an | x−1 = 1x |
| Power of a product | (ab)n = anbn | (2x)3 = 8x3 |
12.3 Special products and factoring patterns
| Pattern | Expanded | Factored | Example |
|---|---|---|---|
| Square of a sum | a2 + 2ab + b2 | (a + b)2 | x2 + 6x + 9 = (x + 3)2 |
| Square of a difference | a2 − 2ab + b2 | (a − b)2 | 4x2 − 12x + 9 = (2x − 3)2 |
| Difference of squares | a2 − b2 | (a − b)(a + b) | x2 − 25 = (x − 5)(x + 5) |
| Sum of cubes | a3 + b3 | (a + b)(a2 − ab + b2) | x3 + 27 = (x + 3)(x2 − 3x + 9) |
| Difference of cubes | a3 − b3 | (a − b)(a2 + ab + b2) | x3 − 8 = (x − 2)(x2 + 2x + 4) |
| Simple trinomial | x2 + (p + q)x + pq | (x + p)(x + q) | x2 − 7x + 12 = (x − 3)(x − 4) |
| Grouping | ax + 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² − 4ac | Roots | Graph | Example |
|---|---|---|---|
| Positive perfect square | Two rational roots, it factors | Crosses the x axis twice | x² − 5x + 6: D = 1, x = 2, 3 |
| Positive, not a square | Two irrational roots (surds) | Crosses twice | x² − 2: D = 8, x = ±√2 |
| Zero | One repeated root | Touches the axis once | x² − 4x + 4: D = 0, x = 2 |
| Negative | Two complex roots | Never touches the axis | x² + 2x + 5: D = −16, x = −1 ± 2i |
12.5 Inequality rules and interval notation
| Inequality | Interval | Number line | Rule |
|---|---|---|---|
| x > 3 | (3, ∞) | Open circle at 3, arrow right | Round bracket: 3 is not included |
| x ≥ −2 | [−2, ∞) | Filled circle at −2, arrow right | Square 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 4 | A compound inequality |
| Multiply by −1 | −2x ≤ 4 becomes x ≥ −2 | Flip the sign when multiplying or dividing by a negative | |
12.6 Perfect squares and cubes from 1 to 15
| n | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| n² | 1 | 4 | 9 | 16 | 25 | 36 | 49 | 64 | 81 | 100 | 121 | 144 | 169 | 196 | 225 |
| n³ | 1 | 8 | 27 | 64 | 125 | 216 | 343 | 512 | 729 | 1000 | 1331 | 1728 | 2197 | 2744 | 3375 |
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 want | Type | Notes |
|---|---|---|
| 3x² − 2x + 1 | 3x^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/3 | A space makes a mixed number |
| x ≤ 5 | x <= 5 | Or use the ≤ key |
| A system | 2x + 3y = 12, x - y = 1 | Commas between equations |
| A matrix | rank [[1,2],[3,4]] | Or 1 2; 3 4 in Matrix mode |
| xy | xy or x*y | Every 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
| Problem | Exact answer | Working |
|---|---|---|
| Solve 2x + 5 = 11 | x = 3 | Steps → |
| Solve 3x − 7 = 14 | x = 7 | Steps → |
| Solve 5(x − 2) = 3x + 4 | x = 7 | Steps → |
| Solve x/2 + 3 = 7 | x = 8 | Steps → |
| Solve 4x + 3 = 2x − 9 | x = −6 | Steps → |
| Solve 0.2x + 1.5 = 3.1 | x = 8 | Steps → |
| Solve 7 − 3x = 22 | x = −5 | Steps → |
| Solve 2(x + 4) = 5x − 7 | x = 5 | Steps → |
Quadratic equations
| Problem | Exact answer | Working |
|---|---|---|
| Solve x2 − 5x + 6 = 0 | x = 2 or x = 3 | Steps → |
| Solve x2 + 4x − 12 = 0 | x = −6 or x = 2 | Steps → |
| Solve 2x2 + 3x − 2 = 0 | x = −2 or x = 12 | Steps → |
| Solve x2 − 16 = 0 | x = −4 or x = 4 | Steps → |
| Solve x2 + 6x + 9 = 0 | x = −3 | Steps → |
| Solve x2 + x + 1 = 0 | x = −1 − √3i2 or x = −1 + √3i2 | Steps → |
| Solve 3x2 − 2x − 4 = 0 | x = 1 − √133 or x = 1 + √133 | Steps → |
Simplify and expand
| Problem | Exact answer | Working |
|---|---|---|
| Simplify 2(x + 3) + 4(x − 1) | 6x + 2 | Steps → |
| Simplify (x + 3)2 | x2 + 6x + 9 | Steps → |
| Simplify (2x − 1)(x + 4) | 2x2 + 7x − 4 | Steps → |
| Simplify 3x2 + 2x − x2 + 5x | 2x2 + 7x | Steps → |
| Simplify (x2 − 9)/(x − 3) | x + 3 | Steps → |
| Simplify 3/4 + 2/3 | 1712 | Steps → |
| Simplify 1/(x − 1) − 1/(x + 1) | 2x2 − 1 | Steps → |
Factoring
| Problem | Exact answer | Working |
|---|---|---|
| Factor x2 + 7x + 12 | (x + 4)(x + 3) | Steps → |
| Factor x2 − 3x − 10 | (x + 2)(x − 5) | Steps → |
| Factor 2x2 − 8 | 2(x + 2)(x − 2) | Steps → |
| Factor 4x2 + 12x + 9 | (2x + 3)2 | Steps → |
| Factor x3 − 27 | (x − 3)(x2 + 3x + 9) | Steps → |
| Factor 6x2 − x − 2 | (2x + 1)(3x − 2) | Steps → |
Inequalities
| Problem | Exact answer | Working |
|---|---|---|
| Inequality 2x − 5 > 7 | x > 6 | Steps → |
| Inequality −3x + 4 ≤ 10 | x ≥ −2 | Steps → |
| Inequality x2 − 4 < 0 | (−2, 2) | Steps → |
Systems and lines
📈 13. Example Results
Simplify an expression with two brackets
The everyday simplify question.
Simplify 4(2x − 3) − 3(x − 5).
| Step | Result | Why |
|---|---|---|
| Expand | 8x − 12 − 3x + 15 | Multiply into each bracket; −3 × −5 = +15 |
| x terms | 8x − 3x = 5x | Combine like terms |
| Numbers | −12 + 15 = 3 | Combine like terms |
| Answer | 5x + 3 | Standard form |
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
Solve x/3 + x/4 = 7
Clear the fractions first.
A typical exam equation with two fractions.
| Step | Result | Why |
|---|---|---|
| Multiply by 12 | 4x + 3x = 84 | 12 is the lowest common denominator |
| Combine | 7x = 84 | Like terms |
| Divide | x = 12 | Divide both sides by 7 |
| Check | 4 + 3 = 7 ✓ | 12/3 + 12/4 |
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
Solve 0.5x + 1.25 = 2.75 − 0.25x
Decimals become exact fractions.
A worksheet equation with decimal coefficients.
| Step | Result | Why |
|---|---|---|
| Collect x terms | 0.5x + 0.25x = 0.75x | Add 0.25x to both sides |
| Collect numbers | 2.75 − 1.25 = 1.5 | Subtract 1.25 |
| Divide | x = 1.5 ÷ 0.75 = 2 | As fractions: (3/2) ÷ (3/4) = 2 |
| Check | both sides 2.25 ✓ | Substitute x = 2 |
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
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.
| Step | Result | Why |
|---|---|---|
| Write the equation | w² + 3w − 40 = 0 | Area = width × length |
| Factor | (w + 8)(w − 5) = 0 | 8 × −5 = −40, 8 − 5 = 3 |
| Roots | w = −8 or w = 5 | Zero product property |
| Context | w = 5 m, length 8 m | A width cannot be negative |
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.
A repeated root: x² − 6x + 9 = 0
When the discriminant is zero.
Solve x² − 6x + 9 = 0.
| Step | Result | Why |
|---|---|---|
| Discriminant | 36 − 36 = 0 | b² − 4ac |
| Factor | (x − 3)² = 0 | Perfect square trinomial |
| Root | x = 3 | Multiplicity 2 |
| Check | 9 − 18 + 9 = 0 ✓ | Substitute |
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)
Solve 3(x + 2) = 3x + 4
The x terms vanish.
Solve 3(x + 2) = 3x + 4.
| Step | Result | Why |
|---|---|---|
| Expand | 3x + 6 = 3x + 4 | Distributive property |
| Subtract 3x | 6 = 4 | The x terms cancel |
| Conclusion | No solution | A false statement means no x works |
| Graph | parallel lines | Same slope 3, different intercepts |
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 ∅.
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?
| Step | Result | Why |
|---|---|---|
| Substitute | 12a + 7(250 − a) = 2500 | c = 250 − a |
| Simplify | 5a + 1750 = 2500 | Expand and combine |
| Solve | a = 150 | 5a = 750 |
| Back-substitute | c = 100 | 250 − 150; check 1800 + 700 = 2500 ✓ |
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.
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.
| Step | Result | Why |
|---|---|---|
| Wrong way | x = 5 only | Dividing by x assumes x is not 0 |
| Right way | x² − 5x = 0 | Move everything to one side |
| Factor | x(x − 5) = 0 | GCF is x |
| Roots | x = 0 or x = 5 | Zero product property |
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
- Copy the equation exactly. 2(3x − 5) = 4x + 6. Most lost marks start with a miscopied sign.
- Expand the brackets. Multiply the 2 by both terms inside: 2 × 3x = 6x and 2 × (−5) = −10. Now 6x − 10 = 4x + 6.
- Collect the x terms on one side. Subtract 4x from both sides: 2x − 10 = 6. Choose the side that keeps the x coefficient positive.
- Collect the numbers on the other side. Add 10 to both sides: 2x = 16.
- Divide by the coefficient of x. x = 16 ÷ 2 = 8.
- Check in the original equation. Left: 2(3 × 8 − 5) = 2 × 19 = 38. Right: 4 × 8 + 6 = 38. Both sides agree.
- 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
| Calculator | Keys | What 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-570MS | Type 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 again | X = 8 |
| Casio fx-991EX, a system | MENU 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 CE | MATH, scroll to Solver, enter 0 = 2(3X − 5) − (4X + 6), put a guess such as 0 in X, then ALPHA ENTER | X = 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:
- 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.
- 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.
- Ticket sales: 250 tickets at 12 and 7 dollars raised 2500 dollars. A 2 by 2 system gives 150 adult and 100 child tickets.
- 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 shorter | Simplify / expand |
| Has no = sign and you want a product | Factor (GCF first, then patterns, then the ac method) |
| Has one = sign and the highest power is 1 | Solve: expand, collect, divide |
| Has one = sign and x², and b² − 4ac is a perfect square | Factor and use the zero product property |
| Has x² and it will not factor | Quadratic formula, or completing the square if you need the vertex |
| Has x in a denominator | Multiply by the common denominator, then reject excluded values |
| Has <, >, ≤ or ≥ | Inequality: solve, flip on a negative, give interval notation |
| Has two or more equations | System: 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
- 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.
- Numbers are exact. 0.333 is treated as 3331000, not 13. Type 1/3 when you mean a third.
- 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.
- The domain excludes zeros of every denominator in the original problem, even when a factor later cancels.
- Exponents are whole numbers. x^-1 is fine and means 1/x; x^(1/2) is a root and is not simplified here.
Limitations
- No functions: sin, cos, log, ln, ex and √x are not handled. Use a scientific or graphing calculator.
- 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.
- Factoring with three or more letters covers the common factor, grouping and homogeneous two-letter cases, not every multivariable polynomial.
- Equations with two letters are solved for one letter only when they are linear in that letter.
- Systems must be linear (no x², no xy). Non-linear systems need substitution by hand or a computer algebra system.
- 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
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
StatsUnlock Team. (2026). Algebra calculator with steps [Interactive mathematics tool]. StatsUnlock. Retrieved 17 October 2026, from https://statsunlock.com/algebra-calculator/@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/}}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).
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
List every factor and the prime factorisation of a number, the first step in finding a GCF.
Open the tool →Add, subtract, multiply and divide mixed numbers with exact fraction answers.
Open the tool →Solve a/b = c/x by cross-multiplying, the simplest equation with a fraction in it.
Open the tool →Fit a polynomial to data points and read its coefficients and curve.
Open the tool →Find the best straight line y = mx + b through real data.
Open the tool →Solve angle problems that turn into simple linear equations.
Open the tool →Rearrange z = (x − μ) / σ for any of its letters, a real use of literal equations.
Open the tool →Find the average, or the missing value needed to reach a target average.
Open the tool →📖 22. Glossary of Terms
| Term | Plain-English meaning |
|---|---|
| Coefficient | The number in front of a letter. In 7x², the coefficient is 7. |
| Complex root | A root of the form p + qi, where i² = −1. They come in pairs when the discriminant is negative. |
| Constant | A term with no letter, such as −5. |
| Degree | The highest power of the variable. x³ + 2x has degree 3. |
| Discriminant | b² − 4ac, the part under the square root in the quadratic formula. Its sign tells you how many real roots there are. |
| Equation | A statement that two expressions are equal, with an = sign. |
| Excluded value | A value of the variable that makes a denominator zero, so it is not allowed. |
| Expand | Remove brackets by multiplying out. 2(x + 3) expands to 2x + 6. |
| Expression | Numbers, letters and operations with no = sign, such as 3x + 5. |
| Extraneous root | An answer produced by the algebra that does not work in the original equation, usually because it divides by zero. |
| Factor | Write as a product. x² − 9 factors to (x − 3)(x + 3). |
| GCF | Greatest common factor, the largest term that divides every term. Called HCF in the UK and India. |
| Identity | An equation true for every value of the variable, such as 2(x + 1) = 2x + 2. |
| Inequality | A statement using <, >, ≤ or ≥ instead of =. Its answer is a range of values. |
| Interval notation | A way to write a range: [−2, ∞) means −2 and everything above it. |
| Like terms | Terms with exactly the same letters and powers, such as 3x² and −5x². |
| Linear | Having highest power 1. Its graph is a straight line. |
| Polynomial | A sum of terms that are numbers times whole-number powers of the variables. |
| Quadratic | A polynomial of degree 2, written ax² + bx + c with a ≠ 0. |
| Rank | The number of independent rows of a matrix, found by row reduction. |
| Root | A value that makes a polynomial equal 0. Also called a zero or a solution. |
| RREF | Reduced row echelon form, the simplest shape a matrix can be row reduced to. |
| Surd | An exact root that is not a whole number, such as √17 or 4√3. |
| System of equations | Two 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.
- 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
- 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
- Kieran, C. (1981). Concepts associated with the equality symbol. Educational Studies in Mathematics, 12(3), 317–326. https://doi.org/10.1007/BF00311062
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- Kerner, I. O. (1966). Ein Gesamtschrittverfahren zur Berechnung der Nullstellen von Polynomen. Numerische Mathematik, 8(3), 290–294. https://doi.org/10.1007/BF02162564
- 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
- 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
- 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





