Optimal. Leaf size=188 \[ \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} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 188, normalized size of antiderivative = 1.00, 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 = {6502, 6487,
6517, 2236, 6499, 6520, 6508, 30, 2240} \begin {gather*} \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} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2236
Rule 2240
Rule 6487
Rule 6499
Rule 6502
Rule 6508
Rule 6517
Rule 6520
Rubi steps
\begin {align*} \int (c+d x) \text {erf}(a+b x)^2 \, dx &=\frac {\text {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 \text {Subst}\left (\int x \text {erf}(x)^2 \, dx,x,a+b x\right )}{b^2}+\frac {(b c-a d) \text {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) \text {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)) \text {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) \text {Subst}\left (\int e^{-2 x^2} x \, dx,x,a+b x\right )}{b^2 \pi }-\frac {(4 (b c-a d)) \text {Subst}\left (\int e^{-2 x^2} \, dx,x,a+b x\right )}{b^2 \pi }-\frac {d \text {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 \text {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.28, size = 132, normalized size = 0.70 \begin {gather*} \frac {2 d e^{-2 (a+b x)^2}+4 e^{-(a+b x)^2} \sqrt {\pi } (2 b c-a d+b d x) \text {Erf}(a+b x)+\pi \left (4 a b c-d-2 a^2 d+4 b^2 c x+2 b^2 d x^2\right ) \text {Erf}(a+b x)^2+4 (-b c+a d) \sqrt {2 \pi } \text {Erf}\left (\sqrt {2} (a+b x)\right )}{4 b^2 \pi } \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \left (d x +c \right ) \erf \left (b x +a \right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 171, normalized size = 0.91 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right ) \operatorname {erf}^{2}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.26, size = 186, normalized size = 0.99 \begin {gather*} \frac {d\,x^2\,{\mathrm {erf}\left (a+b\,x\right )}^2}{2}-\frac {{\mathrm {erf}\left (a+b\,x\right )}^2\,\left (2\,d\,a^2-4\,b\,c\,a+d\right )}{4\,b^2}+c\,x\,{\mathrm {erf}\left (a+b\,x\right )}^2+\frac {d\,{\mathrm {e}}^{-2\,a^2-4\,a\,b\,x-2\,b^2\,x^2}}{2\,b^2\,\pi }-\frac {\mathrm {erf}\left (a+b\,x\right )\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}\,\left (a\,d-2\,b\,c\right )}{b^2\,\sqrt {\pi }}+\frac {\sqrt {2}\,\mathrm {erf}\left (\sqrt {2}\,\left (a+b\,x\right )\right )\,\left (a\,d-b\,c\right )}{b^2\,\sqrt {\pi }}+\frac {d\,x\,\mathrm {erf}\left (a+b\,x\right )\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}}{b\,\sqrt {\pi }} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________