Algebraic Expression Calculator

Type an expression the way you write one on paper. The page expands the brackets, collects like terms, factors what factors, then plugs in any value you give. Each step comes from the real working, ready to hold against your homework line by line.

Other shapes:

Results land here as you type. Write 2x for 2 times x, x^2 for a power, and (x+1)/(x-1) for a fraction.

One problem, worked by hand: (x + 3)(x − 2) + 2x(x + 1)

Load sample fills the box with this expression. Here is the same working the page prints, written out the way a teacher wants to see the work.

  1. First pair of brackets. Every term meets every term: x2 − 2x + 3x − 6, which tidies to x2 + x − 6.
  2. Second bracket. 2x(x + 1) gives 2x2 + 2x.
  3. Like terms. x2 + 2x2 = 3x2 and x + 2x = 3x. The −6 has no partner. Simplified form: 3x2 + 3x − 6.
  4. Common factor. 3 goes into all three terms, leaving x2 + x − 2.
  5. Two numbers. You need a product of −2 and a sum of 1. Those are −1 and 2, so the factored form is 3(x + 2)(x − 1).

Now type 4 in the x box. The original gives 7 × 2 + 8 × 5 = 54. The factored form gives 3 × 6 × 3 = 54.

Same number, so the rewrite holds. The green spot check under each answer runs this test on non-round values without being asked, using the original you typed against the printed result.

How your typing gets read

Most wrong answers from any calculator start here. The Read as line under the box shows the page's reading before you trust a result.

You typeRead asWorth knowing
2x(x+1)2 · x · (x + 1)A missing times sign counts as multiply.
xyx · yEach letter is its own variable. Capital X and small x differ.
1/2x(1/2) · xMultiply and divide run left to right. For x under the line, type 1/(2x).
-x^2−(x2)The power goes first. Type (-x)^2 for a positive square.
2^3^229 = 512Stacked powers read from the top down, not 82.
e, pi2.71828…, 3.14159…Both are constants, so e never works as a variable name here.
sin xErrorFunctions need brackets: sin(x).

Functions on offer: sqrt, sin, cos, tan, log (base 10), ln, exp, abs. Trig runs in radians. For degrees, use the scientific calculator.

Three slips worth testing

Each of these looks right on paper. Type both versions, give x a value, and the numbers split apart.

Squaring a bracket

(x + 3)2 is not x2 + 9. At x = 1, you get 16 against 10. The missing piece is the middle term, 6x.

The minus before a bracket

5 − (x − 2) equals 7 − x. Writing 3 − x means the second sign never flipped.

Cancelling across a plus

(x + 4)/4 is not x. Factors cancel. Terms do not. At x = 8, the fraction gives 3.

The hole a simplified fraction hides

Type (x^2-4)/(x-2) into the box. The top factors into (x + 2)(x − 2), one bracket cancels, and x + 2 remains.

The two forms disagree at exactly one point. At x = 2 the original reads 0/0, which has no value, while x + 2 says 4. On a graph you get a straight line with a single missing dot.

So the amber line reads Only holds where x ≠ 2, and the Value row refuses to answer at 2, whatever the short form says. Most algebra courses mark a rational answer down without this restriction, so copy it along with the result.

What the term table tells you

Polynomials get a row per term. Take 5x2y3 − 2x + 7:

  • Coefficient: the number in front, sign included. Here 5, −2 and 7.
  • Degree of a term: add the exponents, so x2y3 has degree 5.
  • Degree of the expression: the highest term degree. This one sits at 5.

The label above the results uses both counts. A degree 2 expression with three terms is a quadratic trinomial. Two terms make a binomial, one a monomial.

Where this calculator stops

An expression has no equals sign, so nothing here gets solved. Rewrites only. Type 2x+3=7 and the page sends you to the linear equation solver instead. Other limits:

  • Factors stay rational. x2 − 2 stays whole, since a split needs √2. The quadratic formula calculator gives those roots.
  • "No rational factors found" means none turned up. With three or more variables the search misses some. The expanded form of (x + y + z)3 does not factor back here. Single-variable polynomials of degree 6 and up get checked for rational roots and quadratic factors only.
  • No trig or log identities. sin(x)^2+cos(x)^2 stays as typed, though its Value row returns 1. Log rules stay unapplied too.
  • Real numbers only. sqrt(-4) stops with a message.
  • Size caps. Variable exponents top out at 64 and expansions at 3,000 terms. Factoring skips anything past 80 terms.

Questions from students and parents

How do I type x squared?

Type x^2, or tap the x squared key under the box. Pasted text with a ² character also works, and so does × or ÷ from a document.

Why does 0.1 + 0.2 give 3/10 instead of a decimal?

Every number is held as an exact fraction, so no rounding creeps in. A plain floating point calculation returns 0.30000000000000004. The Value row prints a decimal beside any fraction.

Why does sqrt(x^2) give abs(x) and not x?

A square root never comes out negative. At x = -3, sqrt(x^2) is sqrt(9), which is 3, so the correct short form is the absolute value of x.

Do the value boxes take fractions or pi?

Yes. The value boxes accept 1/3, -2.5 or pi/2. Fractions keep the answer exact. Pi and trig functions give a decimal to 10 significant digits.

Does my expression get sent anywhere?

No. All the algebra runs in your browser, so the page works with no account and keeps nothing you type.