\(\int (e x)^m \tanh ^2(d (a+b \log (c x^n))) \, dx\) [190]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 169 \[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {(1+m+b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {(e x)^{1+m} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n \left (1+e^{2 a d} \left (c x^n\right )^{2 b d}\right )}-\frac {2 (e x)^{1+m} \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2 b d n},1+\frac {1+m}{2 b d n},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n} \]

[Out]

(b*d*n+m+1)*(e*x)^(1+m)/b/d/e/(1+m)/n+(e*x)^(1+m)*(1-exp(2*a*d)*(c*x^n)^(2*b*d))/b/d/e/n/(1+exp(2*a*d)*(c*x^n)
^(2*b*d))-2*(e*x)^(1+m)*hypergeom([1, 1/2*(1+m)/b/d/n],[1+1/2*(1+m)/b/d/n],-exp(2*a*d)*(c*x^n)^(2*b*d))/b/d/e/
n

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {5658, 5656, 516, 470, 371} \[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-\frac {2 (e x)^{m+1} \operatorname {Hypergeometric2F1}\left (1,\frac {m+1}{2 b d n},\frac {m+1}{2 b d n}+1,-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n}+\frac {(e x)^{m+1} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n \left (e^{2 a d} \left (c x^n\right )^{2 b d}+1\right )}+\frac {(e x)^{m+1} (b d n+m+1)}{b d e (m+1) n} \]

[In]

Int[(e*x)^m*Tanh[d*(a + b*Log[c*x^n])]^2,x]

[Out]

((1 + m + b*d*n)*(e*x)^(1 + m))/(b*d*e*(1 + m)*n) + ((e*x)^(1 + m)*(1 - E^(2*a*d)*(c*x^n)^(2*b*d)))/(b*d*e*n*(
1 + E^(2*a*d)*(c*x^n)^(2*b*d))) - (2*(e*x)^(1 + m)*Hypergeometric2F1[1, (1 + m)/(2*b*d*n), 1 + (1 + m)/(2*b*d*
n), -(E^(2*a*d)*(c*x^n)^(2*b*d))])/(b*d*e*n)

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 516

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-(c*b -
 a*d))*(e*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q - 1)/(a*b*e*n*(p + 1))), x] + Dist[1/(a*b*n*(p + 1)),
 Int[(e*x)^m*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q - 2)*Simp[c*(c*b*n*(p + 1) + (c*b - a*d)*(m + 1)) + d*(c*b*n*(
p + 1) + (c*b - a*d)*(m + n*(q - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d,
 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 5656

Int[((e_.)*(x_))^(m_.)*Tanh[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[(e*x)^m*((-1 + E^(2*a*d)*x^
(2*b*d))^p/(1 + E^(2*a*d)*x^(2*b*d))^p), x] /; FreeQ[{a, b, d, e, m, p}, x]

Rule 5658

Int[((e_.)*(x_))^(m_.)*Tanh[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[(e*x)^(m + 1
)/(e*n*(c*x^n)^((m + 1)/n)), Subst[Int[x^((m + 1)/n - 1)*Tanh[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[
{a, b, c, d, e, m, n, p}, x] && (NeQ[c, 1] || NeQ[n, 1])

Rubi steps \begin{align*} \text {integral}& = \frac {\left ((e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int x^{-1+\frac {1+m}{n}} \tanh ^2(d (a+b \log (x))) \, dx,x,c x^n\right )}{e n} \\ & = \frac {\left ((e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}} \left (-1+e^{2 a d} x^{2 b d}\right )^2}{\left (1+e^{2 a d} x^{2 b d}\right )^2} \, dx,x,c x^n\right )}{e n} \\ & = \frac {(e x)^{1+m} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n \left (1+e^{2 a d} \left (c x^n\right )^{2 b d}\right )}-\frac {\left (e^{-2 a d} (e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}} \left (\frac {2 e^{2 a d} (1+m-b d n)}{n}-\frac {2 e^{4 a d} (1+m+b d n) x^{2 b d}}{n}\right )}{1+e^{2 a d} x^{2 b d}} \, dx,x,c x^n\right )}{2 b d e n} \\ & = \frac {(1+m+b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {(e x)^{1+m} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n \left (1+e^{2 a d} \left (c x^n\right )^{2 b d}\right )}-\frac {\left (2 (1+m) (e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}}}{1+e^{2 a d} x^{2 b d}} \, dx,x,c x^n\right )}{b d e n^2} \\ & = \frac {(1+m+b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {(e x)^{1+m} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n \left (1+e^{2 a d} \left (c x^n\right )^{2 b d}\right )}-\frac {2 (e x)^{1+m} \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2 b d n},1+\frac {1+m}{2 b d n},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{b d e n} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(516\) vs. \(2(169)=338\).

Time = 16.97 (sec) , antiderivative size = 516, normalized size of antiderivative = 3.05 \[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {x (e x)^m}{1+m}-\frac {x (e x)^m \text {sech}\left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \text {sech}\left (b d n \log (x)+d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \sinh (b d n \log (x))}{b d n}+\frac {(1+m) x^{-m} (e x)^m \text {sech}\left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \left (\frac {x^{1+m} \text {sech}\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \sinh (b d n \log (x))}{1+m}-\frac {e^{-\frac {(1+2 m) \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )}{b n}} \cosh \left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \left (e^{\frac {a+2 a m+b (1+m) n \log (x)+b (1+2 m) \left (-n \log (x)+\log \left (c x^n\right )\right )}{b n}} (1+m+2 b d n) \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2 b d n},1+\frac {1+m}{2 b d n},-e^{2 d \left (a+b \log \left (c x^n\right )\right )}\right )-e^{\frac {a (1+2 m+2 b d n)}{b n}+(1+m+2 b d n) \log (x)+\frac {(1+2 m+2 b d n) \left (-n \log (x)+\log \left (c x^n\right )\right )}{n}} (1+m) \operatorname {Hypergeometric2F1}\left (1,\frac {1+m+2 b d n}{2 b d n},\frac {1+m+4 b d n}{2 b d n},-e^{2 d \left (a+b \log \left (c x^n\right )\right )}\right )+e^{\frac {a+2 a m+b (1+m) n \log (x)+b (1+2 m) \left (-n \log (x)+\log \left (c x^n\right )\right )}{b n}} (1+m+2 b d n) \tanh \left (d \left (a+b \log \left (c x^n\right )\right )\right )\right )}{(1+m) (1+m+2 b d n)}\right )}{b d n} \]

[In]

Integrate[(e*x)^m*Tanh[d*(a + b*Log[c*x^n])]^2,x]

[Out]

(x*(e*x)^m)/(1 + m) - (x*(e*x)^m*Sech[d*(a + b*(-(n*Log[x]) + Log[c*x^n]))]*Sech[b*d*n*Log[x] + d*(a + b*(-(n*
Log[x]) + Log[c*x^n]))]*Sinh[b*d*n*Log[x]])/(b*d*n) + ((1 + m)*(e*x)^m*Sech[d*(a + b*(-(n*Log[x]) + Log[c*x^n]
))]*((x^(1 + m)*Sech[d*(a + b*Log[c*x^n])]*Sinh[b*d*n*Log[x]])/(1 + m) - (Cosh[d*(a + b*(-(n*Log[x]) + Log[c*x
^n]))]*(E^((a + 2*a*m + b*(1 + m)*n*Log[x] + b*(1 + 2*m)*(-(n*Log[x]) + Log[c*x^n]))/(b*n))*(1 + m + 2*b*d*n)*
Hypergeometric2F1[1, (1 + m)/(2*b*d*n), 1 + (1 + m)/(2*b*d*n), -E^(2*d*(a + b*Log[c*x^n]))] - E^((a*(1 + 2*m +
 2*b*d*n))/(b*n) + (1 + m + 2*b*d*n)*Log[x] + ((1 + 2*m + 2*b*d*n)*(-(n*Log[x]) + Log[c*x^n]))/n)*(1 + m)*Hype
rgeometric2F1[1, (1 + m + 2*b*d*n)/(2*b*d*n), (1 + m + 4*b*d*n)/(2*b*d*n), -E^(2*d*(a + b*Log[c*x^n]))] + E^((
a + 2*a*m + b*(1 + m)*n*Log[x] + b*(1 + 2*m)*(-(n*Log[x]) + Log[c*x^n]))/(b*n))*(1 + m + 2*b*d*n)*Tanh[d*(a +
b*Log[c*x^n])]))/(E^(((1 + 2*m)*(a + b*(-(n*Log[x]) + Log[c*x^n])))/(b*n))*(1 + m)*(1 + m + 2*b*d*n))))/(b*d*n
*x^m)

Maple [F]

\[\int \left (e x \right )^{m} {\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}^{2}d x\]

[In]

int((e*x)^m*tanh(d*(a+b*ln(c*x^n)))^2,x)

[Out]

int((e*x)^m*tanh(d*(a+b*ln(c*x^n)))^2,x)

Fricas [F]

\[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \left (e x\right )^{m} \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{2} \,d x } \]

[In]

integrate((e*x)^m*tanh(d*(a+b*log(c*x^n)))^2,x, algorithm="fricas")

[Out]

integral((e*x)^m*tanh(b*d*log(c*x^n) + a*d)^2, x)

Sympy [F]

\[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int \left (e x\right )^{m} \tanh ^{2}{\left (a d + b d \log {\left (c x^{n} \right )} \right )}\, dx \]

[In]

integrate((e*x)**m*tanh(d*(a+b*ln(c*x**n)))**2,x)

[Out]

Integral((e*x)**m*tanh(a*d + b*d*log(c*x**n))**2, x)

Maxima [F]

\[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \left (e x\right )^{m} \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{2} \,d x } \]

[In]

integrate((e*x)^m*tanh(d*(a+b*log(c*x^n)))^2,x, algorithm="maxima")

[Out]

-2*e^m*(m + 1)*integrate(x^m/(b*c^(2*b*d)*d*n*e^(2*b*d*log(x^n) + 2*a*d) + b*d*n), x) + (b*c^(2*b*d)*d*e^m*n*x
*e^(2*b*d*log(x^n) + 2*a*d + m*log(x)) + (b*d*e^m*n + 2*e^m*(m + 1))*x*x^m)/((m*n + n)*b*c^(2*b*d)*d*e^(2*b*d*
log(x^n) + 2*a*d) + (m*n + n)*b*d)

Giac [F]

\[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \left (e x\right )^{m} \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{2} \,d x } \]

[In]

integrate((e*x)^m*tanh(d*(a+b*log(c*x^n)))^2,x, algorithm="giac")

[Out]

integrate((e*x)^m*tanh((b*log(c*x^n) + a)*d)^2, x)

Mupad [F(-1)]

Timed out. \[ \int (e x)^m \tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int {\mathrm {tanh}\left (d\,\left (a+b\,\ln \left (c\,x^n\right )\right )\right )}^2\,{\left (e\,x\right )}^m \,d x \]

[In]

int(tanh(d*(a + b*log(c*x^n)))^2*(e*x)^m,x)

[Out]

int(tanh(d*(a + b*log(c*x^n)))^2*(e*x)^m, x)