Optimal. Leaf size=184 \[ \frac {d e^{2 (a+b x)^2}}{2 b^2 \pi }-\frac {2 (b c-a d) e^{(a+b x)^2} \text {Erfi}(a+b x)}{b^2 \sqrt {\pi }}-\frac {d e^{(a+b x)^2} (a+b x) \text {Erfi}(a+b x)}{b^2 \sqrt {\pi }}+\frac {d \text {Erfi}(a+b x)^2}{4 b^2}+\frac {(b c-a d) (a+b x) \text {Erfi}(a+b x)^2}{b^2}+\frac {d (a+b x)^2 \text {Erfi}(a+b x)^2}{2 b^2}+\frac {(b c-a d) \sqrt {\frac {2}{\pi }} \text {Erfi}\left (\sqrt {2} (a+b x)\right )}{b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 184, 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 = {6504, 6489,
6519, 2235, 6501, 6522, 6510, 30, 2240} \begin {gather*} \frac {(a+b x) (b c-a d) \text {Erfi}(a+b x)^2}{b^2}-\frac {2 e^{(a+b x)^2} (b c-a d) \text {Erfi}(a+b x)}{\sqrt {\pi } b^2}+\frac {\sqrt {\frac {2}{\pi }} (b c-a d) \text {Erfi}\left (\sqrt {2} (a+b x)\right )}{b^2}+\frac {d (a+b x)^2 \text {Erfi}(a+b x)^2}{2 b^2}+\frac {d \text {Erfi}(a+b x)^2}{4 b^2}-\frac {d e^{(a+b x)^2} (a+b x) \text {Erfi}(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 2235
Rule 2240
Rule 6489
Rule 6501
Rule 6504
Rule 6510
Rule 6519
Rule 6522
Rubi steps
\begin {align*} \int (c+d x) \text {erfi}(a+b x)^2 \, dx &=\frac {\text {Subst}\left (\int \left (b c \left (1-\frac {a d}{b c}\right ) \text {erfi}(x)^2+d x \text {erfi}(x)^2\right ) \, dx,x,a+b x\right )}{b^2}\\ &=\frac {d \text {Subst}\left (\int x \text {erfi}(x)^2 \, dx,x,a+b x\right )}{b^2}+\frac {(b c-a d) \text {Subst}\left (\int \text {erfi}(x)^2 \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(b c-a d) (a+b x) \text {erfi}(a+b x)^2}{b^2}+\frac {d (a+b x)^2 \text {erfi}(a+b x)^2}{2 b^2}-\frac {(2 d) \text {Subst}\left (\int e^{x^2} x^2 \text {erfi}(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 {erfi}(x) \, dx,x,a+b x\right )}{b^2 \sqrt {\pi }}\\ &=-\frac {2 (b c-a d) e^{(a+b x)^2} \text {erfi}(a+b x)}{b^2 \sqrt {\pi }}-\frac {d e^{(a+b x)^2} (a+b x) \text {erfi}(a+b x)}{b^2 \sqrt {\pi }}+\frac {(b c-a d) (a+b x) \text {erfi}(a+b x)^2}{b^2}+\frac {d (a+b x)^2 \text {erfi}(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 {erfi}(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 {erfi}(a+b x)}{b^2 \sqrt {\pi }}-\frac {d e^{(a+b x)^2} (a+b x) \text {erfi}(a+b x)}{b^2 \sqrt {\pi }}+\frac {(b c-a d) (a+b x) \text {erfi}(a+b x)^2}{b^2}+\frac {d (a+b x)^2 \text {erfi}(a+b x)^2}{2 b^2}+\frac {(b c-a d) \sqrt {\frac {2}{\pi }} \text {erfi}\left (\sqrt {2} (a+b x)\right )}{b^2}+\frac {d \text {Subst}(\int x \, dx,x,\text {erfi}(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 {erfi}(a+b x)}{b^2 \sqrt {\pi }}-\frac {d e^{(a+b x)^2} (a+b x) \text {erfi}(a+b x)}{b^2 \sqrt {\pi }}+\frac {d \text {erfi}(a+b x)^2}{4 b^2}+\frac {(b c-a d) (a+b x) \text {erfi}(a+b x)^2}{b^2}+\frac {d (a+b x)^2 \text {erfi}(a+b x)^2}{2 b^2}+\frac {(b c-a d) \sqrt {\frac {2}{\pi }} \text {erfi}\left (\sqrt {2} (a+b x)\right )}{b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.96, size = 189, normalized size = 1.03 \begin {gather*} \frac {\left (4 a b c+d-2 a^2 d\right ) \pi \text {Erfc}(-i (a+b x)) \text {Erfc}(i (a+b x))+2 \left (d e^{2 (a+b x)^2}+4 a b c \pi +d \pi -2 a^2 d \pi +2 i b c \sqrt {2 \pi }-2 i a d \sqrt {2 \pi }-2 e^{(a+b x)^2} \sqrt {\pi } (2 b c-a d+b d x) \text {Erfi}(a+b x)+b^2 \pi x (2 c+d x) \text {Erfi}(a+b x)^2+2 (b c-a d) \sqrt {2 \pi } \text {Erfi}\left (\sqrt {2} (a+b x)\right )\right )}{4 b^2 \pi } \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int \left (d x +c \right ) \erfi \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.35, size = 167, normalized size = 0.91 \begin {gather*} \frac {4 \, \sqrt {2} \sqrt {\pi } \sqrt {b^{2}} {\left (b c - a d\right )} \operatorname {erfi}\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 {erfi}\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 {erfi}\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 {erfi}^{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 [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {erfi}\left (a+b\,x\right )}^2\,\left (c+d\,x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________