Optimal. Leaf size=32 \[ -\frac{a^2 e^{-n x}}{n}+2 a b x+\frac{b^2 e^{n x}}{n} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0342845, antiderivative size = 32, normalized size of antiderivative = 1., 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 = {2248, 43} \[ -\frac{a^2 e^{-n x}}{n}+2 a b x+\frac{b^2 e^{n x}}{n} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2248
Rule 43
Rubi steps
\begin{align*} \int e^{-n x} \left (a+b e^{n x}\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x^2} \, dx,x,e^{n x}\right )}{n}\\ &=\frac{\operatorname{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.0178364, size = 31, normalized size = 0.97 \[ \frac{a^2 \left (-e^{-n x}\right )+2 a b n x+b^2 e^{n x}}{n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.006, size = 39, normalized size = 1.2 \begin{align*}{\frac{{b}^{2}{{\rm e}^{nx}}}{n}}+2\,{\frac{ab\ln \left ({{\rm e}^{nx}} \right ) }{n}}-{\frac{{a}^{2}}{n{{\rm e}^{nx}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.15055, size = 41, normalized size = 1.28 \begin{align*} 2 \, a b x + \frac{b^{2} e^{\left (n x\right )}}{n} - \frac{a^{2} e^{\left (-n x\right )}}{n} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.48498, size = 73, normalized size = 2.28 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.183723, size = 39, normalized size = 1.22 \begin{align*} 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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27072, size = 41, normalized size = 1.28 \begin{align*} 2 \, a b x + \frac{b^{2} e^{\left (n x\right )}}{n} - \frac{a^{2} e^{\left (-n x\right )}}{n} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]