# Errors with assigment and no errors with replacement rule, why? [closed]

So I have an expression, let's call it f11 which is a function of t of this form f11= a1*t^(-4)+ a3*t^(-3)+... and so on up until a finite positive power of t. In the expression there are some coefficient of the powers of t, for example \[Sigma]1. Now if I write something like this:

f11= bla bla
\[Sigma]1 = 0;
Series[f11, {t, 0, -2}]


these 3 errors appear

• Power::infy: Infinite expression 1/0^2 encountered.
• Power::infy: Infinite expression 1/0 encountered.
• Infinity::indet: Indeterminate expression ComplexInfinity+ComplexInfinity encountered.

f11= bla bla
Series[f11, {t, 0, -2}] /. \[Sigma]1 -> 0


no error occours and everything is fine, why is that so?

I'd prefer to set the variable \[Sigma]1 to 0 once and for all not apply the rule /. \[Sigma]1 -> 0 everytime so having to apply the rule is kind of a nuisance

EDIT: Also I want to point out that I have other parameters inside f11 like \[Sigma]2 or a1 and so on and when I assign them to 0 they cause no problem whatsoever, but thye enter inside f11 more or less in the same way \[Sigma]1 does. In fact in the rest of the notebook, I assign \[Sigma]2=0 and then go on writing the series expansion of f11 but I always have to keep the rule /. \[Sigma]1 -> 0

EDIT 2: To make it clearer I will post here the essentials of my notebook:

a = A*(t + a2*t^2 + a3*t^3 + a4*t^4 + O[t]^5);
H = (\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]a\))/a;
\[Sigma] = \[Sigma]i*(1 + \[Sigma]1*t + \[Sigma]2*t^2 + \[Sigma]3*
t^3 + \[Sigma]4*t^4 + O[t]^5);
f1 = H^2 ==
a^2*(\[Rho]r0/a^4(*+(\[Rho]m0/a^3)*)+ V)/(
3*\[Gamma]*\[Sigma]^2) + (\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]\[Sigma]\))^2/(
6*\[Gamma]*\[Sigma]^2) - 2*H*\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]\[Sigma]\)/\[Sigma] + (\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]\[Sigma]\))^3/(
3*\[Gamma]*a^2*\[Sigma]^2)*(6*g*H - dg*\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]\[Sigma]\));
f11 = Collect[Expand[f1], t];


At this point I do the commands mentioned above and I have the problem mentioned above. I do it in this way cause f11 is a bit of a long expression and I want to isolate the term order by order and see them, without necessarly know them in advance. For clarity I will also post the screenshots from my notebook which would be easier to read with respect to the code written in that way

Some quantities that enter f11: Definition of f11 and errors with assignment [Sigma]1 = 0: Definition of f11 and no errors with rule /.[Sigma]1->0]: Complete expression of f11: • If f11 is already a power series, why do you say Series[f11, {t, 0, -2}] . Further, the order of a power series can not be a negative number. Oct 1, 2020 at 16:16
• @DanielHuber you are right, I simply have a function of t. For your first question, I write Series[f11, {t, 0, -2}] to show me only the terms up to the order -2 Oct 1, 2020 at 16:55
• @DanielHuber I edited the question, is it more clear now? Oct 1, 2020 at 16:59
• The problem is not with "Series", but with "f11". There you have terms with 1/[Sigma]1, therefore setting [Sigma]1 =0 will give an error in f11. Convince yourself by: f11 /. [Sigma]1 ->0 Oct 2, 2020 at 14:05
• It is always a good idea to use "Simplify" after construction of a complicated expression. You just saw an example what can happen if you don't. In addition, MMA may proceed much faster if it can deal with simpler expressions.Finally, it is also easier for the human animal to see what is going on. Oct 2, 2020 at 19:26