1

During some calculations, I came up with a very weird function. It reads

$$f(k)=\frac{8(1-k^2)+k^4+4(k^2-2)\sqrt{1-k^2}}{k^4\sqrt{1-k^2}}.$$

Fo $f$ to be real, we have to choose $k\in [-1,0[ \ \cup \ ]0,1]$. Depending on the region we choose to represent this function, the several plots I get are really different from each other and get really strange. For example, for $k\in [0.01,0.99]$, and using $N=100$ sampling points, I get

enter image description here

Above, the function seems to have a very normal behavior. However, when I evaluate it near $k=0$, the functions seems highly discontinuous. For $k \in [1,2]\times10^{-4}$, I get

enter image description here

Another example is $k\in [1,10]\times10^{-9}$, for which I get the weirdest plot of all,

enter image description here

Can someone elucidate me on this behavior? What kind of functions is this, and why does this happen? By the way, I am using Python but I don't think this is a numerical problem.

Moreover, I am interested in obtaining an approximation for $f$ near $k=0$. These plots seem to indicate that such a function holds no approximation near the origin. However, the Taylor expansion function of Mathematica gives me this

enter image description here

Is this expression valid near $k=0$?

1 Answers1

2

Yes, it is a numeric problem. You have$$f(k)=\frac{8\sqrt{1-k^2}+4(k^2-2)}{k^4}+\frac1{\sqrt{1-k^2}}$$when $k\in(-1,1)\setminus\{0\}$. The $\frac1{\sqrt{1-k^2}}$ part causes no problem near $0$. And, again near $0$, you have$$8\sqrt{1-k^2}+4(k^2-2)=-k^4-\frac12k^6+\cdots,$$and therefore$$\frac{8\sqrt{1-k^2}+4(k^2-2)}{k^4}=-1-\frac12k^2+\cdots$$So, if you decide that $f(0)=0$, you get a continuous functions from $(-1,1)$ into $\Bbb R$.