I'm newbie in Mathematica. I'd like to obtain nice and verbose output for any series calculation.
For example, given a simple sequence n*(-1)^(n-1)
and hypothetical function NoEval
, I see it as follows:
sequence = n*(-1)^(n-1);
range = {n, 1, 10};
seriesFormula = NoEval[Sum[sequence, range]];
seriesExpanded = Sum[NoEval[sequence], range];
seriesSum = Sum[sequence, range];
Row[{seriesFormula, seriesExpanded, seriesSum}, "="]
expected output is:
Is there a simple way to do this?
I know there are Hold*, Unevaluated, Inactivate, etc, but I just couldn't get a concise solution without multiple definitions of the same series. I'd like to define target series just once, and then get different symbolic and/or numerical representations of it.
Thank you
Bonus question (answered) Is it possible to make Mathematica sum divergent series (Cesàro, Borel, etc) like:
1 - 1 + 1 - 1 ... = 1/2
or 1 - 2 + 4 - 8 ... = 1/3
Update: Regularization
parameter of Sum
function does the job for divergent series.
Regularization
in the docs? $\endgroup$