Function reference · Algebra

partfrac

Splits a fraction of polynomials into partial fractions.

It handles distinct and repeated linear factors, irreducible quadratic factors, and fractions where the top has a higher degree than the bottom (it divides first).

If there is nothing to split, the expression comes back unchanged.

Notation

partfrac(x, variable)

Write it in an expression: nerdamer('partfrac((4*k-1)/(k*(k+2)),k)'), or in the Playground.

nerdamer.partfrac

nerdamer.partfrac(x: ExpressionInput, variable?: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

import { partfrac }

import { partfrac } from 'nerdamer/algebra';
partfrac(x: ExpressionInput, variable?: ExpressionInput): Expression

Import only this function, from nerdamer/algebra.

Examples

Two distinct linear factors.

partfrac((4*k-1)/(k*(k+2)),k)
// → (-1/2)*k^-1+(9/2)*(2+k)^-1
Open in Playground

Divides first; here there is no remainder.

partfrac((x^2-1)/(x-1),x)
// → 1+x
Open in Playground

A repeated factor, x^2.

partfrac(1/(x^2*(x-1)),x)
// → -x^-2-x^-1+(-1+x)^-1
Open in Playground

Nothing to split: unchanged.

partfrac(1/(x^2+1),x)
// → (1+x^2)^-1
Open in Playground

← Back to Function reference