# How do I combine like terms?

Simplifies an expression by multiplying out brackets and combining like terms, with exact fractions.

- Page: https://www.acalculator.org/math/combine-like-terms-calculator
- JSON spec: https://www.acalculator.org/math/combine-like-terms-calculator.json
- Version: cbd9abf31fc3

## Default answer

Example with the default inputs (Expression 3x + 7 + 4x + 5): 3x + 7 + 4x + 5 simplifies to 7x + 12.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| e | Expression | An expression in one or more letters. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Simplified | The expression with like terms combined. |

## Method

Multiply out brackets and whole powers, then add the exact coefficients of terms with the same letters to the same powers.

## Assumptions

- Coefficients are exact fractions: 0.1 is 1/10. Pieces such as sin(x) are combined only when written the same way.

## Worked examples

1. e = 3x + 7 + 4x + 5 gives result = 7x + 12. Source: OpenStax Prealgebra 2e, 2.2, Ex. 2.21. https://openstax.org/books/prealgebra-2e/pages/2-2-evaluate-simplify-and-translate-expressions.
2. e = 7x^2 + 8x - x^2 - 4x gives result = 6x^2 + 4x.

## FAQ

### What are like terms?

Like terms have the same letters raised to the same powers; only their number in front (the coefficient) may differ. 3x and −5x are like terms, and so are 2x²y and 7x²y. x and x² are not, and neither are xy and x. Numbers with no letter, such as 7 and 5, are like terms too.

### How do I combine like terms?

Add the coefficients of each group of like terms and keep the letter part: 3x + 4x = 7x and 7 + 5 = 12, so 3x + 7 + 4x + 5 = 7x + 12. Terms that are not alike stay separate: 7x² − x² + 8x − 4x = 6x² + 4x.

### Does the page multiply out brackets?

Yes. A number or term times a bracket is distributed, and whole-number powers of a bracket up to the 20th are multiplied out, before the like terms are added: 3(x + 2) − 5x = 3x + 6 − 5x = −2x + 6, and (x + 1)³ = x³ + 3x² + 3x + 1.

### What about fractions and decimals?

Coefficients stay exact fractions: x/2 + x/3 = 5x/6, and 0.1x + 0.2x = 3x/10 (0.1 is exactly 1/10). Dividing by a single term moves it under the fraction bar: 1/x + 2/x = 3/x.

### Are sin(x) or √x combined too?

Yes, when they are written the same way: 2 sin(x) + 3 sin(x) = 5 sin(x), and sqrt(x) + 2 sqrt(x) = 3 sqrt(x). The page does not use identities, so sqrt(x) and x^(1/2) are kept apart, and so are e^(2x) e^x and e^(3x).

### How is the answer checked?

The simplified text is read back and must equal your expression at 15 test points, to about 1 part in a billion. If it does not, the page says "No verified answer".

## Sources

- OpenStax, Prealgebra 2e, section 2.2 Evaluate, Simplify, and Translate Expressions: https://openstax.org/books/prealgebra-2e/pages/2-2-evaluate-simplify-and-translate-expressions
