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

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

Optimal result

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

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

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(458\) vs. \(2(190)=380\).

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

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

Output:

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

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 190, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5004, 5006, 2058, 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 \tan ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx\)

\(\Big \downarrow \) 5004

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

\(\Big \downarrow \) 5006

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

\(\Big \downarrow \) 2058

\(\displaystyle \frac {x \left (c x^n\right )^{-1/n} \left (i-i e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )^{-p} \left (\frac {i \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{1+e^{2 i a d} \left (c x^n\right )^{2 i b d}}\right )^p \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )^p \int \left (c x^n\right )^{\frac {1}{n}-1} \left (i-i e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )^p \left (e^{2 i a d} \left (c x^n\right )^{2 i 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 i a d} \left (c x^n\right )^{2 i b d}\right )^{-p} \left (\frac {i \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{1+e^{2 i a d} \left (c x^n\right )^{2 i b d}}\right )^p \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )^p \int \left (c x^n\right )^{\frac {1}{n}-1} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )^p \left (e^{2 i a d} \left (c x^n\right )^{2 i b d}+1\right )^{-p}d\left (c x^n\right )}{n}\)

\(\Big \downarrow \) 1012

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

Input:

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

Output:

(x*((I*(1 - E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d)))/(1 + E^((2*I)*a*d)*(c*x^n) 
^((2*I)*b*d)))^p*(1 + E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d))^p*AppellF1[(-1/2* 
I)/(b*d*n), -p, p, 1 - (I/2)/(b*d*n), E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d), - 
(E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d))])/(1 - E^((2*I)*a*d)*(c*x^n)^((2*I)*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 2058
Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))^(q_.)*((c_) + (d_.)*(x_)^(n_))^ 
(r_.))^(p_), x_Symbol] :> Simp[Simp[(e*(a + b*x^n)^q*(c + d*x^n)^r)^p/((a + 
 b*x^n)^(p*q)*(c + d*x^n)^(p*r))]   Int[u*(a + b*x^n)^(p*q)*(c + d*x^n)^(p* 
r), x], x] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x]
 

rule 5004
Int[Tan[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Si 
mp[x/(n*(c*x^n)^(1/n))   Subst[Int[x^(1/n - 1)*Tan[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 5006
Int[((e_.)*(x_))^(m_.)*Tan[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] 
:> Int[(e*x)^m*((I - I*E^(2*I*a*d)*x^(2*I*b*d))/(1 + E^(2*I*a*d)*x^(2*I*b*d 
)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F(-1)]

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

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

Output:

Timed out
 

Mupad [F(-1)]

Timed out. \[ \int \tan ^p\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int {\mathrm {tan}\left (d\,\left (a+b\,\ln \left (c\,x^n\right )\right )\right )}^p \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

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