X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Finifcns.cpp;h=443022a556da6c9f48e062e2381b4be05b0e0ae3;hb=c1285bb62f3a86454ca26260cf8b4352238a1fc5;hp=e9c93938cfebfe0a4405e79e5a2dad5eced2cacd;hpb=c8feefe95a6c219195aea22050f17e2294656f32;p=ginac.git diff --git a/ginac/inifcns.cpp b/ginac/inifcns.cpp index e9c93938..443022a5 100644 --- a/ginac/inifcns.cpp +++ b/ginac/inifcns.cpp @@ -368,6 +368,37 @@ static ex Li3_eval(const ex & x) REGISTER_FUNCTION(Li3, eval_func(Li3_eval). latex_name("\\mbox{Li}_3")); +////////// +// Derivatives of Riemann's Zeta-function zetaderiv(0,x)==zeta(x) +////////// + +static ex zetaderiv_eval(const ex & n, const ex & x) +{ + if (n.info(info_flags::numeric)) { + // zetaderiv(0,x) -> zeta(x) + if (n.is_zero()) + return zeta(x); + } + + return zetaderiv(n, x).hold(); +} + +static ex zetaderiv_deriv(const ex & n, const ex & x, unsigned deriv_param) +{ + GINAC_ASSERT(deriv_param<2); + + if (deriv_param==0) { + // d/dn zeta(n,x) + throw(std::logic_error("cannot diff zetaderiv(n,x) with respect to n")); + } + // d/dx psi(n,x) + return zetaderiv(n+1,x); +} + +REGISTER_FUNCTION(zetaderiv, eval_func(zetaderiv_eval). + derivative_func(zetaderiv_deriv). + latex_name("\\zeta^\\prime")); + ////////// // factorial //////////