Why I am getting nan in python.
from sympy import *
x,f,g=symbols('x f g')
def f(x):
return (1+x**2)**2
def g(x):
return (1-f(x))/x
expand(g(x))
g(0)
I know the $x$ is in division but after manual simplification I found $$g(x)=−^3−2$$ and $$g(0)=0$$ I could not understand why python result give me $$g(0) = NaN$$ How can I get g(0)=0 in python.
Possible workaround: