Integrand size = 14, antiderivative size = 194 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=-\frac {d^2 e^{-(a+b x)^2}}{3 b^3 \sqrt {\pi }}-\frac {(b c-a d)^2 e^{-(a+b x)^2}}{b^3 \sqrt {\pi }}-\frac {d (b c-a d) e^{-(a+b x)^2} (a+b x)}{b^3 \sqrt {\pi }}-\frac {d^2 e^{-(a+b x)^2} (a+b x)^2}{3 b^3 \sqrt {\pi }}+\frac {d (b c-a d) \text {erf}(a+b x)}{2 b^3}+\frac {(b c-a d)^3 \text {erf}(a+b x)}{3 b^3 d}+\frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {6497, 2258, 2236, 2240, 2243} \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\frac {(b c-a d)^3 \text {erf}(a+b x)}{3 b^3 d}+\frac {d (b c-a d) \text {erf}(a+b x)}{2 b^3}-\frac {e^{-(a+b x)^2} (b c-a d)^2}{\sqrt {\pi } b^3}-\frac {d e^{-(a+b x)^2} (a+b x) (b c-a d)}{\sqrt {\pi } b^3}-\frac {d^2 e^{-(a+b x)^2} (a+b x)^2}{3 \sqrt {\pi } b^3}-\frac {d^2 e^{-(a+b x)^2}}{3 \sqrt {\pi } b^3}+\frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d} \]
[In]
[Out]
Rule 2236
Rule 2240
Rule 2243
Rule 2258
Rule 6497
Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d}+\frac {(2 b) \int e^{-(a+b x)^2} (c+d x)^3 \, dx}{3 d \sqrt {\pi }} \\ & = \frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d}+\frac {(2 b) \int \left (\frac {(b c-a d)^3 e^{-(a+b x)^2}}{b^3}+\frac {3 d (b c-a d)^2 e^{-(a+b x)^2} (a+b x)}{b^3}+\frac {3 d^2 (b c-a d) e^{-(a+b x)^2} (a+b x)^2}{b^3}+\frac {d^3 e^{-(a+b x)^2} (a+b x)^3}{b^3}\right ) \, dx}{3 d \sqrt {\pi }} \\ & = \frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d}+\frac {\left (2 d^2\right ) \int e^{-(a+b x)^2} (a+b x)^3 \, dx}{3 b^2 \sqrt {\pi }}+\frac {(2 d (b c-a d)) \int e^{-(a+b x)^2} (a+b x)^2 \, dx}{b^2 \sqrt {\pi }}+\frac {\left (2 (b c-a d)^2\right ) \int e^{-(a+b x)^2} (a+b x) \, dx}{b^2 \sqrt {\pi }}+\frac {\left (2 (b c-a d)^3\right ) \int e^{-(a+b x)^2} \, dx}{3 b^2 d \sqrt {\pi }} \\ & = -\frac {(b c-a d)^2 e^{-(a+b x)^2}}{b^3 \sqrt {\pi }}-\frac {d (b c-a d) e^{-(a+b x)^2} (a+b x)}{b^3 \sqrt {\pi }}-\frac {d^2 e^{-(a+b x)^2} (a+b x)^2}{3 b^3 \sqrt {\pi }}+\frac {(b c-a d)^3 \text {erf}(a+b x)}{3 b^3 d}+\frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d}+\frac {\left (2 d^2\right ) \int e^{-(a+b x)^2} (a+b x) \, dx}{3 b^2 \sqrt {\pi }}+\frac {(d (b c-a d)) \int e^{-(a+b x)^2} \, dx}{b^2 \sqrt {\pi }} \\ & = -\frac {d^2 e^{-(a+b x)^2}}{3 b^3 \sqrt {\pi }}-\frac {(b c-a d)^2 e^{-(a+b x)^2}}{b^3 \sqrt {\pi }}-\frac {d (b c-a d) e^{-(a+b x)^2} (a+b x)}{b^3 \sqrt {\pi }}-\frac {d^2 e^{-(a+b x)^2} (a+b x)^2}{3 b^3 \sqrt {\pi }}+\frac {d (b c-a d) \text {erf}(a+b x)}{2 b^3}+\frac {(b c-a d)^3 \text {erf}(a+b x)}{3 b^3 d}+\frac {(c+d x)^3 \text {erfc}(a+b x)}{3 d} \\ \end{align*}
Time = 0.18 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.82 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\frac {-\left (\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 )\right ) \text {erf}(a+b x)\right )+\frac {2 e^{-(a+b x)^2} \left (-\left (\left (1+a^2\right ) d^2\right )+a b d (3 c+d x)-b^2 \left (3 c^2+3 c d x+d^2 x^2\right )+b^3 e^{(a+b x)^2} \sqrt {\pi } x \left (3 c^2+3 c d x+d^2 x^2\right ) \text {erfc}(a+b x)\right )}{\sqrt {\pi }}}{6 b^3} \]
[In]
[Out]
Time = 0.91 (sec) , antiderivative size = 272, normalized size of antiderivative = 1.40
method | result | size |
parallelrisch | \(\frac {2 d^{2} \operatorname {erfc}\left (b x +a \right ) x^{3} \sqrt {\pi }\, b^{3}+6 c d \,\operatorname {erfc}\left (b x +a \right ) x^{2} \sqrt {\pi }\, b^{3}+6 c^{2} x \,\operatorname {erfc}\left (b x +a \right ) \sqrt {\pi }\, b^{3}+2 \sqrt {\pi }\, \operatorname {erfc}\left (b x +a \right ) a^{3} d^{2}-6 \sqrt {\pi }\, \operatorname {erfc}\left (b x +a \right ) a^{2} b c d +6 \sqrt {\pi }\, \operatorname {erfc}\left (b x +a \right ) a \,b^{2} c^{2}-2 d^{2} x^{2} {\mathrm e}^{-\left (b x +a \right )^{2}} b^{2}+2 x \,{\mathrm e}^{-\left (b x +a \right )^{2}} a b \,d^{2}-6 x \,{\mathrm e}^{-\left (b x +a \right )^{2}} b^{2} c d +3 \sqrt {\pi }\, \operatorname {erfc}\left (b x +a \right ) a \,d^{2}-3 \sqrt {\pi }\, \operatorname {erfc}\left (b x +a \right ) b c d -2 \,{\mathrm e}^{-\left (b x +a \right )^{2}} a^{2} d^{2}+6 \,{\mathrm e}^{-\left (b x +a \right )^{2}} a b c d -6 \,{\mathrm e}^{-\left (b x +a \right )^{2}} b^{2} c^{2}-2 \,{\mathrm e}^{-\left (b x +a \right )^{2}} d^{2}}{6 \sqrt {\pi }\, b^{3}}\) | \(272\) |
parts | \(\frac {\operatorname {erfc}\left (b x +a \right ) d^{2} x^{3}}{3}+\operatorname {erfc}\left (b x +a \right ) d c \,x^{2}+\operatorname {erfc}\left (b x +a \right ) c^{2} x +\frac {\operatorname {erfc}\left (b x +a \right ) c^{3}}{3 d}+\frac {2 b \left (\frac {c^{3} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2 b}+{\mathrm e}^{-a^{2}} d^{3} \left (-\frac {x^{2} {\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \left (-\frac {x \,{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \left (-\frac {{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{2 b^{2}}\right )}{b}+\frac {\sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{4 b^{3}}\right )}{b}+\frac {-\frac {{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{2 b^{2}}}{b^{2}}\right )+3 \,{\mathrm e}^{-a^{2}} c \,d^{2} \left (-\frac {x \,{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \left (-\frac {{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{2 b^{2}}\right )}{b}+\frac {\sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{4 b^{3}}\right )+3 \,{\mathrm e}^{-a^{2}} d \,c^{2} \left (-\frac {{\mathrm e}^{-b^{2} x^{2}-2 a b x}}{2 b^{2}}-\frac {a \sqrt {\pi }\, {\mathrm e}^{a^{2}} \operatorname {erf}\left (b x +a \right )}{2 b^{2}}\right )\right )}{3 d \sqrt {\pi }}\) | \(400\) |
derivativedivides | \(\frac {-\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a^{3}}{3 b^{2}}+\frac {d \,\operatorname {erfc}\left (b x +a \right ) a^{2} c}{b}+\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a^{2} \left (b x +a \right )}{b^{2}}-\operatorname {erfc}\left (b x +a \right ) a \,c^{2}-\frac {2 d \,\operatorname {erfc}\left (b x +a \right ) a c \left (b x +a \right )}{b}-\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a \left (b x +a \right )^{2}}{b^{2}}+\frac {b \,\operatorname {erfc}\left (b x +a \right ) c^{3}}{3 d}+\operatorname {erfc}\left (b x +a \right ) c^{2} \left (b x +a \right )+\frac {d \,\operatorname {erfc}\left (b x +a \right ) c \left (b x +a \right )^{2}}{b}+\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) \left (b x +a \right )^{3}}{3 b^{2}}-\frac {2 \left (\frac {a^{3} d^{3} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-\frac {b^{3} c^{3} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-d^{3} \left (-\frac {{\mathrm e}^{-\left (b x +a \right )^{2}} \left (b x +a \right )^{2}}{2}-\frac {{\mathrm e}^{-\left (b x +a \right )^{2}}}{2}\right )+3 a \,d^{3} \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{4}\right )+\frac {3 a^{2} d^{3} {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {3 a \,b^{2} c^{2} d \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-\frac {3 a^{2} b c \,d^{2} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-3 b c \,d^{2} \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{4}\right )+\frac {3 b^{2} c^{2} d \,{\mathrm e}^{-\left (b x +a \right )^{2}}}{2}-3 a b c \,d^{2} {\mathrm e}^{-\left (b x +a \right )^{2}}\right )}{3 \sqrt {\pi }\, b^{2} d}}{b}\) | \(429\) |
default | \(\frac {-\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a^{3}}{3 b^{2}}+\frac {d \,\operatorname {erfc}\left (b x +a \right ) a^{2} c}{b}+\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a^{2} \left (b x +a \right )}{b^{2}}-\operatorname {erfc}\left (b x +a \right ) a \,c^{2}-\frac {2 d \,\operatorname {erfc}\left (b x +a \right ) a c \left (b x +a \right )}{b}-\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) a \left (b x +a \right )^{2}}{b^{2}}+\frac {b \,\operatorname {erfc}\left (b x +a \right ) c^{3}}{3 d}+\operatorname {erfc}\left (b x +a \right ) c^{2} \left (b x +a \right )+\frac {d \,\operatorname {erfc}\left (b x +a \right ) c \left (b x +a \right )^{2}}{b}+\frac {d^{2} \operatorname {erfc}\left (b x +a \right ) \left (b x +a \right )^{3}}{3 b^{2}}-\frac {2 \left (\frac {a^{3} d^{3} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-\frac {b^{3} c^{3} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-d^{3} \left (-\frac {{\mathrm e}^{-\left (b x +a \right )^{2}} \left (b x +a \right )^{2}}{2}-\frac {{\mathrm e}^{-\left (b x +a \right )^{2}}}{2}\right )+3 a \,d^{3} \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{4}\right )+\frac {3 a^{2} d^{3} {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {3 a \,b^{2} c^{2} d \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-\frac {3 a^{2} b c \,d^{2} \sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{2}-3 b c \,d^{2} \left (-\frac {\left (b x +a \right ) {\mathrm e}^{-\left (b x +a \right )^{2}}}{2}+\frac {\sqrt {\pi }\, \operatorname {erf}\left (b x +a \right )}{4}\right )+\frac {3 b^{2} c^{2} d \,{\mathrm e}^{-\left (b x +a \right )^{2}}}{2}-3 a b c \,d^{2} {\mathrm e}^{-\left (b x +a \right )^{2}}\right )}{3 \sqrt {\pi }\, b^{2} d}}{b}\) | \(429\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.02 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\frac {2 \, \pi b^{3} d^{2} x^{3} + 6 \, \pi b^{3} c d x^{2} + 6 \, \pi b^{3} c^{2} x - 2 \, \sqrt {\pi } {\left (b^{2} d^{2} x^{2} + 3 \, b^{2} c^{2} - 3 \, a b c d + {\left (a^{2} + 1\right )} d^{2} + {\left (3 \, b^{2} c d - a b d^{2}\right )} x\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )} - {\left (2 \, \pi b^{3} d^{2} x^{3} + 6 \, \pi b^{3} c d x^{2} + 6 \, \pi b^{3} c^{2} x + \pi {\left (6 \, a b^{2} c^{2} - 3 \, {\left (2 \, a^{2} + 1\right )} b c d + {\left (2 \, a^{3} + 3 \, a\right )} d^{2}\right )}\right )} \operatorname {erf}\left (b x + a\right )}{6 \, \pi b^{3}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 398 vs. \(2 (165) = 330\).
Time = 0.88 (sec) , antiderivative size = 398, normalized size of antiderivative = 2.05 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\begin {cases} \frac {a^{3} d^{2} \operatorname {erfc}{\left (a + b x \right )}}{3 b^{3}} - \frac {a^{2} c d \operatorname {erfc}{\left (a + b x \right )}}{b^{2}} - \frac {a^{2} d^{2} e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{3 \sqrt {\pi } b^{3}} + \frac {a c^{2} \operatorname {erfc}{\left (a + b x \right )}}{b} + \frac {a c d e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{\sqrt {\pi } b^{2}} + \frac {a d^{2} x e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{3 \sqrt {\pi } b^{2}} + \frac {a d^{2} \operatorname {erfc}{\left (a + b x \right )}}{2 b^{3}} + c^{2} x \operatorname {erfc}{\left (a + b x \right )} + c d x^{2} \operatorname {erfc}{\left (a + b x \right )} + \frac {d^{2} x^{3} \operatorname {erfc}{\left (a + b x \right )}}{3} - \frac {c^{2} e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{\sqrt {\pi } b} - \frac {c d x e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{\sqrt {\pi } b} - \frac {d^{2} x^{2} e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{3 \sqrt {\pi } b} - \frac {c d \operatorname {erfc}{\left (a + b x \right )}}{2 b^{2}} - \frac {d^{2} e^{- a^{2}} e^{- b^{2} x^{2}} e^{- 2 a b x}}{3 \sqrt {\pi } b^{3}} & \text {for}\: b \neq 0 \\\left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) \operatorname {erfc}{\left (a \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
\[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \operatorname {erfc}\left (b x + a\right ) \,d x } \]
[In]
[Out]
none
Time = 0.39 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.44 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\frac {1}{3} \, d^{2} x^{3} + c 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^{2} - \frac {1}{2} \, {\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 )} c d - \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {erf}\left (b x + a\right ) - \frac {\frac {\sqrt {\pi } {\left (2 \, a^{3} + 3 \, a\right )} \operatorname {erf}\left (-b {\left (x + \frac {a}{b}\right )}\right )}{b} - \frac {2 \, {\left (b^{2} {\left (x + \frac {a}{b}\right )}^{2} - 3 \, a b {\left (x + \frac {a}{b}\right )} + 3 \, a^{2} + 1\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}}{b}}{\sqrt {\pi } b^{2}}\right )} d^{2} + c^{2} x \]
[In]
[Out]
Time = 4.97 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.13 \[ \int (c+d x)^2 \text {erfc}(a+b x) \, dx=\frac {d^2\,x^3\,\mathrm {erfc}\left (a+b\,x\right )}{3}-\frac {{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}\,\left (\frac {b^2\,c^2}{\sqrt {\pi }}-\frac {a\,d\,b\,c}{\sqrt {\pi }}+\frac {a^2\,d^2+d^2}{3\,\sqrt {\pi }}\right )}{b^3}+\frac {\mathrm {erfc}\left (a+b\,x\right )\,\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 {erfc}\left (a+b\,x\right )+c\,d\,x^2\,\mathrm {erfc}\left (a+b\,x\right )+\frac {x\,{\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 }}-\frac {d^2\,x^2\,{\mathrm {e}}^{-a^2-2\,a\,b\,x-b^2\,x^2}}{3\,b\,\sqrt {\pi }} \]
[In]
[Out]