\(\int (a+b e^x)^2 \, dx\) [695]

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

Optimal result

Integrand size = 9, antiderivative size = 25 \[ \int \left (a+b e^x\right )^2 \, dx=2 a b e^x+\frac {1}{2} b^2 e^{2 x}+a^2 x \]

[Out]

2*a*b*exp(x)+1/2*b^2*exp(2*x)+a^2*x

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2320, 45} \[ \int \left (a+b e^x\right )^2 \, dx=a^2 x+2 a b e^x+\frac {1}{2} b^2 e^{2 x} \]

[In]

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

[Out]

2*a*b*E^x + (b^2*E^(2*x))/2 + a^2*x

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {(a+b x)^2}{x} \, dx,x,e^x\right ) \\ & = \text {Subst}\left (\int \left (2 a b+\frac {a^2}{x}+b^2 x\right ) \, dx,x,e^x\right ) \\ & = 2 a b e^x+\frac {1}{2} b^2 e^{2 x}+a^2 x \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.04 \[ \int \left (a+b e^x\right )^2 \, dx=\frac {1}{2} b e^x \left (4 a+b e^x\right )+a^2 \log \left (e^x\right ) \]

[In]

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

[Out]

(b*E^x*(4*a + b*E^x))/2 + a^2*Log[E^x]

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
norman \(2 a b \,{\mathrm e}^{x}+\frac {b^{2} {\mathrm e}^{2 x}}{2}+a^{2} x\) \(22\)
risch \(2 a b \,{\mathrm e}^{x}+\frac {b^{2} {\mathrm e}^{2 x}}{2}+a^{2} x\) \(22\)
parallelrisch \(2 a b \,{\mathrm e}^{x}+\frac {b^{2} {\mathrm e}^{2 x}}{2}+a^{2} x\) \(22\)
parts \(2 a b \,{\mathrm e}^{x}+\frac {b^{2} {\mathrm e}^{2 x}}{2}+a^{2} x\) \(22\)
derivativedivides \(\frac {b^{2} {\mathrm e}^{2 x}}{2}+2 a b \,{\mathrm e}^{x}+a^{2} \ln \left ({\mathrm e}^{x}\right )\) \(24\)
default \(\frac {b^{2} {\mathrm e}^{2 x}}{2}+2 a b \,{\mathrm e}^{x}+a^{2} \ln \left ({\mathrm e}^{x}\right )\) \(24\)

[In]

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

[Out]

a^2*x+1/2*b^2*exp(x)^2+2*a*b*exp(x)

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \left (a+b e^x\right )^2 \, dx=a^{2} x + \frac {1}{2} \, b^{2} e^{\left (2 \, x\right )} + 2 \, a b e^{x} \]

[In]

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

[Out]

a^2*x + 1/2*b^2*e^(2*x) + 2*a*b*e^x

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \left (a+b e^x\right )^2 \, dx=a^{2} x + 2 a b e^{x} + \frac {b^{2} e^{2 x}}{2} \]

[In]

integrate((a+b*exp(x))**2,x)

[Out]

a**2*x + 2*a*b*exp(x) + b**2*exp(2*x)/2

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \left (a+b e^x\right )^2 \, dx=a^{2} x + \frac {1}{2} \, b^{2} e^{\left (2 \, x\right )} + 2 \, a b e^{x} \]

[In]

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

[Out]

a^2*x + 1/2*b^2*e^(2*x) + 2*a*b*e^x

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \left (a+b e^x\right )^2 \, dx=a^{2} x + \frac {1}{2} \, b^{2} e^{\left (2 \, x\right )} + 2 \, a b e^{x} \]

[In]

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

[Out]

a^2*x + 1/2*b^2*e^(2*x) + 2*a*b*e^x

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \left (a+b e^x\right )^2 \, dx=x\,a^2+2\,{\mathrm {e}}^x\,a\,b+\frac {{\mathrm {e}}^{2\,x}\,b^2}{2} \]

[In]

int((a + b*exp(x))^2,x)

[Out]

(b^2*exp(2*x))/2 + a^2*x + 2*a*b*exp(x)