Define the function which is a polynomial in one variable with a couple of undetermined coefficients
In[]:=
f[x_]:=(-1+x)-a[1]-+-a[2]++
1
4
4
(1+x)
(-1+x)a[2]
1+x
2(-1+x)
3
(1+x)
2
2
(1+x)
2(1+x)-+
(-1+x)a[2]
2
(1+x)
a[2]
1+x
-1+x
3
a[1]+
(-1+x)a[2]
1+x
It seems like f is singular in 1, when rewriting it, however, one can clearly see that this is not the case.
In[]:=
f[x]f[x]//Expand//Simplify
Out[]=
1
4
4
(1+x)
(-1+x)a[2]
1+x
2(-1+x)
3
(1+x)
2
2
(1+x)
2(1+x)-+
(-1+x)a[2]
2
(1+x)
a[2]
1+x
-1+x
3
a[1]+
(-1+x)a[2]
1+x
Out[]=
1
4
3
(1+x)
3
a[1]
2
(-1+)
2
x
2
a[1]
2
a[2]
3
x
2
a[2]
2
a[2]
4
x
2
a[2]
2
x
2
a[2]
2
x
2
a[2]
2
x
2
a[2]
2
a[2]
Evaluation of f at 1 gives the Error ‘’
"Infinite expression encountered.
1
0
In[]:=
f[1]
1
0
Out[]=
Indeterminate
Evaluation at y and then substituting y with 1 again gives the Error ‘’
"Infinite expression encountered.
1
0
In[]:=
f[y]/.y->1
1
0
Out[]=
Indeterminate
Now, defining the same(!!) function, just rewritten so that it is obvious that is is not singular.
In[]:=
g[x_]:=f[x]//Expand//Simplifyg[x]
Out[]=
1
4
3
(1+x)
3
a[1]
2
(-1+)
2
x
2
a[1]
2
a[2]
3
x
2
a[2]
2
a[2]
4
x
2
a[2]
2
x
2
a[2]
2
x
2
a[2]
2
x
2
a[2]
2
a[2]
Evaluation directly at 1 again gives the Error ‘’
"Infinite expression encountered.
1
0
In[]:=
g[1]
1
0
Out[]=
Indeterminate
However, evaluation at y and substituting y with 1 gives the correct result
In[]:=
g[y]/.y->1
Out[]=
1
2
2
a[2]
2
a[2]
2
a[2]
