1
$\begingroup$

I expected the two plots to be identical. Can anyone confirm that the discrepancies show a bug?

b[s_, v_] := If[s == 0, 1, -s*Zeta[1 - s, v]]; 

Table[Expand[FullSimplify[b[n, x]]], {n, 1, 6}]
Plot[%, {x, -1, 3/2}, PlotRange -> {-1, 1}]

Table[BernoulliB[n, x], {n, 1, 6}]
Plot[%, {x, -1, 3/2}, PlotRange -> {-1, 1}]
$\endgroup$
5
  • $\begingroup$ It seems that not all identical. b[s_, v_] := If[s == 0, 1, -s*Zeta[1 - s, v]]; funs1 = Table[Expand[FullSimplify[b[n, x]]], {n, 1, 6}] // FunctionExpand; funs2 = Table[BernoulliB[n, x], {n, 1, 6}]; Grid[{funs1, funs2}, Frame -> All] $\endgroup$
    – cvgmt
    Commented Jun 21, 2021 at 8:20
  • $\begingroup$ @cvgmt Yes, but that's exactly the problem! $\endgroup$
    – Carl
    Commented Jun 21, 2021 at 8:30
  • $\begingroup$ From the Mathematica documentation, "Zeta[s] gives the Riemann zeta function [Zeta](s)" and "Zeta[s, a] gives the generalized Riemann zeta function [Zeta](s, a)" and "HurwitzZeta[s, a] gives the Hurwitz zeta function [Zeta](s, a)". MathWorld states that there are two different forms of the Hurwitz zeta function, one implemented as HurwitzZeta[s, a], the other as Zeta[s, a] and the two are identical only for Re[a] > 0. $\endgroup$
    – Bob Hanlon
    Commented Jun 21, 2021 at 14:46
  • $\begingroup$ @Bob, see my comment on my answer. The sentence there was taken over literally from MathWorld. $\endgroup$
    – Carl
    Commented Jun 21, 2021 at 14:54
  • $\begingroup$ As were the statements in my comment. MathWorld is telling you that there are two conventions, it is up to you to ensure that you are using the appropriate convention (and Mathematica implementation) for your particular use. $\endgroup$
    – Bob Hanlon
    Commented Jun 21, 2021 at 15:03

2 Answers 2

2
$\begingroup$

And the solution is: use HurwitzZeta instead of Zeta.

b[s_, v_] := If[s == 0, 1, -s*HurwitzZeta[1 - s, v]]; 
V := Table[FunctionExpand[FullSimplify[b[n, x]]], {n, 1, 6}];
W := Table[BernoulliB[n, x], {n, 1, 6}]; 
Grid[{V, W}, Frame -> All]

oh well ...

$\endgroup$
1
  • $\begingroup$ According to MathWorld: "The Hurwitz zeta function is implemented in the Wolfram Language as Zeta[s, a]." ?? $\endgroup$
    – Carl
    Commented Jun 21, 2021 at 11:15
0
$\begingroup$

Perhaps a partial answer: According to Mathworld, Eq. 9, the comparison should be:

bs = Table[-BernoulliB[n + 1, x]/(n + 1), {n, 1, 6}]

and

zs = Table[Zeta[-n, x], {n, 1, 6}]

which appear to be the same when x>0:

Plot[bs, {x, 0, 3/2}]

and

Plot[zs, {x, 0, 3/2}]

but not when x < 0

Plot[bs, {x, -1, 0}]

and

Plot[zs, {x, -1, 0}]

but note that:

With[{abs = Abs[bs]}, Plot[abs, {x, -1, 0}]]

appears to be the same, but for n=1

$\endgroup$
1
  • $\begingroup$ What you say in the first part is exactly the same only with one factor shifted from one side to the other. For the second part: BernoulliB[n, x] are the functions against which the representation is to be validated, not to any others. $\endgroup$
    – Carl
    Commented Jun 21, 2021 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.