0
$\begingroup$

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...

$\endgroup$
1
  • $\begingroup$ So, you have looked at Table[], Sum[], and Plot[]? $\endgroup$ May 19, 2015 at 15:30

1 Answer 1

4
$\begingroup$
Log[2] + Sum[(-1)^(k + 1) (x - 2)^k/(k 2^k), {k, 1, Infinity}]

Log[x]

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+.

Clear[f]

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

f[x, Infinity]

Log[x]

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

$\endgroup$

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.