apart() performs a partial fraction decomposition on a rational function

apart(x)

Arguments

x

A caracas_symbol

Examples

if (has_sympy()){
  def_sym(x)
  expr = (4*x**3 + 21*x**2 + 10*x + 12)/(x**4 + 5*x**3 + 5*x**2 + 4*x)
  apart(expr)
}
#> c:  2⋅x - 1       1     3
#>    ────────── - ───── + ─
#>     2           x + 4   x
#>    x  + x + 1