3.513 \(\int (1+a^{m x})^2 \, dx\)

Optimal. Leaf size=33 \[ \frac{2 a^{m x}}{m \log (a)}+\frac{a^{2 m x}}{2 m \log (a)}+x \]

[Out]

x + (2*a^(m*x))/(m*Log[a]) + a^(2*m*x)/(2*m*Log[a])

________________________________________________________________________________________

Rubi [A]  time = 0.0134742, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2282, 43} \[ \frac{2 a^{m x}}{m \log (a)}+\frac{a^{2 m x}}{2 m \log (a)}+x \]

Antiderivative was successfully verified.

[In]

Int[(1 + a^(m*x))^2,x]

[Out]

x + (2*a^(m*x))/(m*Log[a]) + a^(2*m*x)/(2*m*Log[a])

Rule 2282

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]]]

Rule 43

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])

Rubi steps

\begin{align*} \int \left (1+a^{m x}\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(1+x)^2}{x} \, dx,x,a^{m x}\right )}{m \log (a)}\\ &=\frac{\operatorname{Subst}\left (\int \left (2+\frac{1}{x}+x\right ) \, dx,x,a^{m x}\right )}{m \log (a)}\\ &=x+\frac{2 a^{m x}}{m \log (a)}+\frac{a^{2 m x}}{2 m \log (a)}\\ \end{align*}

Mathematica [A]  time = 0.0102533, size = 31, normalized size = 0.94 \[ \frac{2 a^{m x}+\frac{1}{2} a^{2 m x}+m x \log (a)}{m \log (a)} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + a^(m*x))^2,x]

[Out]

(2*a^(m*x) + a^(2*m*x)/2 + m*x*Log[a])/(m*Log[a])

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 46, normalized size = 1.4 \begin{align*}{\frac{ \left ({a}^{mx} \right ) ^{2}}{2\,m\ln \left ( a \right ) }}+2\,{\frac{{a}^{mx}}{m\ln \left ( a \right ) }}+{\frac{\ln \left ({a}^{mx} \right ) }{m\ln \left ( a \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1+a^(m*x))^2,x)

[Out]

1/2/m/ln(a)*(a^(m*x))^2+2*a^(m*x)/m/ln(a)+1/m/ln(a)*ln(a^(m*x))

________________________________________________________________________________________

Maxima [A]  time = 0.928311, size = 42, normalized size = 1.27 \begin{align*} x + \frac{a^{2 \, m x}}{2 \, m \log \left (a\right )} + \frac{2 \, a^{m x}}{m \log \left (a\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+a^(m*x))^2,x, algorithm="maxima")

[Out]

x + 1/2*a^(2*m*x)/(m*log(a)) + 2*a^(m*x)/(m*log(a))

________________________________________________________________________________________

Fricas [A]  time = 1.81448, size = 74, normalized size = 2.24 \begin{align*} \frac{2 \, m x \log \left (a\right ) + a^{2 \, m x} + 4 \, a^{m x}}{2 \, m \log \left (a\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+a^(m*x))^2,x, algorithm="fricas")

[Out]

1/2*(2*m*x*log(a) + a^(2*m*x) + 4*a^(m*x))/(m*log(a))

________________________________________________________________________________________

Sympy [A]  time = 0.110519, size = 46, normalized size = 1.39 \begin{align*} x + \begin{cases} \frac{a^{2 m x} m \log{\left (a \right )} + 4 a^{m x} m \log{\left (a \right )}}{2 m^{2} \log{\left (a \right )}^{2}} & \text{for}\: 2 m^{2} \log{\left (a \right )}^{2} \neq 0 \\3 x & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+a**(m*x))**2,x)

[Out]

x + Piecewise(((a**(2*m*x)*m*log(a) + 4*a**(m*x)*m*log(a))/(2*m**2*log(a)**2), Ne(2*m**2*log(a)**2, 0)), (3*x,
 True))

________________________________________________________________________________________

Giac [A]  time = 1.0866, size = 41, normalized size = 1.24 \begin{align*} \frac{2 \, m x \log \left ({\left | a \right |}\right ) + a^{2 \, m x} + 4 \, a^{m x}}{2 \, m \log \left (a\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+a^(m*x))^2,x, algorithm="giac")

[Out]

1/2*(2*m*x*log(abs(a)) + a^(2*m*x) + 4*a^(m*x))/(m*log(a))