The algebra and number-theory rules behind the math calculators, each with an example checked in code. For percentages see the Percentage Formulas Cheat Sheet; for shapes the Geometry Formulas Cheat Sheet.
Powers, roots and logarithms
| Shape or idea | Formula | Example |
|---|---|---|
| Exponent rules | aᵐ·aⁿ = aᵐ⁺ⁿ, aᵐ/aⁿ = aᵐ⁻ⁿ, (aᵐ)ⁿ = aᵐⁿ, a⁰ = 1, a⁻ⁿ = 1/aⁿ |
2³ × 2⁴ = 2⁷ = 128; 5⁻² = 1/25 |
| Roots | ⁿ√a = a^(1/n), √(ab) = √a·√b |
∛27 = 27^(1/3) = 3 |
| Logarithm rules | log(xy) = log x + log y, log(x/y) = log x − log y, log(xᵏ) = k·log x |
log₁₀ 1000 = 3, log₂ 8 = 3, ln(e²) = 2 |
| Change of base | log_b x = ln x / ln b |
log₂ 8 = ln 8 / ln 2 = 3 |
| Scientific notation | a × 10ⁿ with 1 ≤ a < 10 |
12 300 = 1.23 × 10⁴; 0.0045 = 4.5 × 10⁻³ |
| Quadratic formula | x = (−b ± √(b² − 4ac)) / 2a |
x² − 5x + 6 = 0: discriminant 1, roots 2 and 3 |
| Systems of equations | add or subtract equations to eliminate one variable |
2x + y = 5 and x − y = 1: add them, 3x = 6, so x = 2 and y = 1 |
Try the Exponent Calculator, Root Calculator, Log Calculator, Scientific Notation Calculator, Quadratic Formula Calculator, Polynomial Root Solver and System of Equations Solver.
Integers, sequences and more
| Shape or idea | Formula | Example |
|---|---|---|
| Factorial | n! = n × (n − 1) × … × 1, 0! = 1 |
5! = 120 |
| Greatest common factor (GCF) | Euclid: gcd(a, b) = gcd(b, a mod b) |
gcd(12, 18) = 6 |
| Least common multiple (LCM) | lcm(a, b) = a·b / gcd(a, b) |
lcm(12, 18) = 36 |
| Prime factorization | divide by the smallest prime until 1 |
360 = 2³ × 3² × 5 |
| Modulo (remainder) | a mod n = a − n·⌊a/n⌋ |
17 mod 5 = 2; −7 mod 3 = 2 in math and Python, −1 in C and JavaScript |
| Arithmetic sequence | aₙ = a₁ + (n − 1)d, Sₙ = n(a₁ + aₙ)/2 |
3, 7, 11, …: the 10th term is 39 and the first ten add to 210 |
| Geometric sequence | aₙ = a₁·rⁿ⁻¹ |
2, 6, 18, …: the 6th term is 486 |
| Half-life decay | N = N₀ · (½)^(t / T) |
80 g with a half-life of 5 days after 15 days: 10 g |
| 2×2 determinant | det = ad − bc for rows (a, b) and (c, d) |
rows (1, 2) and (3, 4): -2 |
| Complex numbers | i² = −1, |a + bi| = √(a² + b²) |
|3 + 4i| = 5; (2 + 3i)(1 − i) = 5 + i |
Try the Factorial Calculator, GCF Calculator, LCM Calculator, Factor Calculator, Prime Factorization Calculator, Prime Number Checker, Modulo Calculator, Number Sequence Calculator, Half-Life Calculator, Matrix Calculator and Complex Number Calculator. The Derivative Calculator and Graphing Calculator cover calculus and plotting, where d/dx xⁿ = n·xⁿ⁻¹.
Common mistakes
- Distributing a power.
(a + b)²isa² + 2ab + b², nota² + b². - Log of a sum.
log(x + y)does not equallog x + log y; only products split. - A negative discriminant is not an error. It means the quadratic has two complex roots and no real ones.
- Sign of a modulo. Languages disagree for negative numbers, so test before relying on it.