partfrac

Partial fraction decomposition

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

partfrac(f, <x>)
partfrac(f, x, options)

Description

partfrac(f, x) returns the partial fraction decomposition of the rational expression f with respect to the variable x.

Consider the rational expression with polynomials g, p, q, such that degree (p) < degree(q).

Factor of the denominator into non-constant and pair-wise coprime polynomials qi with integer exponents ei:

The partial fraction decomposition based on this factorization is a representation

where pi, j are polynomials, such that degree(pi,j) < degree(qi). In particular, pi, j are constants if qi is a linear polynomial.

partfrac uses factors qi found by the factor function. This function finds factorization over the field implied by the coefficients of the denominator. See Example 2.

If f has only one indeterminate, and you do not use options, then you can omit the second argument x in a call to partfrac. Otherwise, specify the indeterminate as a second parameter.

partfrac can also find partial fraction decomposition with respect to expressions instead of variables. See Example 3.

The option Full invokes a full factorization of the denominator into linear factors. The MaxDegree option determines whether partial fraction decomposition is a symbolic sum of RootOf terms or an expression in radicals. In general, roots belonging to an irreducible factor of the denominator of degree five or larger cannot be expressed in terms of radicals. See Example 6.

Examples

Example 1

Find partial fraction decomposition of the following expressions. You can omit specifying a variable because these rational expressions are univariate.

partfrac(x^2/(x^3 - 3*x + 2))

partfrac(23 + (x^4 + x^3)/(x^3 - 3*x + 2))

partfrac(x^3/(x^2 + 3*I*x - 2))

Find partial fraction decomposition of the following expression containing two variables, x and y. For multivariate expressions, specify the variable with respect to which you compute the partial fraction decomposition.

f := x^2/(x^2 - y^2):
partfrac(f, x), partfrac(f, y)

delete f:

Example 2

Find the partial fraction decomposition of this expression.

partfrac(1/(x^2 - 2), x)

The denominator x2 - 2 does not factor over the rational numbers.

factor(x^2 - 2)

Extend the coefficient field used by factor and partfrac by using the Adjoin option.

partfrac(1/(x^2 - 2), x, Adjoin = [sqrt(2)])

Example 3

Find the partial fraction decomposition with respect to an expression, such as sin(x).

partfrac(1/(sin(x)^4 - sin(x)^2 + sin(x) - 1), sin(x))

Example 4

Return a list consisting of the numerators and denominators of the partial fraction decomposition by using the List option.

partfrac(x^2/(x^3 - 3*x + 2), x, List)

Example 5

Find the partial fraction decomposition using numeric factorization over the field real numbers, R_.

partfrac(1/(x^3 - 2), x, Domain = R_)

Find the partial fraction decomposition of the same expression using numeric factorization over the field complex numbers, C_.

partfrac(1/(x^3 - 2), x, Domain = C_)

Example 6

Find the partial fraction decomposition factoring the denominator into linear factors symbolically. For this, use the Full option.

partfrac(1/(x^3 + x - 2), x, Full)

For irreducible denominators of the third and higher degrees, the partial fraction decomposition is a symbolic sum of the roots.

S:= partfrac(1/(x^3 + x - 3), x, Full)

MuPAD® uses the freeze function to keep the result in the form of an unevaluated symbolic sum. To evaluate this symbolic sum, use unfreeze. Evaluating this symbolic sum simplifies it back to the original input.

unfreeze(S); delete S:

Parameters

f

Rational expression in x

x

Indeterminate: typically, an identifier or an indexed identifier

Options

Full

Factor the denominator completely into linear factors, and find the partial fraction decomposition with respect to that factorization.

List

Return a list consisting of the numerators and denominators of the partial fraction decomposition.

MaxDegree

Option, specified as MaxDegree = n

Adjoin only the coefficients of the denominator with the algebraic degree not exceeding n to the field over which the denominator is factored. If you also use Full, then partfrac does not use explicit formulas involving radicals to solve polynomial equations of a degree higher than n.

Adjoin

Option, specified as Adjoin = g

Factor the denominator over the smallest field containing the rational numbers, all coefficients of the denominator, and the elements of g.

Domain

Option, specified as Domain = d

Factor the denominator over the domain d, where d is one of the following: Expr, R_, or C_. By default, d = Expr. For more details, see factor.

Mapcoeffs

Option, specified as Mapcoeffs = mp

When building the resulting expression, insert mp(c) instead of each coefficient c.

Overloaded By

f