4
$\begingroup$

I recently learned an interesting limit and was trying to understand the asymptotics. Unfortunately I'm getting nowhere.

Take F[n_] := Log[2] - Sum[((-1)^(k-1)) * 1/k,{k,1,n}]

So, just Log[2] less the first n terms of the alternating harmonic series that convergest to Log[2].

Then the limit as n -> Infinity of Abs[n * F[n]] is 1/2.

Just playing around numerically I see that in the limit F[n] looks like 1/(2n) - 1/(4n^2), but I'd like to do a bit better and get more terms in the series.

When I try to use the DiscreteAsymptotic[] function, the output keeps referring to a built in function LerchPhi[]. This is mathematically correct, I'm sure, but what I'd like instead is a series that looks like a / n + b / n^2 + c / n^3 + . . .

Any help or pointers will be greatly appreciated.

New contributor
Mike Lawler is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
1
  • $\begingroup$ I'm not an expert in analysis so I can't judge, but it's possible that this function does not have an asymptotic expansion at n=∞. $\endgroup$ Commented yesterday

2 Answers 2

5
$\begingroup$
AsymptoticSum[((-1)^(k - 1))*1/k, {k, 1, n}, {n, Infinity, 1}]

(*-(1/2) + (-1)^n/(2 (1 + n)) + Log[2]*)

Since $|F(n)|$ goes to 0 with large n, the constant term approaches 0 so just the absolute value of the (-1)^n/(2 (1 + n)) term matters, which asymptotically looks like 1/(2 n):

F[n_] := Log[2] - Sum[((-1)^(k-1)) * 1/k,{k,1,n}]

DiscretePlot[{Abs@F[n], 1/(2 n)}, {n, 1, 100}, Filling -> None, 
 PlotLegends -> "Expressions", Frame -> True, FrameLabel -> {"n"}, 
 LabelStyle -> Directive[Bold, Medium]]

enter image description here

If you want more terms beyond the leading $\frac{1}{2n}$, you can increase the order of AsymptoticSum:

Log[2] - 
 AsymptoticSum[((-1)^(k - 1))*1/k, {k, 1, n}, {n, Infinity, 2}]
(*-(5/8) + (-1)^n/(2 (1 + n)) - (-1)^(1 + n)/(4 (1 + n) (2 + n)) + 
 Log[2]*)

Which leaves us with $\frac{(-1)^n}{2 (n+1)}-\frac{(-1)^{n+1}}{4 (n+1) (n+2)} = (-1)^n \left(\frac{1}{4 (n+2) (n+1)}+\frac{1}{2 (n+1)}\right) $ since the constants go to 0, and which asymptotically looks like $(-1)^n \left(\frac{1}{2 n}-\frac{1}{4 n^2}\right)$:

DiscreteAsymptotic[(-1)^n (1/(2 (n + 1)) + 1/(4 (n + 1) (n + 2))), {n,
   Infinity, 2}]
(*(-1)^n (-(1/(4 n^2)) + 1/(2 n))*)

So $|F(n)| \approx \frac{1}{2 n}-\frac{1}{4 n^2}$ .

I guess to get higher terms you could do something like:

getExpansion[order_] := 
 Module[{asym}, 
  asym = AsymptoticSum[((-1)^(k - 1))*1/k, {k, 1, n}, {n, Infinity, 
     order}];
  (*remove constant term*)
  asym = Select[asym, ! FreeQ[#, n] &];
  (*for Abs[F],leading term is positive and then signs alternate*)
  asym = asym/(-1)^(n+1) // Expand;
  (*asymptotic value of Abs[F]*)
  DiscreteAsymptotic[asym, {n, Infinity, order}]]


(*example*)
getExpansion[4]
(*1/(8 n^4) - 1/(4 n^2) + 1/(2 n)*)

(*plot |F(n)| with different order expansions. Series coefficient appears to be 0 for odd terms > 1*)
expansionOrders = {1, 2, 4, 6, 8};
fExpansions = getExpansion /@ expansionOrders;
fPlot = DiscretePlot[Abs@F[n], {n, 1, 20}, 
   PlotMarkers -> {Automatic, 12}, PlotStyle -> Red, Filling -> None, 
   PlotLegends -> 
    PointLegend[{Automatic}, {"F(n)"}, 
     LegendMarkers -> {Automatic, 12}, LegendFunction -> "Frame"]];
expansionPlot = 
  Plot[fExpansions, {n, 0, 20}, PlotRange -> {All, {0, 0.5}}, 
   PlotLegends -> 
    LineLegend[Automatic, expansionOrders, LegendLabel -> "order", 
     LegendFunction -> "Frame"]];
Show[fPlot, expansionPlot, Frame -> True, 
 FrameLabel -> {n, Abs[F[n]] // HoldForm}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank you so much for such a complete answer @ydd - this is miles more than I'd hoped for. $\endgroup$ Commented 15 hours ago
  • $\begingroup$ Maybe a simple way to derive this is to consider the effect of consecutive pairs as a function of n. $\endgroup$ Commented 10 hours ago
  • $\begingroup$ @DanielLichtblau I agree, azerbajdzan’s answer is the way to go $\endgroup$ Commented 8 hours ago
  • $\begingroup$ @ydd Nice answer! Please tell me the version of your MMA? I'm using 14.2.1 for Mac OS X ARM (64-bit) (March 16, 2025), and AsymptoticSum[((-1)^(k - 1))*1/k, {k, 1, n}, {n, Infinity, 1}] gives me just 1/2 - (-1)^n/(2 (1 + n)) without Log[2] term. $\endgroup$ Commented 3 hours ago
3
$\begingroup$

We can modify the original sum so that in each step it sums two terms at once instead of just one.

(-1)^(k - 1)/k (* original term of sum *)

FullSimplify[% + (% /. k -> k + 1) /. k -> 2 k - 1, 
  k ∈ Integers] // Factor

(* terms of new series *)

1/(2 k (-1 + 2 k))

So now we have asymptotics of order o:

(there is n/2 in {k, 1, n/2} because in each step we sum two original terms)

Log[2] - Sum[1/(2 k (-1 + 2 k)), {k, 1, n/2}] // FullSimplify

Table[Normal@Series[%, {n, ∞, o}], {o, 0, 6, 2}]

enter image description here

Which agrees with @ydd answer.

$\endgroup$
2
  • 1
    $\begingroup$ I commented on the previous answer before reading this one. I expect this to will simpler than any other method. $\endgroup$ Commented 10 hours ago
  • 2
    $\begingroup$ Thank you @azerbajdzan - this is a really nice solution. $\endgroup$ Commented 9 hours ago

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.