# Partial fraction decomposition (apart)

Split a rational expression into partial fractions.

With this function, the solver shows the steps whenever it finds them.

## How to write it

### apart(expr)

Split with respect to the variable of the expression.

**expr**

Any expression: a number, a formula, a list or a matrix. Takes an expression.

### apart(expr, x)

Split with respect to a chosen variable.

**expr**

Any expression: a number, a formula, a list or a matrix. Takes an expression.

**x**

The variable to split by. Takes a variable.

## Examples

- $\displaystyle \frac{1}{x^{2}-1} = \frac{1}{2 (x-1)}-\frac{1}{2 (x+1)}$

  `apart(1/(x^2 - 1))`

  In the solver, `apart(1/(x^2 - 1))` gives `(1/2)/(x - 1) - (1/2)/(x + 1)`.

  [Open in the solver](https://hilberon.com/?q=apart%281%2F%28x%5E2%20-%201%29%29)
- $\displaystyle \frac{1}{x (x+1)} = \frac{1}{x}-\frac{1}{x+1}$

  `apart(1/(x (x + 1)), x)`

  In the solver, `apart(1/(x (x + 1)), x)` gives `1/x - 1/(x + 1)`.

  [Open in the solver](https://hilberon.com/?q=apart%281%2F%28x%20%28x%20%2B%201%29%29%2C%20x%29)

## Related functions

- [cancel](https://hilberon.com/library/cancel)

  Cancel the common factors of a fraction.
- [together](https://hilberon.com/library/together)

  Combine fractions into one over a common denominator.
- [coefficients](https://hilberon.com/library/coefficients)

  List the coefficients of a polynomial, constant term first.
- [to_radicals](https://hilberon.com/library/to_radicals)

  Write algebraic numbers, given as roots of polynomials, with radicals.
- [collect](https://hilberon.com/library/collect)

  Group the terms of an expression by powers of a variable.
- [subs](https://hilberon.com/library/subs)

  Substitute a rule, or a list of rules, in an expression.

---
Source: https://hilberon.com/library/apart
