Approximate Maclaurin series for $\sqrt x$

power seriesradicalsreal-analysissequences-and-seriestaylor expansion

One of my hobbies for the past while has been Taylor and Maclaurin series. I understand that since $ f(x)=\sqrt x $ isn't analytic at zero, we can't make a Maclaurin series expansion for it.

However, after some playing around, I was able to construct a Maclaurin series which closely approximates square root of x. It isn't obvious to me why this function should exist (I tried searching for it), and I was hoping someone more knowledgeable could explain, or point me in the right direction at the very least. The function is: $$f(x)= \frac{1}{\sqrt \pi} \sum_{n=0}^{\infty}\frac{x^n (-1)^n}{n! (1-2n)}$$ Here's a plot for reference 🙂 Approximate Maclaurin series for sqrt(x)

Edits after some insight from Goncalo, I think I understand. I'll construct the approximation, but first some foreground
The $\sqrt x \operatorname{erf}(\sqrt x) $ term seemed mysterious, and led me down a rabbit hole. I initally assumed that given an analytic function $ f(x) $, $ f(\sqrt x)$ wouldn't have a Maclaurin series representation because $ \sqrt x $ isn't analytic at zero.

However, as long as $ f(x) $ is an even function, we're in luck! Consider $$ f(x) = \cos(\sqrt x) $$ We could write this as
$$ \cos(\sqrt x) = \sum_{n=0}^{\infty} \frac{x^\frac{n}{2} \operatorname{t}(n)}{n!} $$ Where
$ \operatorname{t}(n) = \cos(\frac{\pi}{2}n)$
Now, since cosine is an even function, all the fractional power terms are cancelled (!!), meaning we can rearrange to
$$ \cos(\sqrt x) = \sum_{n=0}^{\infty} \frac{x^n \operatorname{t}(2n)}{n! \operatorname{P}(n,2n)} $$
Where $\operatorname{P}(k,x)$ is the falling factorial:
$$ \operatorname{P}(k,x) = \prod_{m=0}^{k-1}x-m$$ Interestingly, this lets us find values for imaginary numbers, and smoothly extends the domain for $ \cos(\sqrt x) $ into the negative reals. We can use this trick on the integral of $ \operatorname{erf}(x) $ like so. First, set up this ugly but useful Maclaurin series, which represents the J$ _{th} $ integral of the Gaussian $ e^{-x^2} $
$$ \operatorname{t}(n,J) = \left\{n+\operatorname{mod}\left(J,2\right)=1:0,\frac{\cos\left(\frac{\pi}{2}\left(n-J\right)\right)P\left(\frac{n+1-J}{2},n+1-J\right)}{n+1-J}\right\} $$

Let $ \operatorname{even}(x) = \sum_{n=0}^{\infty}\frac{x^n t(n,2)}{n!} $. This is the second integral of the Gaussian.
Notice that if you normalize this function like so: $\frac{1}{\sqrt \pi}(2\operatorname{even}(x)-1)$ , it approximates $\operatorname{y}=x$. But we'll leave it for now.

Since $ \operatorname{even}(x) $ is an even function, we can use our trick to find $ \operatorname{even}(\sqrt x) $

We'll set up a new Maclaurin series based on our first one:
$$ \operatorname{u}(n) = \frac{\operatorname{t}(2n, 2)}{P(n,2n)} $$

Now, we have $ \operatorname{even}(\sqrt x)=\sum_{n=0}^{\infty}\frac{x^n \operatorname{u}(n)}{n!}$

All that's left to do is normalize, and we get
$$ \frac{1}{\sqrt \pi}(2\sum_{n=0}^\infty\frac{x^n \operatorname{u}(n)}{n!}-1) \approx \sqrt x $$
If anyone finds this interesting, here's a Desmos demo

Best Answer

According to WolframAlpha, your series is equal to the function $$ g(x)=\sqrt{x}\,\text{erf}(\sqrt{x})+\frac{e^{-x}}{\sqrt{\pi}}, \tag{1} $$ where $\text{erf}$ is the error function. Its asymptoptic series is given by $$ \text{erf}(x)\sim 1-\frac{e^{-x^2}}{\sqrt{\pi}}\left(\frac{1}{x}-\frac{1}{2x^3}+O\left(\frac{1}{x^5}\right)\right)\qquad(x\gg 1). \tag{2} $$ Substituting $x$ with $\sqrt{x}$ in $(2)$ and plugging the resut in $(1)$ yields $$ g(x)\sim\sqrt{x}+\frac{e^{-x}}{\sqrt{\pi}}\left(\frac{1}{2x}+O\left(\frac{1}{x^2}\right)\right)\qquad(x\gg 1), \tag{1} $$ which explains why your series is a good approximation to $\sqrt{x}$ for $x\gg 1$.

Related Question