\(\int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx\) [161]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 105 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=-\frac {(a+b)^3 \log (1-\sin (c+d x))}{2 d}-\frac {(a-b)^3 \log (1+\sin (c+d x))}{2 d}-\frac {b \left (3 a^2+b^2\right ) \sin (c+d x)}{d}-\frac {3 a b^2 \sin ^2(c+d x)}{2 d}-\frac {b^3 \sin ^3(c+d x)}{3 d} \] Output:

-1/2*(a+b)^3*ln(1-sin(d*x+c))/d-1/2*(a-b)^3*ln(1+sin(d*x+c))/d-b*(3*a^2+b^ 
2)*sin(d*x+c)/d-3/2*a*b^2*sin(d*x+c)^2/d-1/3*b^3*sin(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.86 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=-\frac {3 \left ((a+b)^3 \log (1-\sin (c+d x))+(a-b)^3 \log (1+\sin (c+d x))\right )+6 b \left (3 a^2+b^2\right ) \sin (c+d x)+9 a b^2 \sin ^2(c+d x)+2 b^3 \sin ^3(c+d x)}{6 d} \] Input:

Integrate[(a + b*Sin[c + d*x])^3*Tan[c + d*x],x]
 

Output:

-1/6*(3*((a + b)^3*Log[1 - Sin[c + d*x]] + (a - b)^3*Log[1 + Sin[c + d*x]] 
) + 6*b*(3*a^2 + b^2)*Sin[c + d*x] + 9*a*b^2*Sin[c + d*x]^2 + 2*b^3*Sin[c 
+ d*x]^3)/d
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3042, 3200, 525, 25, 2333, 2009}

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 (c+d x) (a+b \sin (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (c+d x) (a+b \sin (c+d x))^3dx\)

\(\Big \downarrow \) 3200

\(\displaystyle \frac {\int \frac {b \sin (c+d x) (a+b \sin (c+d x))^3}{b^2-b^2 \sin ^2(c+d x)}d(b \sin (c+d x))}{d}\)

\(\Big \downarrow \) 525

\(\displaystyle \frac {-\int -\frac {b \sin (c+d x) \left (a^3+3 b^2 \sin ^2(c+d x) a+b \left (3 a^2+b^2\right ) \sin (c+d x)\right )}{b^2-b^2 \sin ^2(c+d x)}d(b \sin (c+d x))-\frac {1}{3} b^3 \sin ^3(c+d x)}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \frac {b \sin (c+d x) \left (a^3+3 b^2 \sin ^2(c+d x) a+b \left (3 a^2+b^2\right ) \sin (c+d x)\right )}{b^2-b^2 \sin ^2(c+d x)}d(b \sin (c+d x))-\frac {1}{3} b^3 \sin ^3(c+d x)}{d}\)

\(\Big \downarrow \) 2333

\(\displaystyle \frac {\int \left (-3 a^2-3 b \sin (c+d x) a-b^2+\frac {b^4+3 a^2 b^2+a \left (a^2+3 b^2\right ) \sin (c+d x) b}{b^2-b^2 \sin ^2(c+d x)}\right )d(b \sin (c+d x))-\frac {1}{3} b^3 \sin ^3(c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b \left (3 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))-b \left (3 a^2+b^2\right ) \sin (c+d x)-\frac {1}{2} a \left (a^2+3 b^2\right ) \log \left (b^2-b^2 \sin ^2(c+d x)\right )-\frac {3}{2} a b^2 \sin ^2(c+d x)-\frac {1}{3} b^3 \sin ^3(c+d x)}{d}\)

Input:

Int[(a + b*Sin[c + d*x])^3*Tan[c + d*x],x]
 

Output:

(b*(3*a^2 + b^2)*ArcTanh[Sin[c + d*x]] - (a*(a^2 + 3*b^2)*Log[b^2 - b^2*Si 
n[c + d*x]^2])/2 - b*(3*a^2 + b^2)*Sin[c + d*x] - (3*a*b^2*Sin[c + d*x]^2) 
/2 - (b^3*Sin[c + d*x]^3)/3)/d
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 525
Int[((x_)^(m_.)*((c_) + (d_.)*(x_))^(n_))/((a_) + (b_.)*(x_)^2), x_Symbol] 
:> Simp[d^n*(x^(m + n - 1)/(b*(m + n - 1))), x] + Simp[1/b   Int[x^m*(Expan 
dToSum[b*(c + d*x)^n - b*d^n*x^n - a*d^n*x^(n - 2), x]/(a + b*x^2)), x], x] 
 /; FreeQ[{a, b, c, d}, x] && IGtQ[n, 1] && IGtQ[m, -2] && NeQ[m + n - 1, 0 
]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2333
Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ 
ExpandIntegrand[(c*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] 
&& PolyQ[Pq, x] && IGtQ[p, -2]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3200
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p 
_.), x_Symbol] :> Simp[1/f   Subst[Int[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b 
^2, 0] && IntegerQ[(p + 1)/2]
 
Maple [A] (verified)

Time = 3.46 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.05

method result size
derivativedivides \(\frac {-a^{3} \ln \left (\cos \left (d x +c \right )\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{3} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(110\)
default \(\frac {-a^{3} \ln \left (\cos \left (d x +c \right )\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{3} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(110\)
parts \(\frac {a^{3} \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}+\frac {b^{3} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}+\frac {3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}+\frac {3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(122\)
risch \(\frac {3 i b \,{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}+\frac {2 i a^{3} c}{d}-\frac {5 i b^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}-\frac {3 i b \,{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}+\frac {6 i a \,b^{2} c}{d}+i a^{3} x +3 i a \,b^{2} x +\frac {5 i b^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2} b}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a \,b^{2}}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{3}}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2} b}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a \,b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{3}}{d}+\frac {b^{3} \sin \left (3 d x +3 c \right )}{12 d}+\frac {3 a \,b^{2} \cos \left (2 d x +2 c \right )}{4 d}\) \(318\)

Input:

int((a+b*sin(d*x+c))^3*tan(d*x+c),x,method=_RETURNVERBOSE)
 

Output:

1/d*(-a^3*ln(cos(d*x+c))+3*a^2*b*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+3 
*a*b^2*(-1/2*sin(d*x+c)^2-ln(cos(d*x+c)))+b^3*(-1/3*sin(d*x+c)^3-sin(d*x+c 
)+ln(sec(d*x+c)+tan(d*x+c))))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.10 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=\frac {9 \, a b^{2} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (b^{3} \cos \left (d x + c\right )^{2} - 9 \, a^{2} b - 4 \, b^{3}\right )} \sin \left (d x + c\right )}{6 \, d} \] Input:

integrate((a+b*sin(d*x+c))^3*tan(d*x+c),x, algorithm="fricas")
 

Output:

1/6*(9*a*b^2*cos(d*x + c)^2 - 3*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*log(sin(d* 
x + c) + 1) - 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*log(-sin(d*x + c) + 1) + 2 
*(b^3*cos(d*x + c)^2 - 9*a^2*b - 4*b^3)*sin(d*x + c))/d
 

Sympy [F]

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

integrate((a+b*sin(d*x+c))**3*tan(d*x+c),x)
 

Output:

Integral((a + b*sin(c + d*x))**3*tan(c + d*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.08 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=-\frac {2 \, b^{3} \sin \left (d x + c\right )^{3} + 9 \, a b^{2} \sin \left (d x + c\right )^{2} + 3 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \, {\left (3 \, a^{2} b + b^{3}\right )} \sin \left (d x + c\right )}{6 \, d} \] Input:

integrate((a+b*sin(d*x+c))^3*tan(d*x+c),x, algorithm="maxima")
 

Output:

-1/6*(2*b^3*sin(d*x + c)^3 + 9*a*b^2*sin(d*x + c)^2 + 3*(a^3 - 3*a^2*b + 3 
*a*b^2 - b^3)*log(sin(d*x + c) + 1) + 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*lo 
g(sin(d*x + c) - 1) + 6*(3*a^2*b + b^3)*sin(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.32 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=-\frac {{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{2 \, d} - \frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{2 \, d} - \frac {2 \, b^{3} d^{2} \sin \left (d x + c\right )^{3} + 9 \, a b^{2} d^{2} \sin \left (d x + c\right )^{2} + 18 \, a^{2} b d^{2} \sin \left (d x + c\right ) + 6 \, b^{3} d^{2} \sin \left (d x + c\right )}{6 \, d^{3}} \] Input:

integrate((a+b*sin(d*x+c))^3*tan(d*x+c),x, algorithm="giac")
 

Output:

-1/2*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*log(abs(sin(d*x + c) + 1))/d - 1/2*(a 
^3 + 3*a^2*b + 3*a*b^2 + b^3)*log(abs(sin(d*x + c) - 1))/d - 1/6*(2*b^3*d^ 
2*sin(d*x + c)^3 + 9*a*b^2*d^2*sin(d*x + c)^2 + 18*a^2*b*d^2*sin(d*x + c) 
+ 6*b^3*d^2*sin(d*x + c))/d^3
 

Mupad [B] (verification not implemented)

Time = 17.50 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.15 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^3+3\,a\,b^2\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2\,b+2\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (6\,a^2\,b+2\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (12\,a^2\,b+\frac {20\,b^3}{3}\right )+6\,a\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+6\,a\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,{\left (a-b\right )}^3}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left (a+b\right )}^3}{d} \] Input:

int(tan(c + d*x)*(a + b*sin(c + d*x))^3,x)
 

Output:

(log(tan(c/2 + (d*x)/2)^2 + 1)*(3*a*b^2 + a^3))/d - (tan(c/2 + (d*x)/2)*(6 
*a^2*b + 2*b^3) + tan(c/2 + (d*x)/2)^5*(6*a^2*b + 2*b^3) + tan(c/2 + (d*x) 
/2)^3*(12*a^2*b + (20*b^3)/3) + 6*a*b^2*tan(c/2 + (d*x)/2)^2 + 6*a*b^2*tan 
(c/2 + (d*x)/2)^4)/(d*(3*tan(c/2 + (d*x)/2)^2 + 3*tan(c/2 + (d*x)/2)^4 + t 
an(c/2 + (d*x)/2)^6 + 1)) - (log(tan(c/2 + (d*x)/2) + 1)*(a - b)^3)/d - (l 
og(tan(c/2 + (d*x)/2) - 1)*(a + b)^3)/d
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.89 \[ \int (a+b \sin (c+d x))^3 \tan (c+d x) \, dx=\frac {3 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a^{3}+18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a \,b^{2}-18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2} b -18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \,b^{2}-6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{3}+18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2} b -18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a \,b^{2}+6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{3}-2 \sin \left (d x +c \right )^{3} b^{3}-9 \sin \left (d x +c \right )^{2} a \,b^{2}-18 \sin \left (d x +c \right ) a^{2} b -6 \sin \left (d x +c \right ) b^{3}}{6 d} \] Input:

int((a+b*sin(d*x+c))^3*tan(d*x+c),x)
 

Output:

(3*log(tan(c + d*x)**2 + 1)*a**3 + 18*log(tan((c + d*x)/2)**2 + 1)*a*b**2 
- 18*log(tan((c + d*x)/2) - 1)*a**2*b - 18*log(tan((c + d*x)/2) - 1)*a*b** 
2 - 6*log(tan((c + d*x)/2) - 1)*b**3 + 18*log(tan((c + d*x)/2) + 1)*a**2*b 
 - 18*log(tan((c + d*x)/2) + 1)*a*b**2 + 6*log(tan((c + d*x)/2) + 1)*b**3 
- 2*sin(c + d*x)**3*b**3 - 9*sin(c + d*x)**2*a*b**2 - 18*sin(c + d*x)*a**2 
*b - 6*sin(c + d*x)*b**3)/(6*d)