\(\int \tanh ^p(d (a+b \log (c x^n))) \, dx\) [202]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 15, antiderivative size = 115 \[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=x \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )^{-p} \left (-1+e^{2 a d} \left (c x^n\right )^{2 b d}\right )^p \operatorname {AppellF1}\left (\frac {1}{2 b d n},-p,p,1+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right ) \] Output:

x*(-1+exp(2*a*d)*(c*x^n)^(2*b*d))^p*AppellF1(1/2/b/d/n,-p,p,1+1/2/b/d/n,ex 
p(2*a*d)*(c*x^n)^(2*b*d),-exp(2*a*d)*(c*x^n)^(2*b*d))/((1-exp(2*a*d)*(c*x^ 
n)^(2*b*d))^p)
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(387\) vs. \(2(115)=230\).

Time = 0.88 (sec) , antiderivative size = 387, normalized size of antiderivative = 3.37 \[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {(1+2 b d n) x \left (\frac {-1+e^{2 a d} \left (c x^n\right )^{2 b d}}{1+e^{2 a d} \left (c x^n\right )^{2 b d}}\right )^p \operatorname {AppellF1}\left (\frac {1}{2 b d n},-p,p,1+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )}{-2 b d e^{2 a d} n p \left (c x^n\right )^{2 b d} \operatorname {AppellF1}\left (1+\frac {1}{2 b d n},1-p,p,2+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )-2 b d e^{2 a d} n p \left (c x^n\right )^{2 b d} \operatorname {AppellF1}\left (1+\frac {1}{2 b d n},-p,1+p,2+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )+(1+2 b d n) \operatorname {AppellF1}\left (\frac {1}{2 b d n},-p,p,1+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )} \] Input:

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

Output:

((1 + 2*b*d*n)*x*((-1 + E^(2*a*d)*(c*x^n)^(2*b*d))/(1 + E^(2*a*d)*(c*x^n)^ 
(2*b*d)))^p*AppellF1[1/(2*b*d*n), -p, p, 1 + 1/(2*b*d*n), E^(2*a*d)*(c*x^n 
)^(2*b*d), -(E^(2*a*d)*(c*x^n)^(2*b*d))])/(-2*b*d*E^(2*a*d)*n*p*(c*x^n)^(2 
*b*d)*AppellF1[1 + 1/(2*b*d*n), 1 - p, p, 2 + 1/(2*b*d*n), E^(2*a*d)*(c*x^ 
n)^(2*b*d), -(E^(2*a*d)*(c*x^n)^(2*b*d))] - 2*b*d*E^(2*a*d)*n*p*(c*x^n)^(2 
*b*d)*AppellF1[1 + 1/(2*b*d*n), -p, 1 + p, 2 + 1/(2*b*d*n), E^(2*a*d)*(c*x 
^n)^(2*b*d), -(E^(2*a*d)*(c*x^n)^(2*b*d))] + (1 + 2*b*d*n)*AppellF1[1/(2*b 
*d*n), -p, p, 1 + 1/(2*b*d*n), E^(2*a*d)*(c*x^n)^(2*b*d), -(E^(2*a*d)*(c*x 
^n)^(2*b*d))])
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {6069, 6071, 1013, 1012}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx\)

\(\Big \downarrow \) 6069

\(\displaystyle \frac {x \left (c x^n\right )^{-1/n} \int \left (c x^n\right )^{\frac {1}{n}-1} \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right )d\left (c x^n\right )}{n}\)

\(\Big \downarrow \) 6071

\(\displaystyle \frac {x \left (c x^n\right )^{-1/n} \int \left (c x^n\right )^{\frac {1}{n}-1} \left (e^{2 a d} \left (c x^n\right )^{2 b d}-1\right )^p \left (e^{2 a d} \left (c x^n\right )^{2 b d}+1\right )^{-p}d\left (c x^n\right )}{n}\)

\(\Big \downarrow \) 1013

\(\displaystyle \frac {x \left (c x^n\right )^{-1/n} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )^{-p} \left (e^{2 a d} \left (c x^n\right )^{2 b d}-1\right )^p \int \left (c x^n\right )^{\frac {1}{n}-1} \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )^p \left (e^{2 a d} \left (c x^n\right )^{2 b d}+1\right )^{-p}d\left (c x^n\right )}{n}\)

\(\Big \downarrow \) 1012

\(\displaystyle x \left (1-e^{2 a d} \left (c x^n\right )^{2 b d}\right )^{-p} \left (e^{2 a d} \left (c x^n\right )^{2 b d}-1\right )^p \operatorname {AppellF1}\left (\frac {1}{2 b d n},-p,p,1+\frac {1}{2 b d n},e^{2 a d} \left (c x^n\right )^{2 b d},-e^{2 a d} \left (c x^n\right )^{2 b d}\right )\)

Input:

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

Output:

(x*(-1 + E^(2*a*d)*(c*x^n)^(2*b*d))^p*AppellF1[1/(2*b*d*n), -p, p, 1 + 1/( 
2*b*d*n), E^(2*a*d)*(c*x^n)^(2*b*d), -(E^(2*a*d)*(c*x^n)^(2*b*d))])/(1 - E 
^(2*a*d)*(c*x^n)^(2*b*d))^p
 

Defintions of rubi rules used

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

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

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

rule 6071
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]
 
Maple [F]

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

Input:

int(tanh(d*(a+b*ln(c*x^n)))^p,x)
 

Output:

int(tanh(d*(a+b*ln(c*x^n)))^p,x)
 

Fricas [F]

\[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{p} \,d x } \] Input:

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

Output:

integral(tanh(b*d*log(c*x^n) + a*d)^p, x)
 

Sympy [F]

\[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int \tanh ^{p}{\left (d \left (a + b \log {\left (c x^{n} \right )}\right ) \right )}\, dx \] Input:

integrate(tanh(d*(a+b*ln(c*x**n)))**p,x)
 

Output:

Integral(tanh(d*(a + b*log(c*x**n)))**p, x)
 

Maxima [F]

\[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{p} \,d x } \] Input:

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

Output:

integrate(tanh((b*log(c*x^n) + a)*d)^p, x)
 

Giac [F]

\[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \tanh \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{p} \,d x } \] Input:

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

Output:

integrate(tanh((b*log(c*x^n) + a)*d)^p, x)
 

Mupad [F(-1)]

Timed out. \[ \int \tanh ^p\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 )}^p \,d x \] Input:

int(tanh(d*(a + b*log(c*x^n)))^p,x)
 

Output:

int(tanh(d*(a + b*log(c*x^n)))^p, x)
 

Reduce [F]

\[ \int \tanh ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx={\tanh \left (\mathrm {log}\left (x^{n} c \right ) b d +a d \right )}^{p} x -\left (\int \frac {{\tanh \left (\mathrm {log}\left (x^{n} c \right ) b d +a d \right )}^{p}}{\tanh \left (\mathrm {log}\left (x^{n} c \right ) b d +a d \right )}d x \right ) b d n p +\left (\int {\tanh \left (\mathrm {log}\left (x^{n} c \right ) b d +a d \right )}^{p} \tanh \left (\mathrm {log}\left (x^{n} c \right ) b d +a d \right )d x \right ) b d n p \] Input:

int(tanh(d*(a+b*log(c*x^n)))^p,x)
 

Output:

tanh(log(x**n*c)*b*d + a*d)**p*x - int(tanh(log(x**n*c)*b*d + a*d)**p/tanh 
(log(x**n*c)*b*d + a*d),x)*b*d*n*p + int(tanh(log(x**n*c)*b*d + a*d)**p*ta 
nh(log(x**n*c)*b*d + a*d),x)*b*d*n*p