Integrals
As mentioned in power law integrals, there are special case values of \(\alpha\), that are not explicity mentioned here. I will also only consider the case \(M_\textrm{min} < 1M_\odot < M_\textrm{max}\). If this is not the case, simply ignore the term from that branch.
For details of the lognormal integrals, including the substitutions, see Lognormal integrals. We will use the scipy implementation of the error function, scipy.special.erf:
\[\mathtt{erf}(z) = \frac{2}{\sqrt{\pi}} \int^{z}_{0} e^{-t^2}\mathrm{d}t.\]
Total number of stars
\[\begin{split}\begin{align*}
\int^{M_\textrm{max}}_{M_\textrm{min}} \xi(M)\mathrm{d}M
&= \int^{1M_\odot}_{M_\textrm{min}} \frac{\xi_0}{M}\exp\left(\frac{-\left(\log M - \log M_c\right)^2}{2\sigma^2}\right)\mathrm{d}M
+ \int^{M_\textrm{max}}_{1M_\odot} \xi_0\xi_\textrm{continuity}M^{\alpha} \textrm{d}M \\
&= \left[\xi_0 \sigma\ln10\sqrt{\frac{\pi}{2}}\mathtt{erf}(\mu)\right]^{\frac{\log(1M_\odot/M_c)}{\sqrt{2}\sigma}}_{\frac{\log(M_\textrm{min}/M_c)}{\sqrt{2}\sigma}}
+ \left[\xi_0\xi_\textrm{continuity}\frac{M^{\alpha+1}}{\alpha+1}\right]^{M_\textrm{max}}_{1M_\odot} \\
&= \xi_0\sigma\ln10\sqrt{\frac{\pi}{2}}\left\{\mathtt{erf}\left(\frac{\log(1M_\odot/M_c)}{\sqrt{2}\sigma}\right) - \mathtt{erf}\left(\frac{\log(M_\textrm{min}/M_c)}{\sqrt{2}\sigma}\right)\right\} \\
&\quad + \xi_0 \xi_\textrm{continuity} \frac{M_\textrm{max}^{\alpha+1} - 1M_\odot^{\alpha+1}}{\alpha + 1}.
\end{align*}\end{split}\]
Total mass of stars
\[\begin{split}\begin{align*}
\int^{M_\textrm{max}}_{M_\textrm{min}} M\xi(M)\mathrm{d}M
&= \int^{1M_\odot}_{M_\textrm{min}} \xi_0\exp\left(\frac{-\left(\log M - \log M_c\right)^2}{2\sigma^2}\right)\mathrm{d}M
+ \int^{M_\textrm{max}}_{1M_\odot} \xi_0\xi_\textrm{continuity}M^{\alpha+1} \textrm{d}M \\
&= \left[\xi_0\sigma\ln10M_c e^\frac{(\sigma\ln10)^2}{2}\sqrt{\frac{\pi}{2}}\mathtt{erf}\left(\mu - \frac{\sigma\ln10}{\sqrt{2}}\right)\right]^{\frac{\log(1M_\odot/M_c)}{\sqrt{2}\sigma}}_{\frac{\log(M_\textrm{min}/M_c)}{\sqrt{2}\sigma}} \\
&\quad + \left[\xi_0\xi_\textrm{continuity}\frac{M^{\alpha+2}}{\alpha+2}\right]^{M_\textrm{max}}_{1M_\odot} \\
&= \xi_0\sigma\ln10\sqrt{\frac{\pi}{2}}\left\{\mathtt{erf}\left(\frac{\log(1M_\odot/M_c)}{\sqrt{2}\sigma} - \frac{\sigma\ln10}{\sqrt{2}}\right) - \mathtt{erf}\left(\frac{\log(M_\textrm{min}/M_c)}{\sqrt{2}\sigma} - \frac{\sigma\ln10}{\sqrt{2}}\right)\right\} \\
&\quad + \xi_0 \xi_\textrm{continuity} \frac{M_\textrm{max}^{\alpha+2} - 1M_\odot^{\alpha+2}}{\alpha + 2}.
\end{align*}\end{split}\]