Integral of $$$x - e^{- x^{2}}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \left(x - e^{- x^{2}}\right)\, dx$$$.
Solution
Integrate term by term:
$${\color{red}{\int{\left(x - e^{- x^{2}}\right)d x}}} = {\color{red}{\left(\int{x d x} - \int{e^{- x^{2}} d x}\right)}}$$
Apply the power rule $$$\int x^{n}\, dx = \frac{x^{n + 1}}{n + 1}$$$ $$$\left(n \neq -1 \right)$$$ with $$$n=1$$$:
$$- \int{e^{- x^{2}} d x} + {\color{red}{\int{x d x}}}=- \int{e^{- x^{2}} d x} + {\color{red}{\frac{x^{1 + 1}}{1 + 1}}}=- \int{e^{- x^{2}} d x} + {\color{red}{\left(\frac{x^{2}}{2}\right)}}$$
This integral (Error Function) does not have a closed form:
$$\frac{x^{2}}{2} - {\color{red}{\int{e^{- x^{2}} d x}}} = \frac{x^{2}}{2} - {\color{red}{\left(\frac{\sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2}\right)}}$$
Therefore,
$$\int{\left(x - e^{- x^{2}}\right)d x} = \frac{x^{2}}{2} - \frac{\sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2}$$
Simplify:
$$\int{\left(x - e^{- x^{2}}\right)d x} = \frac{x^{2} - \sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2}$$
Add the constant of integration:
$$\int{\left(x - e^{- x^{2}}\right)d x} = \frac{x^{2} - \sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2}+C$$
Answer
$$$\int \left(x - e^{- x^{2}}\right)\, dx = \frac{x^{2} - \sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2} + C$$$A