<s>[INST] Indefinite integral of normal distribution How does one calculate the indefinite integral?
$$\int\frac1{\sigma\sqrt{2\pi}}\exp\left(-\frac{x^2}{2\sigma^2}\right)dx$$
Where $\sigma$ is some constant.

Work so far:
Integrating from exp as rest is constant.
$$\begin{align}
\int\exp\left(-\frac{x^2}{2\sigma^2}\right)dx&=\sum_{n=0}^\infty\frac{\left(-\frac{x^2}{2\sigma^2}\right)^n}{n!}=-\sum_{n=0}^\infty n!^{-1}2^{-1}\sigma^{-2n}\int x^{2n}dx\\
&=-\sum_{n=0}^\infty n!^{-1}\sigma^{-2n}x^{2n}x^{-1}\\
\end{align}$$
I pulled it apart, integrated it, now I cant put it back together.
 [/INST] It's been a while since you've asked, but this is the indefinite integral:
[\begin{array}{l}
\int {\left( {\frac{{{e^{ - \frac{1}{2}\;\cdot\;{{\left( {\frac{x}{\sigma }} \right)}^2}}}}}{{\sigma \sqrt {2\pi } }}} \right)\;dx = } \frac{{\int {\left( {\frac{{{e^{ - \frac{1}{2}\;\cdot\;{{\left( {\frac{x}{\sigma }} \right)}^2}}}}}{\sigma }} \right)} \;dx}}{{\sqrt {2\pi } }}\\
u = \frac{x}{\sigma }\\
du = \frac{1}{\sigma }\;dx\\
 = \frac{{\int {\left( {{e^{ - \frac{{{u^2}}}{2}}}} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\int {{e^{ - \frac{{{u^2}}}{2}}}} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\int {{e^{ - \frac{{{u^2}}}{2}}}} \cdot1\;du}}{{\sqrt {2\pi } }}\\
 = \frac{{{e^{ - {u^2}}}\cdot\int 1 \;du - \int {\left( { - u{e^{ - \frac{{{u^2}}}{2}}}\cdot\int 1 \;du} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1} - \int {\left( {\frac{{ - {u^2}{e^{ - \frac{{{u^2}}}{2}}}}}{1}} \right)\;} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1}\; - \frac{{ - 2{e^{ - \frac{{{u^2}}}{2}}}}}{1}\;\cdot\;\int {{u^2}} \;du + \int {\left( {\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1}\;\cdot\int {{u^2}} \;du} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1}\; + \frac{{{u^3}{e^{ - \frac{{{u^2}}}{2}}}}}{3} + \int {\left( {\frac{{{u^4}{e^{ - \frac{{{u^2}}}{2}}}}}{3}} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1}\; + \frac{{{u^3}{e^{ - \frac{{{u^2}}}{2}}}}}{3} + \frac{{{e^{ - \frac{{{u^2}}}{2}}}}}{3}\;\cdot\int {\left( {{u^4}} \right)} \;du - \int {\left( {\frac{{ - u{e^{ - \frac{{{u^2}}}{2}}}}}{3}\;\cdot\int {{u^4}} \;du} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\frac{{u{e^{ - \frac{{{u^2}}}{2}}}}}{1}\; + \frac{{{u^3}{e^{ - \frac{{{u^2}}}{2}}}}}{3} + \frac{{{u^5}{e^{ - \frac{{{u^2}}}{2}}}}}{{15}} - \int {\left( {\frac{{ - {u^6}{e^{ - \frac{{{u^2}}}{2}}}}}{{15}}} \right)} \;du}}{{\sqrt {2\pi } }}\\
 = \frac{{\sum\limits_{n = 1}^\infty  {\left( {\frac{{{u^{2n - 1}}\cdot{e^{ - \frac{{{u^2}}}{2}}}}}{{\prod\limits_{i = 1}^n {\left( {2i - 1} \right)} }}} \right)} }}{{\sqrt {2\pi } }}\\
 = \sum\limits_{n = 1}^\infty  {\left( {\frac{{{{\left( {\frac{x}{\sigma }} \right)}^{2n - 1}}\cdot{e^{ - \frac{1}{2}\;\cdot\;{{\left( {\frac{x}{\sigma }} \right)}^2}}}}}{{\sqrt {2\pi } \;\cdot\prod\limits_{i = 1}^n {\left( {2i - 1} \right)} }}} \right)} 
\end{array}]
$$ \int \frac{e^{-\frac{x^2}{2\sigma^2}}}{\sigma \sqrt{2\pi}} ~dx = 
   \sum_{n=1}^\infty \left( \frac{\left(\frac{x^2}{\sigma^2}\right)^{2n-1} e^{-\frac{x^2}{2\sigma^2}}}{\sqrt{2\pi}\cdot \prod_{i=1}^n (2i-1)} \right) $$
</s>