\(\int x^3 \text {erfc}(b x)^2 \, dx\) [126]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 126 \[ \int x^3 \text {erfc}(b x)^2 \, dx=\frac {e^{-2 b^2 x^2}}{2 b^4 \pi }+\frac {e^{-2 b^2 x^2} x^2}{4 b^2 \pi }-\frac {3 e^{-b^2 x^2} x \text {erfc}(b x)}{4 b^3 \sqrt {\pi }}-\frac {e^{-b^2 x^2} x^3 \text {erfc}(b x)}{2 b \sqrt {\pi }}-\frac {3 \text {erfc}(b x)^2}{16 b^4}+\frac {1}{4} x^4 \text {erfc}(b x)^2 \]

[Out]

1/2/b^4/exp(2*b^2*x^2)/Pi+1/4*x^2/b^2/exp(2*b^2*x^2)/Pi-3/16*erfc(b*x)^2/b^4+1/4*x^4*erfc(b*x)^2-3/4*x*erfc(b*
x)/b^3/exp(b^2*x^2)/Pi^(1/2)-1/2*x^3*erfc(b*x)/b/exp(b^2*x^2)/Pi^(1/2)

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {6500, 6521, 6509, 30, 2240, 2243} \[ \int x^3 \text {erfc}(b x)^2 \, dx=-\frac {3 \text {erfc}(b x)^2}{16 b^4}-\frac {x^3 e^{-b^2 x^2} \text {erfc}(b x)}{2 \sqrt {\pi } b}+\frac {x^2 e^{-2 b^2 x^2}}{4 \pi b^2}+\frac {e^{-2 b^2 x^2}}{2 \pi b^4}-\frac {3 x e^{-b^2 x^2} \text {erfc}(b x)}{4 \sqrt {\pi } b^3}+\frac {1}{4} x^4 \text {erfc}(b x)^2 \]

[In]

Int[x^3*Erfc[b*x]^2,x]

[Out]

1/(2*b^4*E^(2*b^2*x^2)*Pi) + x^2/(4*b^2*E^(2*b^2*x^2)*Pi) - (3*x*Erfc[b*x])/(4*b^3*E^(b^2*x^2)*Sqrt[Pi]) - (x^
3*Erfc[b*x])/(2*b*E^(b^2*x^2)*Sqrt[Pi]) - (3*Erfc[b*x]^2)/(16*b^4) + (x^4*Erfc[b*x]^2)/4

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 2243

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^(m
- n + 1)*(F^(a + b*(c + d*x)^n)/(b*d*n*Log[F])), x] - Dist[(m - n + 1)/(b*n*Log[F]), Int[(c + d*x)^(m - n)*F^(
a + b*(c + d*x)^n), x], x] /; FreeQ[{F, a, b, c, d}, x] && IntegerQ[2*((m + 1)/n)] && LtQ[0, (m + 1)/n, 5] &&
IntegerQ[n] && (LtQ[0, n, m + 1] || LtQ[m, n, 0])

Rule 6500

Int[Erfc[(b_.)*(x_)]^2*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*(Erfc[b*x]^2/(m + 1)), x] + Dist[4*(b/(Sqrt[Pi]
*(m + 1))), Int[(x^(m + 1)*Erfc[b*x])/E^(b^2*x^2), x], x] /; FreeQ[b, x] && (IGtQ[m, 0] || ILtQ[(m + 1)/2, 0])

Rule 6509

Int[E^((c_.) + (d_.)*(x_)^2)*Erfc[(b_.)*(x_)]^(n_.), x_Symbol] :> Dist[(-E^c)*(Sqrt[Pi]/(2*b)), Subst[Int[x^n,
 x], x, Erfc[b*x]], x] /; FreeQ[{b, c, d, n}, x] && EqQ[d, -b^2]

Rule 6521

Int[E^((c_.) + (d_.)*(x_)^2)*Erfc[(a_.) + (b_.)*(x_)]*(x_)^(m_), x_Symbol] :> Simp[x^(m - 1)*E^(c + d*x^2)*(Er
fc[a + b*x]/(2*d)), x] + (-Dist[(m - 1)/(2*d), Int[x^(m - 2)*E^(c + d*x^2)*Erfc[a + b*x], x], x] + Dist[b/(d*S
qrt[Pi]), Int[x^(m - 1)*E^(-a^2 + c - 2*a*b*x - (b^2 - d)*x^2), x], x]) /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 1
]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} x^4 \text {erfc}(b x)^2+\frac {b \int e^{-b^2 x^2} x^4 \text {erfc}(b x) \, dx}{\sqrt {\pi }} \\ & = -\frac {e^{-b^2 x^2} x^3 \text {erfc}(b x)}{2 b \sqrt {\pi }}+\frac {1}{4} x^4 \text {erfc}(b x)^2-\frac {\int e^{-2 b^2 x^2} x^3 \, dx}{\pi }+\frac {3 \int e^{-b^2 x^2} x^2 \text {erfc}(b x) \, dx}{2 b \sqrt {\pi }} \\ & = \frac {e^{-2 b^2 x^2} x^2}{4 b^2 \pi }-\frac {3 e^{-b^2 x^2} x \text {erfc}(b x)}{4 b^3 \sqrt {\pi }}-\frac {e^{-b^2 x^2} x^3 \text {erfc}(b x)}{2 b \sqrt {\pi }}+\frac {1}{4} x^4 \text {erfc}(b x)^2-\frac {\int e^{-2 b^2 x^2} x \, dx}{2 b^2 \pi }-\frac {3 \int e^{-2 b^2 x^2} x \, dx}{2 b^2 \pi }+\frac {3 \int e^{-b^2 x^2} \text {erfc}(b x) \, dx}{4 b^3 \sqrt {\pi }} \\ & = \frac {e^{-2 b^2 x^2}}{2 b^4 \pi }+\frac {e^{-2 b^2 x^2} x^2}{4 b^2 \pi }-\frac {3 e^{-b^2 x^2} x \text {erfc}(b x)}{4 b^3 \sqrt {\pi }}-\frac {e^{-b^2 x^2} x^3 \text {erfc}(b x)}{2 b \sqrt {\pi }}+\frac {1}{4} x^4 \text {erfc}(b x)^2-\frac {3 \text {Subst}(\int x \, dx,x,\text {erfc}(b x))}{8 b^4} \\ & = \frac {e^{-2 b^2 x^2}}{2 b^4 \pi }+\frac {e^{-2 b^2 x^2} x^2}{4 b^2 \pi }-\frac {3 e^{-b^2 x^2} x \text {erfc}(b x)}{4 b^3 \sqrt {\pi }}-\frac {e^{-b^2 x^2} x^3 \text {erfc}(b x)}{2 b \sqrt {\pi }}-\frac {3 \text {erfc}(b x)^2}{16 b^4}+\frac {1}{4} x^4 \text {erfc}(b x)^2 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.14 \[ \int x^3 \text {erfc}(b x)^2 \, dx=\frac {1}{8} \left (2 x^4-4 x^4 \text {erf}(b x)+2 x^4 \text {erf}(b x)^2+\frac {e^{-2 b^2 x^2} \left (8+4 b^2 x^2+4 b e^{b^2 x^2} \sqrt {\pi } x \left (3+2 b^2 x^2\right ) \text {erf}(b x)-3 e^{2 b^2 x^2} \pi \text {erf}(b x)^2\right )}{2 b^4 \pi }-\frac {4 x \Gamma \left (\frac {5}{2},b^2 x^2\right )}{b^3 \sqrt {\pi } \sqrt {b^2 x^2}}\right ) \]

[In]

Integrate[x^3*Erfc[b*x]^2,x]

[Out]

(2*x^4 - 4*x^4*Erf[b*x] + 2*x^4*Erf[b*x]^2 + (8 + 4*b^2*x^2 + 4*b*E^(b^2*x^2)*Sqrt[Pi]*x*(3 + 2*b^2*x^2)*Erf[b
*x] - 3*E^(2*b^2*x^2)*Pi*Erf[b*x]^2)/(2*b^4*E^(2*b^2*x^2)*Pi) - (4*x*Gamma[5/2, b^2*x^2])/(b^3*Sqrt[Pi]*Sqrt[b
^2*x^2]))/8

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.92

method result size
parallelrisch \(\frac {4 \operatorname {erfc}\left (b x \right )^{2} x^{4} \pi ^{\frac {3}{2}} b^{4}-8 \,{\mathrm e}^{-b^{2} x^{2}} \operatorname {erfc}\left (b x \right ) x^{3} b^{3} \pi +4 x^{2} {\mathrm e}^{-2 b^{2} x^{2}} b^{2} \sqrt {\pi }-12 \,{\mathrm e}^{-b^{2} x^{2}} x \,\operatorname {erfc}\left (b x \right ) b \pi -3 \operatorname {erfc}\left (b x \right )^{2} \pi ^{\frac {3}{2}}+8 \,{\mathrm e}^{-2 b^{2} x^{2}} \sqrt {\pi }}{16 \pi ^{\frac {3}{2}} b^{4}}\) \(116\)

[In]

int(x^3*erfc(b*x)^2,x,method=_RETURNVERBOSE)

[Out]

1/16*(4*erfc(b*x)^2*x^4*Pi^(3/2)*b^4-8*exp(-b^2*x^2)*erfc(b*x)*x^3*b^3*Pi+4*x^2*exp(-b^2*x^2)^2*b^2*Pi^(1/2)-1
2*exp(-b^2*x^2)*x*erfc(b*x)*b*Pi-3*erfc(b*x)^2*Pi^(3/2)+8*exp(-b^2*x^2)^2*Pi^(1/2))/Pi^(3/2)/b^4

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.98 \[ \int x^3 \text {erfc}(b x)^2 \, dx=\frac {4 \, \pi b^{4} x^{4} - {\left (3 \, \pi - 4 \, \pi b^{4} x^{4}\right )} \operatorname {erf}\left (b x\right )^{2} - 4 \, \sqrt {\pi } {\left (2 \, b^{3} x^{3} + 3 \, b x - {\left (2 \, b^{3} x^{3} + 3 \, b x\right )} \operatorname {erf}\left (b x\right )\right )} e^{\left (-b^{2} x^{2}\right )} + 2 \, {\left (3 \, \pi - 4 \, \pi b^{4} x^{4}\right )} \operatorname {erf}\left (b x\right ) + 4 \, {\left (b^{2} x^{2} + 2\right )} e^{\left (-2 \, b^{2} x^{2}\right )}}{16 \, \pi b^{4}} \]

[In]

integrate(x^3*erfc(b*x)^2,x, algorithm="fricas")

[Out]

1/16*(4*pi*b^4*x^4 - (3*pi - 4*pi*b^4*x^4)*erf(b*x)^2 - 4*sqrt(pi)*(2*b^3*x^3 + 3*b*x - (2*b^3*x^3 + 3*b*x)*er
f(b*x))*e^(-b^2*x^2) + 2*(3*pi - 4*pi*b^4*x^4)*erf(b*x) + 4*(b^2*x^2 + 2)*e^(-2*b^2*x^2))/(pi*b^4)

Sympy [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.96 \[ \int x^3 \text {erfc}(b x)^2 \, dx=\begin {cases} \frac {x^{4} \operatorname {erfc}^{2}{\left (b x \right )}}{4} - \frac {x^{3} e^{- b^{2} x^{2}} \operatorname {erfc}{\left (b x \right )}}{2 \sqrt {\pi } b} + \frac {x^{2} e^{- 2 b^{2} x^{2}}}{4 \pi b^{2}} - \frac {3 x e^{- b^{2} x^{2}} \operatorname {erfc}{\left (b x \right )}}{4 \sqrt {\pi } b^{3}} - \frac {3 \operatorname {erfc}^{2}{\left (b x \right )}}{16 b^{4}} + \frac {e^{- 2 b^{2} x^{2}}}{2 \pi b^{4}} & \text {for}\: b \neq 0 \\\frac {x^{4}}{4} & \text {otherwise} \end {cases} \]

[In]

integrate(x**3*erfc(b*x)**2,x)

[Out]

Piecewise((x**4*erfc(b*x)**2/4 - x**3*exp(-b**2*x**2)*erfc(b*x)/(2*sqrt(pi)*b) + x**2*exp(-2*b**2*x**2)/(4*pi*
b**2) - 3*x*exp(-b**2*x**2)*erfc(b*x)/(4*sqrt(pi)*b**3) - 3*erfc(b*x)**2/(16*b**4) + exp(-2*b**2*x**2)/(2*pi*b
**4), Ne(b, 0)), (x**4/4, True))

Maxima [F]

\[ \int x^3 \text {erfc}(b x)^2 \, dx=\int { x^{3} \operatorname {erfc}\left (b x\right )^{2} \,d x } \]

[In]

integrate(x^3*erfc(b*x)^2,x, algorithm="maxima")

[Out]

integrate(x^3*erfc(b*x)^2, x)

Giac [F]

\[ \int x^3 \text {erfc}(b x)^2 \, dx=\int { x^{3} \operatorname {erfc}\left (b x\right )^{2} \,d x } \]

[In]

integrate(x^3*erfc(b*x)^2,x, algorithm="giac")

[Out]

integrate(x^3*erfc(b*x)^2, x)

Mupad [B] (verification not implemented)

Time = 4.91 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.81 \[ \int x^3 \text {erfc}(b x)^2 \, dx=\frac {x^4\,{\mathrm {erfc}\left (b\,x\right )}^2}{4}-\frac {\frac {3\,\pi \,{\mathrm {erfc}\left (b\,x\right )}^2}{16}-\frac {{\mathrm {e}}^{-2\,b^2\,x^2}}{2}-\frac {b^2\,x^2\,{\mathrm {e}}^{-2\,b^2\,x^2}}{4}+\frac {b^3\,x^3\,\sqrt {\pi }\,{\mathrm {e}}^{-b^2\,x^2}\,\mathrm {erfc}\left (b\,x\right )}{2}+\frac {3\,b\,x\,\sqrt {\pi }\,{\mathrm {e}}^{-b^2\,x^2}\,\mathrm {erfc}\left (b\,x\right )}{4}}{b^4\,\pi } \]

[In]

int(x^3*erfc(b*x)^2,x)

[Out]

(x^4*erfc(b*x)^2)/4 - ((3*pi*erfc(b*x)^2)/16 - exp(-2*b^2*x^2)/2 - (b^2*x^2*exp(-2*b^2*x^2))/4 + (b^3*x^3*pi^(
1/2)*exp(-b^2*x^2)*erfc(b*x))/2 + (3*b*x*pi^(1/2)*exp(-b^2*x^2)*erfc(b*x))/4)/(b^4*pi)