Doubt on differential equation involving the complementary error function 
How to find the general solution of $y''+2xy'-2ny=0$?

I was solving a problem in this thread.  The posted solution involves the error function which I am not aware of. I found this link.
How to find solution of $y''+2xy'-2ny=0$? The solution of this differential equation is given in the link as $$y=A\,\text{erfc}_n(x)+B\,\text{erfc}_n(-x)\,.$$ Even I am not aware of this notation. Kindly explain. If not, please suggest some online sources. My textbook does not have this topic.
 A: I can give you a polynomial solution. For each integer $n\geq 0$, let $p_n:\mathbb{R}\to\mathbb{R}$ denote the polynomial function
$$p_n(x)=\sum_{r=0}^{\left\lfloor\frac{n}{2}\right\rfloor}\,\frac{1}{2^{2r}\,r!\,(n-2r)!}\,x^{n-2r}\text{ for all }x\in\mathbb{R}\,.$$
Then, $y:=p_n$ is a solution to the differential equation
$$y''(x)+2x\,y'(x)-2n\,y(x)=0$$
for each integer $n\geq 0$.  You can obtain the general solution by the Reduction-of-Order Method, but I am not sure how complicated this route of attempt will be.  However, you can at least show that all solutions $y$ look like
$$y(x)=A\,p_n(x)+B\,p_n(x)\,\int_x^\infty\,\frac{\exp(-t^2)}{\big(p_n(t)\big)^2}\,\text{d}t$$
for some constants $A$ and $B$.
For $n=0$ with $p_0(x)=1$, we obtain the general solution
$$y(x)=A+\frac{2}{\sqrt{\pi}}\,B\,\text{erfc}(x)=a\,\text{erfc}_0(+x)+b\,\text{erfc}_0(-x)\,,$$
where $a:=\dfrac{A}{2}+\dfrac{2}{\sqrt{\pi}}\,B$ and $b:=\dfrac{A}{2}$, as $\text{erfc}_0=\text{erfc}$ and $\text{erfc}(+x)+\text{erfc}(-x)=2$.
In general, we note that
$$(-1)^n\,\text{erfc}_n(+x)+\text{erfc}_n(-x)=\frac{2}{\sqrt{\pi}}\,\int_{-\infty}^{+\infty}\,\frac{(x-t)^n}{n!}\,\exp\left(-t^2\right)\,\text{d}t=2\,p_n(x)\,.$$
Hence, it remains to show that the function $q_n:\mathbb{R}\to\mathbb{R}$ defined by
$$q_n(x):=\frac{2}{\sqrt{\pi}}\,\left(\frac{p_n(x)}{2^n\,n!}\right)\,\int_x^\infty\,\frac{\exp(-t^2)}{\big(p_n(t)\big)^2}\,\text{d}t\text{ for all }x\in\mathbb{R}$$
is a linear combination of $\text{erfc}_n(+x)$ and $\text{erfc}_n(-x)$, noting that
$$\text{erfc}_n(z)=\frac{2}{\sqrt{\pi}}\,\int_z^\infty\,\frac{(t-z)^n}{n!}\,\exp(-t^2)\,\text{d}t\,.$$
Perhaps, it helps to know that $p_n'(x)=p_{n-1}(x)$ and $\text{erfc}'_n(x)=-\text{erfc}_{n-1}(x)$ for every $n=1,2,3,\ldots$.  As far as I know,
$$q_0(x)=\text{erfc}(x)=\text{erfc}_0(x)\,,\,\,q_1(x)=\text{erfc}_1(x)\,,\text{ and }q_2(x)=\text{erfc}_2(x)\,.$$
I conjecture that
$$q_n(x)=\text{erfc}_n(x)\text{ for all }n=0,1,2,3,\ldots\,.$$
It will help tremendously if I can show that
$$p_n(x)\,\text{erfc}_{n-1}(x)+p_{n-1}(x)\,\text{erfc}_{n}(x)=\frac{1}{2^n\,n!}\,\left(\frac{2}{\sqrt{\pi}}\,\exp\left(-x^2\right)\right)\,,\tag{*}$$
or equivalently,
$$\text{erfc}_n(-x)\,\text{erfc}_{n-1}(+x)+\text{erfc}_n(+x)\,\text{erfc}_{n-1}(-x)=\frac{2}{2^n\,n!}\,\left(\frac{2}{\sqrt{\pi}}\,\exp\left(-x^2\right)\right)\,.\tag{#}$$

On the other hand, it is quite easy to show that $y(x):=\text{erfc}_n(x)$ satisfies the homogeneous differential equation $y''(x)+2x\,y'(x)-2n\,y(x)=0$.  For $n<2$, this can be easily checked by hand.  For $n\geq 2$, we first note that, applying integration by parts, w have
$$\text{erfc}_{n-2}(x)=\frac{2}{\sqrt{\pi}}\,\int_x^\infty\,\frac{2t(t-x)^{n-1}}{(n-1)!}\,\exp(-t^2)\,\text{d}t\,.$$
That is,
$$\text{erfc}_n''(x)=\text{erfc}_{n-2}(x)=\frac{2}{\sqrt{\pi}}\,\int_x^\infty\,\frac{\big(2x+2(t-x)\big)(t-x)^{n-1}}{(n-1)!}\,\exp(-t^2)\,\text{d}t\,.$$
Expanding the integral above yields
$$\text{erfc}_n''(x)=\small 2x\,\left(\frac{2}{\sqrt{\pi}}\,\int_x^\infty\,\frac{(t-x)^{n-1}}{(n-1)!}\,\exp(-t^2)\,\text{d}t\right)+2n\,\left(\frac{2}{\sqrt{\pi}}\,\int_x^\infty\,\frac{(t-x)^{n}}{n!}\,\exp(-t^2)\,\text{d}t\right)\,.$$
That is,
$$\text{erfc}_n''(x)=2x\,\text{erfc}_{n-1}(x)+2n\,\text{erfc}_n(x)\,.$$
Because $\text{erfc}_n'(x)=-\text{erfc}_{n-1}(x)$, we deduce that
$$\text{erfc}_n''(x)+2x\,\text{erfc}'_n(x)-2n\,\text{erfc}(x)=0\,,$$ establishing our claim.
Now, we must have 
$$\text{erfc}_n(x)=\lambda_n\,p_n(x)+\mu_n\,q_n(x)$$
for some constants $\lambda_n,\mu_n$.  For $n=0$, it is obvious that $\lambda_0=0$ and $\mu_0=1$.  For $n>0$, we note that $\text{erfc}_n(x)$ and $q_n(x)$ tend to $0$ as $x\to\infty$, whereas $p_n(x)\to\infty$ when $x\to\infty$.  This means $\lambda_n=0$.  It can be easily checked that, for an even integer $n>0$,
$$\left.\frac{\text{d}}{\text{d}x}\right|_{x=0}\,\left(\frac{\text{erfc}_{n}(x)}{p_n(x)}\right)=\frac{2^n}{\binom{n}{\frac{n}{2}}}\,\left(\frac{2}{\sqrt{\pi}}\right)=\left.\frac{\text{d}}{\text{d}x}\right|_{x=0}\,\left(\frac{q_{n}(x)}{p_n(x)}\right)\,,$$
whence $\mu_n=1$.  For an odd integer $n>0$, we note that
$$\lim_{x\to 0}\,\Biggl(x\,\left(\frac{\text{erfc}_{n}(x)}{p_n(x)}\right)\Biggr)=\frac{2^{n-1}}{n\,\binom{n-1}{\frac{n-1}{2}}}\,\left(\frac{2}{\sqrt{\pi}}\right)=\lim_{x\to 0}\,\Biggl(x\,\left(\frac{q_{n}(x)}{p_n(x)}\right)\Biggr)\,,$$
so $\mu_n=1$, as well.  This shows that $q_n(x)=\text{erfc}_n(x)$ for all $n\in\mathbb{Z}_{\geq0}$.  As a consequence, both (*) and (#) hold.
