Optimal. Leaf size=188 \[ \frac{(a+b x) (b c-a d) \text{Erf}(a+b x)^2}{b^2}+\frac{2 e^{-(a+b x)^2} (b c-a d) \text{Erf}(a+b x)}{\sqrt{\pi } b^2}-\frac{\sqrt{\frac{2}{\pi }} (b c-a d) \text{Erf}\left (\sqrt{2} (a+b x)\right )}{b^2}+\frac{d (a+b x)^2 \text{Erf}(a+b x)^2}{2 b^2}-\frac{d \text{Erf}(a+b x)^2}{4 b^2}+\frac{d e^{-(a+b x)^2} (a+b x) \text{Erf}(a+b x)}{\sqrt{\pi } b^2}+\frac{d e^{-2 (a+b x)^2}}{2 \pi b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.1757, antiderivative size = 188, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 9, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.643, Rules used = {6367, 6352, 6382, 2205, 6364, 6385, 6373, 30, 2209} \[ \frac{(a+b x) (b c-a d) \text{Erf}(a+b x)^2}{b^2}+\frac{2 e^{-(a+b x)^2} (b c-a d) \text{Erf}(a+b x)}{\sqrt{\pi } b^2}-\frac{\sqrt{\frac{2}{\pi }} (b c-a d) \text{Erf}\left (\sqrt{2} (a+b x)\right )}{b^2}+\frac{d (a+b x)^2 \text{Erf}(a+b x)^2}{2 b^2}-\frac{d \text{Erf}(a+b x)^2}{4 b^2}+\frac{d e^{-(a+b x)^2} (a+b x) \text{Erf}(a+b x)}{\sqrt{\pi } b^2}+\frac{d e^{-2 (a+b x)^2}}{2 \pi b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6367
Rule 6352
Rule 6382
Rule 2205
Rule 6364
Rule 6385
Rule 6373
Rule 30
Rule 2209
Rubi steps
\begin{align*} \int (c+d x) \text{erf}(a+b x)^2 \, dx &=\frac{\operatorname{Subst}\left (\int \left (b c \left (1-\frac{a d}{b c}\right ) \text{erf}(x)^2+d x \text{erf}(x)^2\right ) \, dx,x,a+b x\right )}{b^2}\\ &=\frac{d \operatorname{Subst}\left (\int x \text{erf}(x)^2 \, dx,x,a+b x\right )}{b^2}+\frac{(b c-a d) \operatorname{Subst}\left (\int \text{erf}(x)^2 \, dx,x,a+b x\right )}{b^2}\\ &=\frac{(b c-a d) (a+b x) \text{erf}(a+b x)^2}{b^2}+\frac{d (a+b x)^2 \text{erf}(a+b x)^2}{2 b^2}-\frac{(2 d) \operatorname{Subst}\left (\int e^{-x^2} x^2 \text{erf}(x) \, dx,x,a+b x\right )}{b^2 \sqrt{\pi }}-\frac{(4 (b c-a d)) \operatorname{Subst}\left (\int e^{-x^2} x \text{erf}(x) \, dx,x,a+b x\right )}{b^2 \sqrt{\pi }}\\ &=\frac{2 (b c-a d) e^{-(a+b x)^2} \text{erf}(a+b x)}{b^2 \sqrt{\pi }}+\frac{d e^{-(a+b x)^2} (a+b x) \text{erf}(a+b x)}{b^2 \sqrt{\pi }}+\frac{(b c-a d) (a+b x) \text{erf}(a+b x)^2}{b^2}+\frac{d (a+b x)^2 \text{erf}(a+b x)^2}{2 b^2}-\frac{(2 d) \operatorname{Subst}\left (\int e^{-2 x^2} x \, dx,x,a+b x\right )}{b^2 \pi }-\frac{(4 (b c-a d)) \operatorname{Subst}\left (\int e^{-2 x^2} \, dx,x,a+b x\right )}{b^2 \pi }-\frac{d \operatorname{Subst}\left (\int e^{-x^2} \text{erf}(x) \, dx,x,a+b x\right )}{b^2 \sqrt{\pi }}\\ &=\frac{d e^{-2 (a+b x)^2}}{2 b^2 \pi }+\frac{2 (b c-a d) e^{-(a+b x)^2} \text{erf}(a+b x)}{b^2 \sqrt{\pi }}+\frac{d e^{-(a+b x)^2} (a+b x) \text{erf}(a+b x)}{b^2 \sqrt{\pi }}+\frac{(b c-a d) (a+b x) \text{erf}(a+b x)^2}{b^2}+\frac{d (a+b x)^2 \text{erf}(a+b x)^2}{2 b^2}-\frac{(b c-a d) \sqrt{\frac{2}{\pi }} \text{erf}\left (\sqrt{2} (a+b x)\right )}{b^2}-\frac{d \operatorname{Subst}(\int x \, dx,x,\text{erf}(a+b x))}{2 b^2}\\ &=\frac{d e^{-2 (a+b x)^2}}{2 b^2 \pi }+\frac{2 (b c-a d) e^{-(a+b x)^2} \text{erf}(a+b x)}{b^2 \sqrt{\pi }}+\frac{d e^{-(a+b x)^2} (a+b x) \text{erf}(a+b x)}{b^2 \sqrt{\pi }}-\frac{d \text{erf}(a+b x)^2}{4 b^2}+\frac{(b c-a d) (a+b x) \text{erf}(a+b x)^2}{b^2}+\frac{d (a+b x)^2 \text{erf}(a+b x)^2}{2 b^2}-\frac{(b c-a d) \sqrt{\frac{2}{\pi }} \text{erf}\left (\sqrt{2} (a+b x)\right )}{b^2}\\ \end{align*}
Mathematica [A] time = 0.398058, size = 132, normalized size = 0.7 \[ \frac{\pi \text{Erf}(a+b x)^2 \left (-2 a^2 d+4 a b c+4 b^2 c x+2 b^2 d x^2-d\right )+4 \sqrt{\pi } e^{-(a+b x)^2} \text{Erf}(a+b x) (-a d+2 b c+b d x)+4 \sqrt{2 \pi } (a d-b c) \text{Erf}\left (\sqrt{2} (a+b x)\right )+2 d e^{-2 (a+b x)^2}}{4 \pi b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.053, size = 0, normalized size = 0. \begin{align*} \int \left ( dx+c \right ) \left ({\it Erf} \left ( bx+a \right ) \right ) ^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{2} \,{\left (d x^{2} + 2 \, c x\right )} \operatorname{erf}\left (b x + a\right )^{2} - \frac{2 \, \int{\left (b d x^{2} + 2 \, b c x\right )} \operatorname{erf}\left (b x + a\right ) e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}\,{d x}}{\sqrt{\pi }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.57145, size = 406, normalized size = 2.16 \begin{align*} -\frac{4 \, \sqrt{2} \sqrt{\pi } \sqrt{b^{2}}{\left (b c - a d\right )} \operatorname{erf}\left (\frac{\sqrt{2} \sqrt{b^{2}}{\left (b x + a\right )}}{b}\right ) - 4 \, \sqrt{\pi }{\left (b^{2} d x + 2 \, b^{2} c - a b d\right )} \operatorname{erf}\left (b x + a\right ) e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )} -{\left (2 \, \pi b^{3} d x^{2} + 4 \, \pi b^{3} c x + \pi{\left (4 \, a b^{2} c -{\left (2 \, a^{2} + 1\right )} b d\right )}\right )} \operatorname{erf}\left (b x + a\right )^{2} - 2 \, b d e^{\left (-2 \, b^{2} x^{2} - 4 \, a b x - 2 \, a^{2}\right )}}{4 \, \pi b^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (c + d x\right ) \operatorname{erf}^{2}{\left (a + b x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (d x + c\right )} \operatorname{erf}\left (b x + a\right )^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]