Partial Fraction Decomposition
Partial fraction decomposition is performed using the cover-up method. This involves "covering up" a factor in the denominator and substituting the root into the remaining expression. When the denominator can be completely factored into non-repeated linear factors, this produces the desired result. When there are repeated or irreducible quadratic factors, it produces terms with unknown coefficients in the numerator that is solved as a system of equations.
It is often used when solving integrals or performing an inverse Laplace transform (see inverse_laplace).
Symbolics.partial_frac_decomposition — Function
partial_frac_decomposition(expr, x)Performs partial fraction decomposition for expressions with linear, repeated, or irreducible quadratic factors in the denominator. Can't currently handle irrational roots.
When leading coefficient of the denominator is not 1, it will be factored out and then put back in at the end, often leading to non-integer coefficients in the result. Will return nothing if the expression is not a valid polynomial fraction, or if it has irrational roots.
Examples
julia> @variables x
1-element Vector{Num}:
x
julia> partial_frac_decomposition((3x-1) / (x^2 + x - 6), x)
(1//1) / (-(2//1) + x) + (2//1) / ((3//1) + x)
julia> partial_frac_decomposition((4x^3 + 16x + 7)/(x^2 + 4)^2, x)
((4//1)*x) / ((4//1) + x^2) + (7//1) / (((4//1) + x^2)^2)
julia> partial_frac_decomposition((4x^2 - 22x + 7)/((2x+3)*(x-2)^2), x)
2 / ((3//2) + x) + -3 / ((-(2//1) + x)^2)!!! note that irreducible quadratic and repeated linear factors require the Groebner package to solve a system of equations