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

   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 = 8, antiderivative size = 72 \[ \int x \text {erfc}(b x)^2 \, dx=\frac {e^{-2 b^2 x^2}}{2 b^2 \pi }-\frac {e^{-b^2 x^2} x \text {erfc}(b x)}{b \sqrt {\pi }}-\frac {\text {erfc}(b x)^2}{4 b^2}+\frac {1}{2} x^2 \text {erfc}(b x)^2 \]

[Out]

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

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.625, Rules used = {6500, 6521, 6509, 30, 2240} \[ \int x \text {erfc}(b x)^2 \, dx=-\frac {x e^{-b^2 x^2} \text {erfc}(b x)}{\sqrt {\pi } b}-\frac {\text {erfc}(b x)^2}{4 b^2}+\frac {e^{-2 b^2 x^2}}{2 \pi b^2}+\frac {1}{2} x^2 \text {erfc}(b x)^2 \]

[In]

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

[Out]

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

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 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}{2} x^2 \text {erfc}(b x)^2+\frac {(2 b) \int e^{-b^2 x^2} x^2 \text {erfc}(b x) \, dx}{\sqrt {\pi }} \\ & = -\frac {e^{-b^2 x^2} x \text {erfc}(b x)}{b \sqrt {\pi }}+\frac {1}{2} x^2 \text {erfc}(b x)^2-\frac {2 \int e^{-2 b^2 x^2} x \, dx}{\pi }+\frac {\int e^{-b^2 x^2} \text {erfc}(b x) \, dx}{b \sqrt {\pi }} \\ & = \frac {e^{-2 b^2 x^2}}{2 b^2 \pi }-\frac {e^{-b^2 x^2} x \text {erfc}(b x)}{b \sqrt {\pi }}+\frac {1}{2} x^2 \text {erfc}(b x)^2-\frac {\text {Subst}(\int x \, dx,x,\text {erfc}(b x))}{2 b^2} \\ & = \frac {e^{-2 b^2 x^2}}{2 b^2 \pi }-\frac {e^{-b^2 x^2} x \text {erfc}(b x)}{b \sqrt {\pi }}-\frac {\text {erfc}(b x)^2}{4 b^2}+\frac {1}{2} x^2 \text {erfc}(b x)^2 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.38 \[ \int x \text {erfc}(b x)^2 \, dx=\frac {2 e^{-2 b^2 x^2} \left (-1+b e^{b^2 x^2} \sqrt {\pi } x\right )^2+\left (4 b e^{-b^2 x^2} \sqrt {\pi } x+\pi \left (2-4 b^2 x^2\right )\right ) \text {erf}(b x)+\pi \left (-1+2 b^2 x^2\right ) \text {erf}(b x)^2}{4 b^2 \pi } \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.94 \[ \int x \text {erfc}(b x)^2 \, dx=\frac {\frac {{\mathrm {e}}^{-2\,b^2\,x^2}}{2}-b\,x\,\sqrt {\pi }\,{\mathrm {e}}^{-b^2\,x^2}\,\mathrm {erfc}\left (b\,x\right )}{b^2\,\pi }-\frac {\frac {{\mathrm {erfc}\left (b\,x\right )}^2}{4}-\frac {b^2\,x^2\,{\mathrm {erfc}\left (b\,x\right )}^2}{2}}{b^2} \]

[In]

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

[Out]

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