3.1.28 \(\int e^{-n x} (a+b e^{n x})^2 \, dx\) [28]

Optimal. Leaf size=32 \[ -\frac {a^2 e^{-n x}}{n}+\frac {b^2 e^{n x}}{n}+2 a b x \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2280, 45} \begin {gather*} -\frac {a^2 e^{-n x}}{n}+2 a b x+\frac {b^2 e^{n x}}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(a^2/(E^(n*x)*n)) + (b^2*E^(n*x))/n + 2*a*b*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 2280

Int[((a_) + (b_.)*(F_)^((e_.)*((c_.) + (d_.)*(x_))))^(p_.)*(G_)^((h_.)*((f_.) + (g_.)*(x_))), x_Symbol] :> Wit
h[{m = FullSimplify[g*h*(Log[G]/(d*e*Log[F]))]}, Dist[Denominator[m]*(G^(f*h - c*g*(h/d))/(d*e*Log[F])), Subst
[Int[x^(Numerator[m] - 1)*(a + b*x^Denominator[m])^p, x], x, F^(e*((c + d*x)/Denominator[m]))], x] /; LeQ[m, -
1] || GeQ[m, 1]] /; FreeQ[{F, G, a, b, c, d, e, f, g, h, p}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 36, normalized size = 1.12 \begin {gather*} \frac {-a^2 e^{-n x}+b^2 e^{n x}-2 a b \log \left (e^{-n x}\right )}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 34, normalized size = 1.06

method result size
risch \(-\frac {a^{2} {\mathrm e}^{-n x}}{n}+\frac {b^{2} {\mathrm e}^{n x}}{n}+2 a b x\) \(31\)
derivativedivides \(\frac {b^{2} {\mathrm e}^{n x}-a^{2} {\mathrm e}^{-n x}+2 b a \ln \left ({\mathrm e}^{n x}\right )}{n}\) \(34\)
default \(\frac {b^{2} {\mathrm e}^{n x}-a^{2} {\mathrm e}^{-n x}+2 b a \ln \left ({\mathrm e}^{n x}\right )}{n}\) \(34\)
norman \(\left (\frac {b^{2} {\mathrm e}^{2 n x}}{n}-\frac {a^{2}}{n}+2 a b x \,{\mathrm e}^{n x}\right ) {\mathrm e}^{-n x}\) \(39\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 30, normalized size = 0.94 \begin {gather*} 2 \, a b x + \frac {b^{2} e^{\left (n x\right )}}{n} - \frac {a^{2} e^{\left (-n x\right )}}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*a*b*x + b^2*e^(n*x)/n - a^2*e^(-n*x)/n

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 34, normalized size = 1.06 \begin {gather*} \frac {{\left (2 \, a b n x e^{\left (n x\right )} + b^{2} e^{\left (2 \, n x\right )} - a^{2}\right )} e^{\left (-n x\right )}}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*a*b*n*x*e^(n*x) + b^2*e^(2*n*x) - a^2)*e^(-n*x)/n

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 39, normalized size = 1.22 \begin {gather*} 2 a b x + \begin {cases} \frac {- a^{2} n e^{- n x} + b^{2} n e^{n x}}{n^{2}} & \text {for}\: n^{2} \neq 0 \\x \left (a^{2} + b^{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*a*b*x + Piecewise(((-a**2*n*exp(-n*x) + b**2*n*exp(n*x))/n**2, Ne(n**2, 0)), (x*(a**2 + b**2), True))

________________________________________________________________________________________

Giac [A]
time = 2.67, size = 30, normalized size = 0.94 \begin {gather*} 2 \, a b x + \frac {b^{2} e^{\left (n x\right )}}{n} - \frac {a^{2} e^{\left (-n x\right )}}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*a*b*x + b^2*e^(n*x)/n - a^2*e^(-n*x)/n

________________________________________________________________________________________

Mupad [B]
time = 0.09, size = 30, normalized size = 0.94 \begin {gather*} 2\,a\,b\,x-\frac {{\mathrm {e}}^{-n\,x}\,\left (a^2-b^2\,{\mathrm {e}}^{2\,n\,x}\right )}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*a*b*x - (exp(-n*x)*(a^2 - b^2*exp(2*n*x)))/n

________________________________________________________________________________________