Optimal. Leaf size=375 \[ \frac {d (b c-a d) e^{-2 (a+b x)^2}}{b^3 \pi }+\frac {d^2 e^{-2 (a+b x)^2} (a+b x)}{3 b^3 \pi }+\frac {2 d^2 e^{-(a+b x)^2} \text {Erf}(a+b x)}{3 b^3 \sqrt {\pi }}+\frac {2 (b c-a d)^2 e^{-(a+b x)^2} \text {Erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d (b c-a d) e^{-(a+b x)^2} (a+b x) \text {Erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d^2 e^{-(a+b x)^2} (a+b x)^2 \text {Erf}(a+b x)}{3 b^3 \sqrt {\pi }}-\frac {d (b c-a d) \text {Erf}(a+b x)^2}{2 b^3}+\frac {(b c-a d)^2 (a+b x) \text {Erf}(a+b x)^2}{b^3}+\frac {d (b c-a d) (a+b x)^2 \text {Erf}(a+b x)^2}{b^3}+\frac {d^2 (a+b x)^3 \text {Erf}(a+b x)^2}{3 b^3}-\frac {(b c-a d)^2 \sqrt {\frac {2}{\pi }} \text {Erf}\left (\sqrt {2} (a+b x)\right )}{b^3}-\frac {5 d^2 \text {Erf}\left (\sqrt {2} (a+b x)\right )}{6 b^3 \sqrt {2 \pi }} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 375, normalized size of antiderivative = 1.00, number of steps
used = 16, number of rules used = 10, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.625, Rules used = {6502, 6487,
6517, 2236, 6499, 6520, 6508, 30, 2240, 2243} \begin {gather*} \frac {d (a+b x)^2 (b c-a d) \text {Erf}(a+b x)^2}{b^3}+\frac {(a+b x) (b c-a d)^2 \text {Erf}(a+b x)^2}{b^3}+\frac {2 d e^{-(a+b x)^2} (a+b x) (b c-a d) \text {Erf}(a+b x)}{\sqrt {\pi } b^3}-\frac {d (b c-a d) \text {Erf}(a+b x)^2}{2 b^3}+\frac {2 e^{-(a+b x)^2} (b c-a d)^2 \text {Erf}(a+b x)}{\sqrt {\pi } b^3}-\frac {\sqrt {\frac {2}{\pi }} (b c-a d)^2 \text {Erf}\left (\sqrt {2} (a+b x)\right )}{b^3}+\frac {d e^{-2 (a+b x)^2} (b c-a d)}{\pi b^3}+\frac {d^2 (a+b x)^3 \text {Erf}(a+b x)^2}{3 b^3}+\frac {2 d^2 e^{-(a+b x)^2} (a+b x)^2 \text {Erf}(a+b x)}{3 \sqrt {\pi } b^3}+\frac {2 d^2 e^{-(a+b x)^2} \text {Erf}(a+b x)}{3 \sqrt {\pi } b^3}-\frac {5 d^2 \text {Erf}\left (\sqrt {2} (a+b x)\right )}{6 \sqrt {2 \pi } b^3}+\frac {d^2 e^{-2 (a+b x)^2} (a+b x)}{3 \pi b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2236
Rule 2240
Rule 2243
Rule 6487
Rule 6499
Rule 6502
Rule 6508
Rule 6517
Rule 6520
Rubi steps
\begin {align*} \int (c+d x)^2 \text {erf}(a+b x)^2 \, dx &=\frac {\text {Subst}\left (\int \left (b^2 c^2 \left (1+\frac {a d (-2 b c+a d)}{b^2 c^2}\right ) \text {erf}(x)^2+2 b c d \left (1-\frac {a d}{b c}\right ) x \text {erf}(x)^2+d^2 x^2 \text {erf}(x)^2\right ) \, dx,x,a+b x\right )}{b^3}\\ &=\frac {d^2 \text {Subst}\left (\int x^2 \text {erf}(x)^2 \, dx,x,a+b x\right )}{b^3}+\frac {(2 d (b c-a d)) \text {Subst}\left (\int x \text {erf}(x)^2 \, dx,x,a+b x\right )}{b^3}+\frac {(b c-a d)^2 \text {Subst}\left (\int \text {erf}(x)^2 \, dx,x,a+b x\right )}{b^3}\\ &=\frac {(b c-a d)^2 (a+b x) \text {erf}(a+b x)^2}{b^3}+\frac {d (b c-a d) (a+b x)^2 \text {erf}(a+b x)^2}{b^3}+\frac {d^2 (a+b x)^3 \text {erf}(a+b x)^2}{3 b^3}-\frac {\left (4 d^2\right ) \text {Subst}\left (\int e^{-x^2} x^3 \text {erf}(x) \, dx,x,a+b x\right )}{3 b^3 \sqrt {\pi }}-\frac {(4 d (b c-a d)) \text {Subst}\left (\int e^{-x^2} x^2 \text {erf}(x) \, dx,x,a+b x\right )}{b^3 \sqrt {\pi }}-\frac {\left (4 (b c-a d)^2\right ) \text {Subst}\left (\int e^{-x^2} x \text {erf}(x) \, dx,x,a+b x\right )}{b^3 \sqrt {\pi }}\\ &=\frac {2 (b c-a d)^2 e^{-(a+b x)^2} \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d (b c-a d) e^{-(a+b x)^2} (a+b x) \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d^2 e^{-(a+b x)^2} (a+b x)^2 \text {erf}(a+b x)}{3 b^3 \sqrt {\pi }}+\frac {(b c-a d)^2 (a+b x) \text {erf}(a+b x)^2}{b^3}+\frac {d (b c-a d) (a+b x)^2 \text {erf}(a+b x)^2}{b^3}+\frac {d^2 (a+b x)^3 \text {erf}(a+b x)^2}{3 b^3}-\frac {\left (4 d^2\right ) \text {Subst}\left (\int e^{-2 x^2} x^2 \, dx,x,a+b x\right )}{3 b^3 \pi }-\frac {(4 d (b c-a d)) \text {Subst}\left (\int e^{-2 x^2} x \, dx,x,a+b x\right )}{b^3 \pi }-\frac {\left (4 (b c-a d)^2\right ) \text {Subst}\left (\int e^{-2 x^2} \, dx,x,a+b x\right )}{b^3 \pi }-\frac {\left (4 d^2\right ) \text {Subst}\left (\int e^{-x^2} x \text {erf}(x) \, dx,x,a+b x\right )}{3 b^3 \sqrt {\pi }}-\frac {(2 d (b c-a d)) \text {Subst}\left (\int e^{-x^2} \text {erf}(x) \, dx,x,a+b x\right )}{b^3 \sqrt {\pi }}\\ &=\frac {d (b c-a d) e^{-2 (a+b x)^2}}{b^3 \pi }+\frac {d^2 e^{-2 (a+b x)^2} (a+b x)}{3 b^3 \pi }+\frac {2 d^2 e^{-(a+b x)^2} \text {erf}(a+b x)}{3 b^3 \sqrt {\pi }}+\frac {2 (b c-a d)^2 e^{-(a+b x)^2} \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d (b c-a d) e^{-(a+b x)^2} (a+b x) \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d^2 e^{-(a+b x)^2} (a+b x)^2 \text {erf}(a+b x)}{3 b^3 \sqrt {\pi }}+\frac {(b c-a d)^2 (a+b x) \text {erf}(a+b x)^2}{b^3}+\frac {d (b c-a d) (a+b x)^2 \text {erf}(a+b x)^2}{b^3}+\frac {d^2 (a+b x)^3 \text {erf}(a+b x)^2}{3 b^3}-\frac {(b c-a d)^2 \sqrt {\frac {2}{\pi }} \text {erf}\left (\sqrt {2} (a+b x)\right )}{b^3}-\frac {(d (b c-a d)) \text {Subst}(\int x \, dx,x,\text {erf}(a+b x))}{b^3}-\frac {d^2 \text {Subst}\left (\int e^{-2 x^2} \, dx,x,a+b x\right )}{3 b^3 \pi }-\frac {\left (4 d^2\right ) \text {Subst}\left (\int e^{-2 x^2} \, dx,x,a+b x\right )}{3 b^3 \pi }\\ &=\frac {d (b c-a d) e^{-2 (a+b x)^2}}{b^3 \pi }+\frac {d^2 e^{-2 (a+b x)^2} (a+b x)}{3 b^3 \pi }+\frac {2 d^2 e^{-(a+b x)^2} \text {erf}(a+b x)}{3 b^3 \sqrt {\pi }}+\frac {2 (b c-a d)^2 e^{-(a+b x)^2} \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d (b c-a d) e^{-(a+b x)^2} (a+b x) \text {erf}(a+b x)}{b^3 \sqrt {\pi }}+\frac {2 d^2 e^{-(a+b x)^2} (a+b x)^2 \text {erf}(a+b x)}{3 b^3 \sqrt {\pi }}-\frac {d (b c-a d) \text {erf}(a+b x)^2}{2 b^3}+\frac {(b c-a d)^2 (a+b x) \text {erf}(a+b x)^2}{b^3}+\frac {d (b c-a d) (a+b x)^2 \text {erf}(a+b x)^2}{b^3}+\frac {d^2 (a+b x)^3 \text {erf}(a+b x)^2}{3 b^3}-\frac {d^2 \sqrt {\frac {2}{\pi }} \text {erf}\left (\sqrt {2} (a+b x)\right )}{3 b^3}-\frac {(b c-a d)^2 \sqrt {\frac {2}{\pi }} \text {erf}\left (\sqrt {2} (a+b x)\right )}{b^3}-\frac {d^2 \text {erf}\left (\sqrt {2} (a+b x)\right )}{6 b^3 \sqrt {2 \pi }}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.70, size = 226, normalized size = 0.60 \begin {gather*} \frac {\frac {4 d e^{-2 (a+b x)^2} (3 b c-2 a d+b d x)}{\pi }+\frac {8 e^{-(a+b x)^2} \left (\left (1+a^2\right ) d^2-a b d (3 c+d x)+b^2 \left (3 c^2+3 c d x+d^2 x^2\right )\right ) \text {Erf}(a+b x)}{\sqrt {\pi }}+2 \left (-3 b c d-6 a^2 b c d+2 a^3 d^2+3 a \left (2 b^2 c^2+d^2\right )+2 b^3 x \left (3 c^2+3 c d x+d^2 x^2\right )\right ) \text {Erf}(a+b x)^2-\left (12 b^2 c^2-24 a b c d+\left (5+12 a^2\right ) d^2\right ) \sqrt {\frac {2}{\pi }} \text {Erf}\left (\sqrt {2} (a+b x)\right )}{12 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.15, size = 0, normalized size = 0.00 \[\int \left (d x +c \right )^{2} \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.38, size = 281, normalized size = 0.75 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } {\left (12 \, b^{2} c^{2} - 24 \, a b c d + {\left (12 \, a^{2} + 5\right )} d^{2}\right )} \sqrt {b^{2}} \operatorname {erf}\left (\frac {\sqrt {2} \sqrt {b^{2}} {\left (b x + a\right )}}{b}\right ) - 8 \, \sqrt {\pi } {\left (b^{3} d^{2} x^{2} + 3 \, b^{3} c^{2} - 3 \, a b^{2} c d + {\left (a^{2} + 1\right )} b d^{2} + {\left (3 \, b^{3} c d - a b^{2} d^{2}\right )} x\right )} \operatorname {erf}\left (b x + a\right ) e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )} - 2 \, {\left (2 \, \pi b^{4} d^{2} x^{3} + 6 \, \pi b^{4} c d x^{2} + 6 \, \pi b^{4} c^{2} x + \pi {\left (6 \, a b^{3} c^{2} - 3 \, {\left (2 \, a^{2} + 1\right )} b^{2} c d + {\left (2 \, a^{3} + 3 \, a\right )} b d^{2}\right )}\right )} \operatorname {erf}\left (b x + a\right )^{2} - 4 \, {\left (b^{2} d^{2} x + 3 \, b^{2} c d - 2 \, a b d^{2}\right )} e^{\left (-2 \, b^{2} x^{2} - 4 \, a b x - 2 \, a^{2}\right )}}{12 \, \pi b^{4}} \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 )^{2} \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.44, size = 359, normalized size = 0.96 \begin {gather*} \frac {{\mathrm {erf}\left (a+b\,x\right )}^2\,\left (\frac {a\,d^2}{2}-b\,\left (c\,d\,a^2+\frac {c\,d}{2}\right )+\frac {a^3\,d^2}{3}+a\,b^2\,c^2\right )}{b^3}+c^2\,x\,{\mathrm {erf}\left (a+b\,x\right )}^2+\frac {d^2\,x^3\,{\mathrm {erf}\left (a+b\,x\right )}^2}{3}-\frac {{\mathrm {e}}^{-2\,a^2-4\,a\,b\,x-2\,b^2\,x^2}\,\left (2\,a\,d^2-3\,b\,c\,d\right )}{3\,b^3\,\pi }+c\,d\,x^2\,{\mathrm {erf}\left (a+b\,x\right )}^2+\frac {2\,\mathrm {erf}\left (a+b\,x\right )\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}\,\left (a^2\,d^2-3\,a\,b\,c\,d+3\,b^2\,c^2+d^2\right )}{3\,b^3\,\sqrt {\pi }}-\frac {\sqrt {2}\,\mathrm {erf}\left (\sqrt {2}\,\left (a+b\,x\right )\right )\,\left (12\,a^2\,d^2-24\,a\,b\,c\,d+12\,b^2\,c^2+5\,d^2\right )}{12\,b^3\,\sqrt {\pi }}+\frac {d^2\,x\,{\mathrm {e}}^{-2\,a^2-4\,a\,b\,x-2\,b^2\,x^2}}{3\,b^2\,\pi }+\frac {2\,d^2\,x^2\,\mathrm {erf}\left (a+b\,x\right )\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}}{3\,b\,\sqrt {\pi }}-\frac {2\,x\,\mathrm {erf}\left (a+b\,x\right )\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}\,\left (a\,d^2-3\,b\,c\,d\right )}{3\,b^2\,\sqrt {\pi }} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________