# How to plot the following Partial Sum?

How can I plot: $$\sum_{n=1}^{400}\frac1{n^3\sin^2(n)}$$ without using the Table function? I am looking for a plot similar to the discrete plot in Mathematica. I am new to this software, I was able to complete the job with Maple and MATLAB but can't figure out how to do so in Mathematica. Thank you for any help!

$\textbf{MAPLE CODE:}$

L:=ListTools:-PartialSums([seq(1/((n^3)*(sin(n)^2)),n=1..400)]):
plots:-listplot(L,style=point);


$\textbf{MAPLE OUTPUT:}$

$\textbf{MATLAB OUTPUT:}$

• What do you mean by "plot the partial sum"? That sum is just a number, so what are you actually plotting? If you mean plot the sequence, then do look up DiscretePlot. – march Mar 23 '17 at 3:53
• I mean by ploting the values of the given sum up to 400... – DMH16 Mar 23 '17 at 3:55
• Can you share your try in Maple? – zhk Mar 23 '17 at 3:56
• @MapleSE-Area51Proposal I forgot the paranthesis, now it should work – DMH16 Mar 23 '17 at 4:09
• Would ListPlot[Accumulate[Function[n, 1/(n^3 Sin[n]^2)] @ Range[400]], Filling -> Axis] work for you? – J. M. will be back soon Mar 23 '17 at 4:11

Another way to do it, is to use Array.

f[N1_] = Sum[1/(n^3*Sin[n]^2), {n, 1, N1}]
Array[f, {400}];
ListPlot[%, PlotRange -> All, Filling -> Axis]


Edit

The approach suggested by @J.M. in the comment is more efficient than this one.

ListPlot[Array[f, {400}], PlotRange -> All, Filling -> Axis] // AbsoluteTiming


1.03085

ListPlot[Accumulate[Function[n, 1/(n^3 Sin[n]^2)]@Range[400]], Filling -> Axis,
PlotRange -> All] // AbsoluteTiming


0.424839

• The plot is not very clear, I will add the picture of the plots I am looking for (the ones i got with matlab and maple) – DMH16 Mar 23 '17 at 4:05
• @DMH16 See the edit – zhk Mar 23 '17 at 4:30
• You only need to add Filling -> Axis. This is a bit wasteful, tho, since terms are computed repeatedly in Sum[]. – J. M. will be back soon Mar 23 '17 at 4:31
partialSums = Accumulate[1/(#^3 Sin[#]^2) & /@ Range[400]];

ListLinePlot[partialSums, PlotRange -> All, Filling -> 0]


ListLogPlot[partialSums, Joined -> True, Filling -> Axis]


DiscretePlot as mentioned by march:

f[N1_] = Sum[1/(n^3*Sin[n]^2), {n, 1, N1}];

DiscretePlot[f[x], {x, 0, 400}, PlotRange -> All]