pub fn polygamma(n: i32, z: &Expression) -> ExpressionExpand description
Polygamma function ψ^(n)(z)
The polygamma function is the (n+1)-th derivative of ln(Γ(z)): ψ^(n)(z) = d^(n+1)/dz^(n+1) ln(Γ(z))
§Special Cases
- ψ^(0)(z) = ψ(z) (digamma)
- ψ^(1)(z) = trigamma
- ψ^(2)(z) = tetragamma
§Mathematical Properties
- ψ^(1)(1) = π²/6 (trigamma at 1)
- ψ^(n)(z+1) = ψ^(n)(z) + (-1)^n · n! / z^(n+1)
§Arguments
n- Order of derivative (0 = digamma, 1 = trigamma, etc.)z- Argument
§Examples
use mathhook_core::{Expression, Number};
use mathhook_core::functions::special::polygamma;
let result = polygamma(0, &Expression::Number(Number::Integer(1)));
let trigamma = polygamma(1, &Expression::Number(Number::Integer(1)));