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

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

Optimal result

Integrand size = 21, antiderivative size = 78 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=-\frac {\sqrt {c} f^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )}{\log ^{\frac {3}{2}}(f)}+\frac {f^{a+b x+c x^2} (b+2 c x)}{\log (f)} \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2269, 2266, 2235} \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\frac {(b+2 c x) f^{a+b x+c x^2}}{\log (f)}-\frac {\sqrt {\pi } \sqrt {c} f^{a-\frac {b^2}{4 c}} \text {erfi}\left (\frac {\sqrt {\log (f)} (b+2 c x)}{2 \sqrt {c}}\right )}{\log ^{\frac {3}{2}}(f)} \]

[In]

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

[Out]

-((Sqrt[c]*f^(a - b^2/(4*c))*Sqrt[Pi]*Erfi[((b + 2*c*x)*Sqrt[Log[f]])/(2*Sqrt[c])])/Log[f]^(3/2)) + (f^(a + b*
x + c*x^2)*(b + 2*c*x))/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 2269

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[(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] && EqQ[b*e - 2*c*d, 0] && GtQ[m, 1]

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

Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.10 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\frac {f^{a-\frac {b^2}{4 c}} \left (-\sqrt {c} \sqrt {\pi } \text {erfi}\left (\frac {(b+2 c x) \sqrt {\log (f)}}{2 \sqrt {c}}\right )+f^{\frac {(b+2 c x)^2}{4 c}} (b+2 c x) \sqrt {\log (f)}\right )}{\log ^{\frac {3}{2}}(f)} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.27

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

[In]

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

[Out]

2*f^a*c/ln(f)*x*f^(b*x)*f^(c*x^2)+f^a*b/ln(f)*f^(b*x)*f^(c*x^2)+f^a*c/ln(f)*Pi^(1/2)*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))

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.95 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\frac {{\left (2 \, c x + b\right )} f^{c x^{2} + b x + a} \log \left (f\right ) + \frac {\sqrt {\pi } \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}}}}{\log \left (f\right )^{2}} \]

[In]

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

[Out]

((2*c*x + b)*f^(c*x^2 + b*x + a)*log(f) + sqrt(pi)*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))/log(f)^2

Sympy [F]

\[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\int f^{a + b x + c x^{2}} \left (b + 2 c x\right )^{2}\, dx \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 332 vs. \(2 (64) = 128\).

Time = 0.38 (sec) , antiderivative size = 332, normalized size of antiderivative = 4.26 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=-\frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x + b\right )} b {\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 )^{2}}{\sqrt {-\frac {{\left (2 \, c x + b\right )}^{2} \log \left (f\right )}{c}} \left (c \log \left (f\right )\right )^{\frac {3}{2}}} - \frac {2 \, c f^{\frac {{\left (2 \, c x + b\right )}^{2}}{4 \, c}} \log \left (f\right )}{\left (c \log \left (f\right )\right )^{\frac {3}{2}}}\right )} b c f^{a - \frac {b^{2}}{4 \, c}}}{\sqrt {c \log \left (f\right )}} + \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 )} c^{2} f^{a - \frac {b^{2}}{4 \, c}}}{2 \, \sqrt {c \log \left (f\right )}} + \frac {\sqrt {\pi } b^{2} f^{a} \operatorname {erf}\left (\sqrt {-c \log \left (f\right )} x - \frac {b \log \left (f\right )}{2 \, \sqrt {-c \log \left (f\right )}}\right )}{2 \, \sqrt {-c \log \left (f\right )} f^{\frac {b^{2}}{4 \, c}}} \]

[In]

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

[Out]

-(sqrt(pi)*(2*c*x + b)*b*(erf(1/2*sqrt(-(2*c*x + b)^2*log(f)/c)) - 1)*log(f)^2/(sqrt(-(2*c*x + b)^2*log(f)/c)*
(c*log(f))^(3/2)) - 2*c*f^(1/4*(2*c*x + b)^2/c)*log(f)/(c*log(f))^(3/2))*b*c*f^(a - 1/4*b^2/c)/sqrt(c*log(f))
+ 1/2*(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*l
og(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))*c^2*f^(a - 1/4*b^2
/c)/sqrt(c*log(f)) + 1/2*sqrt(pi)*b^2*f^a*erf(sqrt(-c*log(f))*x - 1/2*b*log(f)/sqrt(-c*log(f)))/(sqrt(-c*log(f
))*f^(1/4*b^2/c))

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.13 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\frac {c {\left (2 \, x + \frac {b}{c}\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 )} + \frac {\sqrt {\pi } c \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 )} \]

[In]

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

[Out]

c*(2*x + b/c)*e^(c*x^2*log(f) + b*x*log(f) + a*log(f))/log(f) + sqrt(pi)*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))

Mupad [B] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.18 \[ \int f^{a+b x+c x^2} (b+2 c x)^2 \, dx=\frac {b\,f^a\,f^{c\,x^2}\,f^{b\,x}}{\ln \left (f\right )}-\frac {c\,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 )}{\ln \left (f\right )\,\sqrt {c\,\ln \left (f\right )}}+\frac {2\,c\,f^a\,f^{c\,x^2}\,f^{b\,x}\,x}{\ln \left (f\right )} \]

[In]

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

[Out]

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