3.5.27 \(\int f^{a+b x+c x^2} x^2 \, dx\) [427]

Optimal. Leaf size=164 \[ -\frac {f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{4 c^{3/2} \log ^{\frac {3}{2}}(f)}-\frac {b f^{a+b x+c x^2}}{4 c^2 \log (f)}+\frac {f^{a+b x+c x^2} x}{2 c \log (f)}+\frac {b^2 f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{8 c^{5/2} \sqrt {\log (f)}} \]

[Out]

-1/4*b*f^(c*x^2+b*x+a)/c^2/ln(f)+1/2*f^(c*x^2+b*x+a)*x/c/ln(f)-1/4*f^(a-1/4*b^2/c)*erfi(1/2*(2*c*x+b)*ln(f)^(1
/2)/c^(1/2))*Pi^(1/2)/c^(3/2)/ln(f)^(3/2)+1/8*b^2*f^(a-1/4*b^2/c)*erfi(1/2*(2*c*x+b)*ln(f)^(1/2)/c^(1/2))*Pi^(
1/2)/c^(5/2)/ln(f)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 164, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2273, 2272, 2266, 2235} \begin {gather*} -\frac {\sqrt {\pi } f^{a-\frac {b^2}{4 c}} \text {Erfi}\left (\frac {\sqrt {\log (f)} (b+2 c x)}{2 \sqrt {c}}\right )}{4 c^{3/2} \log ^{\frac {3}{2}}(f)}+\frac {\sqrt {\pi } b^2 f^{a-\frac {b^2}{4 c}} \text {Erfi}\left (\frac {\sqrt {\log (f)} (b+2 c x)}{2 \sqrt {c}}\right )}{8 c^{5/2} \sqrt {\log (f)}}-\frac {b f^{a+b x+c x^2}}{4 c^2 \log (f)}+\frac {x f^{a+b x+c x^2}}{2 c \log (f)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[f^(a + b*x + c*x^2)*x^2,x]

[Out]

-1/4*(f^(a - b^2/(4*c))*Sqrt[Pi]*Erfi[((b + 2*c*x)*Sqrt[Log[f]])/(2*Sqrt[c])])/(c^(3/2)*Log[f]^(3/2)) - (b*f^(
a + b*x + c*x^2))/(4*c^2*Log[f]) + (f^(a + b*x + c*x^2)*x)/(2*c*Log[f]) + (b^2*f^(a - b^2/(4*c))*Sqrt[Pi]*Erfi
[((b + 2*c*x)*Sqrt[Log[f]])/(2*Sqrt[c])])/(8*c^(5/2)*Sqrt[Log[f]])

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2272

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(F^(a + b*x + c*x^2)/(2
*c*Log[F])), x] - Dist[(b*e - 2*c*d)/(2*c), Int[F^(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e}, x] &&
 NeQ[b*e - 2*c*d, 0]

Rule 2273

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

Rubi steps

\begin {align*} \int f^{a+b x+c x^2} x^2 \, dx &=\frac {f^{a+b x+c x^2} x}{2 c \log (f)}-\frac {b \int f^{a+b x+c x^2} x \, dx}{2 c}-\frac {\int f^{a+b x+c x^2} \, dx}{2 c \log (f)}\\ &=-\frac {b f^{a+b x+c x^2}}{4 c^2 \log (f)}+\frac {f^{a+b x+c x^2} x}{2 c \log (f)}+\frac {b^2 \int f^{a+b x+c x^2} \, dx}{4 c^2}-\frac {f^{a-\frac {b^2}{4 c}} \int f^{\frac {(b+2 c x)^2}{4 c}} \, dx}{2 c \log (f)}\\ &=-\frac {f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{4 c^{3/2} \log ^{\frac {3}{2}}(f)}-\frac {b f^{a+b x+c x^2}}{4 c^2 \log (f)}+\frac {f^{a+b x+c x^2} x}{2 c \log (f)}+\frac {\left (b^2 f^{a-\frac {b^2}{4 c}}\right ) \int f^{\frac {(b+2 c x)^2}{4 c}} \, dx}{4 c^2}\\ &=-\frac {f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{4 c^{3/2} \log ^{\frac {3}{2}}(f)}-\frac {b f^{a+b x+c x^2}}{4 c^2 \log (f)}+\frac {f^{a+b x+c x^2} x}{2 c \log (f)}+\frac {b^2 f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{8 c^{5/2} \sqrt {\log (f)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.19, size = 104, normalized size = 0.63 \begin {gather*} \frac {f^{a-\frac {b^2}{4 c}} \left (-2 \sqrt {c} f^{\frac {(b+2 c x)^2}{4 c}} (b-2 c x) \sqrt {\log (f)}+\sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right ) \left (-2 c+b^2 \log (f)\right )\right )}{8 c^{5/2} \log ^{\frac {3}{2}}(f)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[f^(a + b*x + c*x^2)*x^2,x]

[Out]

(f^(a - b^2/(4*c))*(-2*Sqrt[c]*f^((b + 2*c*x)^2/(4*c))*(b - 2*c*x)*Sqrt[Log[f]] + Sqrt[Pi]*Erfi[((b + 2*c*x)*S
qrt[Log[f]])/(2*Sqrt[c])]*(-2*c + b^2*Log[f])))/(8*c^(5/2)*Log[f]^(3/2))

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 163, normalized size = 0.99

method result size
risch \(\frac {x \,f^{c \,x^{2}} f^{b x} f^{a}}{2 c \ln \left (f \right )}-\frac {b \,f^{c \,x^{2}} f^{b x} f^{a}}{4 c^{2} \ln \left (f \right )}-\frac {b^{2} \sqrt {\pi }\, f^{a} f^{-\frac {b^{2}}{4 c}} \erf \left (-\sqrt {-c \ln \left (f \right )}\, x +\frac {b \ln \left (f \right )}{2 \sqrt {-c \ln \left (f \right )}}\right )}{8 c^{2} \sqrt {-c \ln \left (f \right )}}+\frac {\sqrt {\pi }\, f^{a} f^{-\frac {b^{2}}{4 c}} \erf \left (-\sqrt {-c \ln \left (f \right )}\, x +\frac {b \ln \left (f \right )}{2 \sqrt {-c \ln \left (f \right )}}\right )}{4 c \ln \left (f \right ) \sqrt {-c \ln \left (f \right )}}\) \(163\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(f^(c*x^2+b*x+a)*x^2,x,method=_RETURNVERBOSE)

[Out]

1/2/c/ln(f)*x*f^(c*x^2)*f^(b*x)*f^a-1/4*b/c^2/ln(f)*f^(c*x^2)*f^(b*x)*f^a-1/8*b^2/c^2*Pi^(1/2)*f^a*f^(-1/4*b^2
/c)/(-c*ln(f))^(1/2)*erf(-(-c*ln(f))^(1/2)*x+1/2*b*ln(f)/(-c*ln(f))^(1/2))+1/4/c/ln(f)*Pi^(1/2)*f^a*f^(-1/4*b^
2/c)/(-c*ln(f))^(1/2)*erf(-(-c*ln(f))^(1/2)*x+1/2*b*ln(f)/(-c*ln(f))^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.36, size = 166, normalized size = 1.01 \begin {gather*} \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x + b\right )} b^{2} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x + b\right )}^{2} \log \left (f\right )}{c}}\right ) - 1\right )} \log \left (f\right )^{3}}{\sqrt {-\frac {{\left (2 \, c x + b\right )}^{2} \log \left (f\right )}{c}} \left (c \log \left (f\right )\right )^{\frac {5}{2}}} - \frac {4 \, {\left (2 \, c x + b\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x + b\right )}^{2} \log \left (f\right )}{4 \, c}\right ) \log \left (f\right )^{3}}{\left (-\frac {{\left (2 \, c x + b\right )}^{2} \log \left (f\right )}{c}\right )^{\frac {3}{2}} \left (c \log \left (f\right )\right )^{\frac {5}{2}}} - \frac {4 \, b c f^{\frac {{\left (2 \, c x + b\right )}^{2}}{4 \, c}} \log \left (f\right )^{2}}{\left (c \log \left (f\right )\right )^{\frac {5}{2}}}\right )} f^{a - \frac {b^{2}}{4 \, c}}}{8 \, \sqrt {c \log \left (f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(c*x^2+b*x+a)*x^2,x, algorithm="maxima")

[Out]

1/8*(sqrt(pi)*(2*c*x + b)*b^2*(erf(1/2*sqrt(-(2*c*x + b)^2*log(f)/c)) - 1)*log(f)^3/(sqrt(-(2*c*x + b)^2*log(f
)/c)*(c*log(f))^(5/2)) - 4*(2*c*x + b)^3*gamma(3/2, -1/4*(2*c*x + b)^2*log(f)/c)*log(f)^3/((-(2*c*x + b)^2*log
(f)/c)^(3/2)*(c*log(f))^(5/2)) - 4*b*c*f^(1/4*(2*c*x + b)^2/c)*log(f)^2/(c*log(f))^(5/2))*f^(a - 1/4*b^2/c)/sq
rt(c*log(f))

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 95, normalized size = 0.58 \begin {gather*} \frac {2 \, {\left (2 \, c^{2} x - b c\right )} f^{c x^{2} + b x + a} \log \left (f\right ) - \frac {\sqrt {\pi } {\left (b^{2} \log \left (f\right ) - 2 \, c\right )} \sqrt {-c \log \left (f\right )} \operatorname {erf}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {-c \log \left (f\right )}}{2 \, c}\right )}{f^{\frac {b^{2} - 4 \, a c}{4 \, c}}}}{8 \, c^{3} \log \left (f\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(c*x^2+b*x+a)*x^2,x, algorithm="fricas")

[Out]

1/8*(2*(2*c^2*x - b*c)*f^(c*x^2 + b*x + a)*log(f) - sqrt(pi)*(b^2*log(f) - 2*c)*sqrt(-c*log(f))*erf(1/2*(2*c*x
 + b)*sqrt(-c*log(f))/c)/f^(1/4*(b^2 - 4*a*c)/c))/(c^3*log(f)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x + c x^{2}} x^{2}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f**(c*x**2+b*x+a)*x**2,x)

[Out]

Integral(f**(a + b*x + c*x**2)*x**2, x)

________________________________________________________________________________________

Giac [A]
time = 2.60, size = 108, normalized size = 0.66 \begin {gather*} -\frac {\frac {\sqrt {\pi } {\left (b^{2} \log \left (f\right ) - 2 \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {-c \log \left (f\right )} {\left (2 \, x + \frac {b}{c}\right )}\right ) e^{\left (-\frac {b^{2} \log \left (f\right ) - 4 \, a c \log \left (f\right )}{4 \, c}\right )}}{\sqrt {-c \log \left (f\right )} \log \left (f\right )} - \frac {2 \, {\left (c {\left (2 \, x + \frac {b}{c}\right )} - 2 \, b\right )} e^{\left (c x^{2} \log \left (f\right ) + b x \log \left (f\right ) + a \log \left (f\right )\right )}}{\log \left (f\right )}}{8 \, c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(c*x^2+b*x+a)*x^2,x, algorithm="giac")

[Out]

-1/8*(sqrt(pi)*(b^2*log(f) - 2*c)*erf(-1/2*sqrt(-c*log(f))*(2*x + b/c))*e^(-1/4*(b^2*log(f) - 4*a*c*log(f))/c)
/(sqrt(-c*log(f))*log(f)) - 2*(c*(2*x + b/c) - 2*b)*e^(c*x^2*log(f) + b*x*log(f) + a*log(f))/log(f))/c^2

________________________________________________________________________________________

Mupad [B]
time = 3.60, size = 111, normalized size = 0.68 \begin {gather*} \frac {f^a\,f^{c\,x^2}\,f^{b\,x}\,x}{2\,c\,\ln \left (f\right )}-\frac {b\,f^a\,f^{c\,x^2}\,f^{b\,x}}{4\,c^2\,\ln \left (f\right )}-\frac {f^{a-\frac {b^2}{4\,c}}\,\sqrt {\pi }\,\mathrm {erfi}\left (\frac {\frac {b\,\ln \left (f\right )}{2}+c\,x\,\ln \left (f\right )}{\sqrt {c\,\ln \left (f\right )}}\right )\,\left (\frac {c}{4}-\frac {b^2\,\ln \left (f\right )}{8}\right )}{c^2\,\ln \left (f\right )\,\sqrt {c\,\ln \left (f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(f^(a + b*x + c*x^2)*x^2,x)

[Out]

(f^a*f^(c*x^2)*f^(b*x)*x)/(2*c*log(f)) - (b*f^a*f^(c*x^2)*f^(b*x))/(4*c^2*log(f)) - (f^(a - b^2/(4*c))*pi^(1/2
)*erfi(((b*log(f))/2 + c*x*log(f))/(c*log(f))^(1/2))*(c/4 - (b^2*log(f))/8))/(c^2*log(f)*(c*log(f))^(1/2))

________________________________________________________________________________________