Add and Subtract Rational Expressions Calculator

Add and Subtract Rational Expressions Calculator

Emerging AI Skill PRO

Enter Calculation

Each expression is a ratio of two linear terms: (a·x + b) / (c·x + d). Enter the coefficients below (use 0 for an x-coefficient to make that part a plain number).

First expression
Numerator: a·x + b
Denominator: c·x + d
Second expression
Numerator: a·x + b
Denominator: c·x + d

Formula

ab+cd=a·d+c·bb·d\frac{\text{a}}{\text{b}} + \frac{\text{c}}{\text{d}} = \frac{\text{a}\cdot\text{d} + \text{c}\cdot\text{b}}{\text{b}\cdot\text{d}}
Usage stats

Advertisement

Results

Simplified expression
(8x + 7) / (x² + x - 2)
Term x² x constant
Numerator 0 8 7
Denominator 1 1 -2

Report an error on this page

What this calculator does

This tool adds or subtracts two rational expressions — fractions whose numerator and denominator are polynomials in the variable x. It rewrites both fractions over a common denominator, combines the numerators, and reduces the answer to a single simplified rational expression. Each expression is entered as a ratio of linear terms, \(\frac{a x + b}{c x + d}\), which covers the forms most often seen in algebra: plain constants, single terms, and linear numerators and denominators.

How to use it

For the first expression, type the numerator as its x-coefficient a and constant b, then the denominator as its x-coefficient c and constant d. Choose Add or Subtract, then enter the second expression the same way. To enter a plain constant such as 5, set its x-coefficient to 0 and its constant to 5. The calculator returns the combined expression reduced to lowest terms, along with a table of the numerator and denominator coefficients (the x-squared, x, and constant parts).

Diagram showing two fractions being combined over a common denominator using cross multiplication
Cross-multiplying gives a common denominator b·d and combines the numerators.

The formula explained

Two fractions are combined by writing them over the product of their denominators (a common denominator) and adding or subtracting the cross-multiplied numerators:

$$\frac{a_1 x + b_1}{c_1 x + d_1} \pm \frac{a_2 x + b_2}{c_2 x + d_2} = \frac{(a_1 x + b_1)(c_2 x + d_2) \pm (a_2 x + b_2)(c_1 x + d_1)}{(c_1 x + d_1)(c_2 x + d_2)}$$

When the two denominators are equal (or one is a constant multiple of the other) the calculator uses that single denominator instead of the product, so the answer stays in lowest terms. Any whole number that divides every coefficient of the numerator and denominator is then cancelled.

Advertisement

Worked example

Add \(\frac{3}{x+2}\) and \(\frac{5}{x-1}\). The denominators share no common factor, so the common denominator is their product, \((x+2)(x-1)\):

$$\frac{3}{x+2} + \frac{5}{x-1} = \frac{3(x-1) + 5(x+2)}{(x+2)(x-1)} = \frac{8x + 7}{x^2 + x - 2}$$

The numerator expands to \(3x - 3 + 5x + 10 = 8x + 7\) and the denominator to \(x^2 + x - 2\). Because 8, 7, and the denominator coefficients share no common factor, the simplified answer is \(\frac{8x + 7}{x^2 + x - 2}\).

Flat diagram of a combined fraction being reduced by dividing top and bottom by the greatest common factor
After combining, divide the numerator and denominator by their GCD to simplify.

How to Add or Subtract Rational Expressions by Hand

A rational expression is a ratio of polynomials. This calculator works with two linear-over-linear expressions of the form \(\frac{a_1x+b_1}{c_1x+d_1}\) and \(\frac{a_2x+b_2}{c_2x+d_2}\), where the four coefficients of each fraction are the numbers you type into the fields p1, q1, r1, s1 and p2, q2, r2, s2. The procedure below is the same one the tool follows, so you can check every intermediate line.

  1. Factor each denominator. Write the denominators as \(c_1x+d_1\) and \(c_2x+d_2\) and pull out any integer factor you see (for instance \(4x+8 = 4(x+2)\)). Factoring first is what lets you notice that two denominators are secretly the same.
  2. Determine the LCD. If the two denominators share no common factor, the least common denominator is simply their product, \((c_1x+d_1)(c_2x+d_2)\). If one denominator is a constant multiple of the other — or the two are identical — the LCD is the single (larger) denominator, not the product. Multiplying identical denominators together would needlessly square them.
  3. Multiply each numerator by the factor its denominator is missing. With the product LCD this gives \((a_1x+b_1)(c_2x+d_2)\) for the first fraction and \((a_2x+b_2)(c_1x+d_1)\) for the second. Each fraction keeps its value because you multiplied numerator and denominator by the same quantity.
  4. Expand both products. Use the distributive rule term by term:

$$(a_1x+b_1)(c_2x+d_2) = a_1c_2x^2 + (a_1d_2 + b_1c_2)x + b_1d_2$$

  1. Add or subtract the numerators. For subtraction, distribute the minus sign across every term of the second numerator — the middle and constant terms both flip sign, not just the first one. This is the single most common source of error: \(-(x^2 - x - 12) = -x^2 + x + 12\).
  2. Collect like terms. Group the \(x^2\) terms, the \(x\) terms and the constants separately so the numerator ends up in the standard form \(Ax^2 + Bx + C\).
  3. Reduce to lowest terms. Compute the greatest common divisor of all integer coefficients in the numerator and denominator and divide through by it. If numerator and denominator also share a whole linear factor, cancel that factor as well — but only for values of \(x\) that were already allowed.
  4. State the domain restrictions. Every value of \(x\) that makes an original denominator zero must be excluded, even if that factor cancels during simplification. Here that means

$$x \neq -\frac{d_1}{c_1} \qquad \text{and} \qquad x \neq -\frac{d_2}{c_2}$$

Note the domain comes from the original denominators. In \(\frac{2x+4}{4x+8}\), the value \(x=-2\) stays excluded even though the expression simplifies to the constant \(\tfrac{1}{2}\).

Advertisement

Key Terms and Variables

Term Meaning
Rational expression A ratio of two polynomials, \(\frac{P(x)}{Q(x)}\), defined only where the denominator \(Q(x) \neq 0\). It is the algebraic analogue of a numerical fraction.
Numerator / denominator The top and bottom polynomials of the fraction. In \(\frac{2x+1}{x+3}\) the numerator is \(2x+1\) and the denominator is \(x+3\).
Linear term \(ax+b\) A degree-one polynomial: one term with \(x\) to the first power plus a constant. All four inputs of this calculator are linear expressions.
Coefficients (p1, q1, r1, s1, p2, q2, r2, s2) The numbers multiplying \(x\) and the constants. The first fraction is \(\frac{p_1x+q_1}{r_1x+s_1}\); set the \(x\)-coefficient to 0 for a constant, e.g. \(q_1=5\) with \(p_1=0\) and \(s_1=1\), \(r_1=0\) gives the number 5.
Common denominator Any expression both denominators divide into evenly — the product \((c_1x+d_1)(c_2x+d_2)\) always works.
Least common denominator (LCD) The smallest such expression. When the two denominators share a factor, the LCD is smaller than their product; when they are identical, the LCD is that single denominator.
Cross-multiplication The shortcut \(\frac{a}{b} \pm \frac{c}{d} = \frac{ad \pm cb}{bd}\). It always gives a correct result but not necessarily one in lowest terms.
Greatest common factor (GCF / GCD) The largest integer dividing every coefficient of both numerator and denominator. Dividing by it is the final numeric simplification step: \(\frac{2x+4}{4x+8} \to \frac{x+2}{2x+4}\).
Lowest terms (simplified form) The state in which numerator and denominator share no common integer factor and no common polynomial factor.
Excluded value / domain restriction Any \(x\) making an original denominator zero, i.e. \(x = -\frac{d_1}{c_1}\) or \(x = -\frac{d_2}{c_2}\). These stay excluded even after cancellation.
Like terms Terms with the same power of \(x\). Only like terms can be combined: \(3x + (-x) = 2x\), but \(x^2\) and \(x\) cannot be merged.
Degree The highest power of \(x\). Multiplying two linear denominators adds their degrees, so the combined denominator is normally quadratic — for example \((x+2)(x-1) = x^2+x-2\). It stays linear only when one denominator is a constant or a multiple of the other.

Frequently asked questions

Do the two denominators have to be the same? No. If they differ, the calculator multiplies them to form a common denominator, then combines the numerators. If they match or are proportional, it keeps the single denominator so the result is already in lowest terms.

Can x make a denominator equal zero? Yes, and those values are excluded from the domain. For instance, \(\frac{3}{x+2}\) is undefined at \(x = -2\). The simplified expression inherits the same restrictions as the original fractions.

Does it handle squared or higher-degree terms? Each expression you enter is a ratio of linear terms, but the combined answer can contain an x-squared term because multiplying two linear denominators gives a quadratic. Inputs that are themselves quadratic or higher are outside its scope.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators