I need to plot the partial function:

$T_f(x)=\log 2+\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{2^kk}(x-2)^k$

for $n=2$,$n=4$ and $n=6$ on the same plot over the interval $[-\frac{1}{2},4]$ and also the maximum difference between $f$ and these partial sums of $T_f$ in the same interval

And i have no idea how to do it...

  • $\begingroup$ So, you have looked at Table[], Sum[], and Plot[]? $\endgroup$ – J. M.'s discontentment May 19 '15 at 15:30
Log[2] + Sum[(-1)^(k + 1) (x - 2)^k/(k 2^k), {k, 1, Infinity}]


Since Log is complex or unbounded for non-positive argument, the maximum difference is undefined for x <= 0

Log /@ {0, -1/4} // InputForm

{-Infinity, I*Pi - Log[4]}

The maximum difference will be arbitrarily large as x gets arbitrarily close to 0+.


f[x_, n_] := Log[2] + Sum[(-1)^(k + 1) (x - 2)^k/(k 2^k), {k, 1, n}]

f[x, Infinity]


Plot[Evaluate[Table[f[x, n], {n, {2, 4, 6, Infinity}}]], {x, -1/2, 4}, 
  PlotLegends -> {2, 4, 6, Infinity}] // Quiet

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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