RootSum(expr, func, x) is the sum of func(r) over the roots r of the
polynomial expr in x, counted with multiplicity, as SymPy's
RootSum. Linear factors are summed at once; when func is a rational
function and auto is TRUE the sum is computed exactly from the
coefficients (Viete's formulas), otherwise an unevaluated RootSum
remains. With quadratic = TRUE quadratic factors are summed over their
explicit roots. doit() sums over explicit roots when roots() finds
them all, and N() sums over numerical roots.
Arguments
- expr
A univariate polynomial.
- func
A
Lambda()of one variable, an R function of one argument, orNULLfor the identity.- x
The variable of
expr; by default its only free symbol.- auto
Evaluate sums of rational functions.
- quadratic
Sum over the roots of quadratic factors.