2
$\begingroup$

I am trying to find a function that gives me the divergent part of series in any case.

The method "Series[]" does not work because Series[42,{n,0,-1}] gives as result 42 (which is not divergent in n)

The method "SeriesCoefficient[]" does not work because I do not know the lowest order, so that SeriesCoefficient[1/n^2 + 1/n + 2 + n^2,{n,0,-1}]only gives 1 (from the 1/n-term) but I loose information about the 1/n^2 term.

Is there a possibility to combine the advantages (to eliminate the disadvantages) of both approaches? Thanks for your answers.

$\endgroup$
4
  • $\begingroup$ Can it be that you are looking for Residue? $\endgroup$ Jun 3 '14 at 9:16
  • $\begingroup$ Not exactly ... for example: 1/n^2 + 2/n + 1 + n should give back 1/n^2 + 2/n but Residue of that function gives 1. $\endgroup$
    – user14728
    Jun 3 '14 at 11:46
  • $\begingroup$ This might or might not be reliable: singularPart[f_, x_, p_: 0] := Expand[Normal[Series[(x - p)*f, {x, p, 1}] + O[x - p]]/(x - p)] $\endgroup$ Jun 3 '14 at 15:42
  • 1
    $\begingroup$ Any help?: (1) Series[expr, {n, 0, -1}] /. {s_SeriesData :> s, _ -> 0} or (2) #2 - (Normal[#] /. n -> Infinity) &[Series[expr, {n, 0, 0}], Series[expr, {n, 0, -1}]]. I don't know what you would want for functions like Sin[1/n]. $\endgroup$
    – Michael E2
    Nov 1 '14 at 21:35
1
$\begingroup$

You might do as follows:

    singPart[f_] := 
  Plus @@ ({Coefficient[f, n, #], #} & /@ 
      Range[-Exponent[f, 1/n], -1] /. {x_, y_} -> x*n^y);

Then if

f = a*n^2 + b*n + e/n^2 + c/n + d + g/n^4;

singPart[f]

returns

(*    g/n^4 + e/n^2 + c/n      *)

Edit: the above function works incorrectly in the case of numeric coefficients. The one below should work in the both cases:

    sing[f_] := Module[{g, lst, cond},
  g[{x_, y_}] := x*n^y;
  lst[z_] := {Coefficient[z, n, #], #} & /@ 
    Range[-Exponent[z, 1/n], -1];
  cond = And @@ (Map[NumberQ, lst[f], {2}] // Flatten);
  Plus @@ Map[g, If[cond, Select[lst[f], #[[1]] != 0 &], lst[f]]]
  ]
$\endgroup$
1
  • $\begingroup$ Thanks for your answer, but - for exapmle - singPart[1/n^2] returns 1 - 2/n $\endgroup$
    – user14728
    Jun 3 '14 at 13:35

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.