Optimal. Leaf size=119 \[ -\frac {(b c-a d) e^{-(a+b x)^2}}{b^2 \sqrt {\pi }}-\frac {d e^{-(a+b x)^2} (a+b x)}{2 b^2 \sqrt {\pi }}+\frac {d \text {Erf}(a+b x)}{4 b^2}+\frac {(b c-a d)^2 \text {Erf}(a+b x)}{2 b^2 d}+\frac {(c+d x)^2 \text {Erfc}(a+b x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {6497, 2258,
2236, 2240, 2243} \begin {gather*} \frac {(b c-a d)^2 \text {Erf}(a+b x)}{2 b^2 d}-\frac {e^{-(a+b x)^2} (b c-a d)}{\sqrt {\pi } b^2}+\frac {d \text {Erf}(a+b x)}{4 b^2}-\frac {d e^{-(a+b x)^2} (a+b x)}{2 \sqrt {\pi } b^2}+\frac {(c+d x)^2 \text {Erfc}(a+b x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2236
Rule 2240
Rule 2243
Rule 2258
Rule 6497
Rubi steps
\begin {align*} \int (c+d x) \text {erfc}(a+b x) \, dx &=\frac {(c+d x)^2 \text {erfc}(a+b x)}{2 d}+\frac {b \int e^{-(a+b x)^2} (c+d x)^2 \, dx}{d \sqrt {\pi }}\\ &=\frac {(c+d x)^2 \text {erfc}(a+b x)}{2 d}+\frac {b \int \left (\frac {(b c-a d)^2 e^{-(a+b x)^2}}{b^2}+\frac {2 d (b c-a d) e^{-(a+b x)^2} (a+b x)}{b^2}+\frac {d^2 e^{-(a+b x)^2} (a+b x)^2}{b^2}\right ) \, dx}{d \sqrt {\pi }}\\ &=\frac {(c+d x)^2 \text {erfc}(a+b x)}{2 d}+\frac {d \int e^{-(a+b x)^2} (a+b x)^2 \, dx}{b \sqrt {\pi }}+\frac {(2 (b c-a d)) \int e^{-(a+b x)^2} (a+b x) \, dx}{b \sqrt {\pi }}+\frac {(b c-a d)^2 \int e^{-(a+b x)^2} \, dx}{b d \sqrt {\pi }}\\ &=-\frac {(b c-a d) e^{-(a+b x)^2}}{b^2 \sqrt {\pi }}-\frac {d e^{-(a+b x)^2} (a+b x)}{2 b^2 \sqrt {\pi }}+\frac {(b c-a d)^2 \text {erf}(a+b x)}{2 b^2 d}+\frac {(c+d x)^2 \text {erfc}(a+b x)}{2 d}+\frac {d \int e^{-(a+b x)^2} \, dx}{2 b \sqrt {\pi }}\\ &=-\frac {(b c-a d) e^{-(a+b x)^2}}{b^2 \sqrt {\pi }}-\frac {d e^{-(a+b x)^2} (a+b x)}{2 b^2 \sqrt {\pi }}+\frac {d \text {erf}(a+b x)}{4 b^2}+\frac {(b c-a d)^2 \text {erf}(a+b x)}{2 b^2 d}+\frac {(c+d x)^2 \text {erfc}(a+b x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 104, normalized size = 0.87 \begin {gather*} \frac {e^{-(a+b x)^2} \left (-4 b c+2 a d-2 b d x+\left (-4 a b c+d+2 a^2 d\right ) e^{(a+b x)^2} \sqrt {\pi } \text {Erf}(a+b x)+2 b^2 e^{(a+b x)^2} \sqrt {\pi } x (2 c+d x) \text {Erfc}(a+b x)\right )}{4 b^2 \sqrt {\pi }} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 124, normalized size = 1.04
method | result | size |
derivativedivides | \(\frac {-\frac {\mathrm {erfc}\left (b x +a \right ) d a \left (b x +a \right )}{b}+\mathrm {erfc}\left (b x +a \right ) c \left (b x +a \right )+\frac {\mathrm {erfc}\left (b x +a \right ) d \left (b x +a \right )^{2}}{2 b}-\frac {-d \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \erf \left (b x +a \right )}{4}\right )+{\mathrm e}^{-\left (b x +a \right )^{2}} b c -d a \,{\mathrm e}^{-\left (b x +a \right )^{2}}}{b \sqrt {\pi }}}{b}\) | \(124\) |
default | \(\frac {-\frac {\mathrm {erfc}\left (b x +a \right ) d a \left (b x +a \right )}{b}+\mathrm {erfc}\left (b x +a \right ) c \left (b x +a \right )+\frac {\mathrm {erfc}\left (b x +a \right ) d \left (b x +a \right )^{2}}{2 b}-\frac {-d \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \erf \left (b x +a \right )}{4}\right )+{\mathrm e}^{-\left (b x +a \right )^{2}} b c -d a \,{\mathrm e}^{-\left (b x +a \right )^{2}}}{b \sqrt {\pi }}}{b}\) | \(124\) |
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 = 110, normalized size = 0.92 \begin {gather*} \frac {2 \, \pi b^{2} d x^{2} + 4 \, \pi b^{2} c x - 2 \, \sqrt {\pi } {\left (b d x + 2 \, b c - a d\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )} - {\left (2 \, \pi b^{2} d x^{2} + 4 \, \pi b^{2} c x + \pi {\left (4 \, a b c - {\left (2 \, a^{2} + 1\right )} d\right )}\right )} \operatorname {erf}\left (b x + a\right )}{4 \, \pi b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.56, size = 178, normalized size = 1.50 \begin {gather*} \begin {cases} - \frac {a^{2} d \operatorname {erfc}{\left (a + b x \right )}}{2 b^{2}} + \frac {a c \operatorname {erfc}{\left (a + b x \right )}}{b} + \frac {a d e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{2 \sqrt {\pi } b^{2}} + c x \operatorname {erfc}{\left (a + b x \right )} + \frac {d x^{2} \operatorname {erfc}{\left (a + b x \right )}}{2} - \frac {c e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{\sqrt {\pi } b} - \frac {d x e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{2 \sqrt {\pi } b} - \frac {d \operatorname {erfc}{\left (a + b x \right )}}{4 b^{2}} & \text {for}\: b \neq 0 \\\left (c x + \frac {d x^{2}}{2}\right ) \operatorname {erfc}{\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 158, normalized size = 1.33 \begin {gather*} \frac {1}{2} \, d x^{2} - {\left (x \operatorname {erf}\left (b x + a\right ) - \frac {\frac {\sqrt {\pi } a \operatorname {erf}\left (-b {\left (x + \frac {a}{b}\right )}\right )}{b} - \frac {e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}}{b}}{\sqrt {\pi }}\right )} c - \frac {1}{4} \, {\left (2 \, x^{2} \operatorname {erf}\left (b x + a\right ) + \frac {\frac {\sqrt {\pi } {\left (2 \, a^{2} + 1\right )} \operatorname {erf}\left (-b {\left (x + \frac {a}{b}\right )}\right )}{b} + \frac {2 \, {\left (b {\left (x + \frac {a}{b}\right )} - 2 \, a\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}}{b}}{\sqrt {\pi } b}\right )} d + c x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.22, size = 119, normalized size = 1.00 \begin {gather*} c\,x\,\mathrm {erfc}\left (a+b\,x\right )-{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}\,\left (\frac {c}{b\,\sqrt {\pi }}-\frac {a\,d}{2\,b^2\,\sqrt {\pi }}\right )-\frac {\mathrm {erfc}\left (a+b\,x\right )\,\left (\frac {d\,a^2}{2}-b\,c\,a+\frac {d}{4}\right )}{b^2}+\frac {d\,x^2\,\mathrm {erfc}\left (a+b\,x\right )}{2}-\frac {d\,x\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}}{2\,b\,\sqrt {\pi }} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________