3.247 \(\int \sec (c+d x) (a \sin (c+d x)+b \tan (c+d x))^3 \, dx\)

Optimal. Leaf size=115 \[ \frac {a^3 \cos ^2(c+d x)}{2 d}+\frac {b \left (3 a^2-b^2\right ) \sec (c+d x)}{d}-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {3 a b^2 \sec ^2(c+d x)}{2 d}+\frac {b^3 \sec ^3(c+d x)}{3 d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.24, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4397, 2837, 12, 894} \[ \frac {b \left (3 a^2-b^2\right ) \sec (c+d x)}{d}-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {a^3 \cos ^2(c+d x)}{2 d}+\frac {3 a b^2 \sec ^2(c+d x)}{2 d}+\frac {b^3 \sec ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*a^2*b*Cos[c + d*x])/d + (a^3*Cos[c + d*x]^2)/(2*d) - (a*(a^2 - 3*b^2)*Log[Cos[c + d*x]])/d + (b*(3*a^2 - b^
2)*Sec[c + d*x])/d + (3*a*b^2*Sec[c + d*x]^2)/(2*d) + (b^3*Sec[c + d*x]^3)/(3*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2837

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

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps

\begin {align*} \int \sec (c+d x) (a \sin (c+d x)+b \tan (c+d x))^3 \, dx &=\int (b+a \cos (c+d x))^3 \sec (c+d x) \tan ^3(c+d x) \, dx\\ &=-\frac {\operatorname {Subst}\left (\int \frac {a^4 (b+x)^3 \left (a^2-x^2\right )}{x^4} \, dx,x,a \cos (c+d x)\right )}{a^3 d}\\ &=-\frac {a \operatorname {Subst}\left (\int \frac {(b+x)^3 \left (a^2-x^2\right )}{x^4} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {a \operatorname {Subst}\left (\int \left (-3 b+\frac {a^2 b^3}{x^4}+\frac {3 a^2 b^2}{x^3}+\frac {3 a^2 b-b^3}{x^2}+\frac {a^2-3 b^2}{x}-x\right ) \, dx,x,a \cos (c+d x)\right )}{d}\\ &=\frac {3 a^2 b \cos (c+d x)}{d}+\frac {a^3 \cos ^2(c+d x)}{2 d}-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac {b \left (3 a^2-b^2\right ) \sec (c+d x)}{d}+\frac {3 a b^2 \sec ^2(c+d x)}{2 d}+\frac {b^3 \sec ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.51, size = 100, normalized size = 0.87 \[ \frac {3 a^3 \cos (2 (c+d x))+2 \left (-6 b \left (b^2-3 a^2\right ) \sec (c+d x)-6 a \left (a^2-3 b^2\right ) \log (\cos (c+d x))+9 a b^2 \sec ^2(c+d x)+2 b^3 \sec ^3(c+d x)\right )+36 a^2 b \cos (c+d x)}{12 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(36*a^2*b*Cos[c + d*x] + 3*a^3*Cos[2*(c + d*x)] + 2*(-6*a*(a^2 - 3*b^2)*Log[Cos[c + d*x]] - 6*b*(-3*a^2 + b^2)
*Sec[c + d*x] + 9*a*b^2*Sec[c + d*x]^2 + 2*b^3*Sec[c + d*x]^3))/(12*d)

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 122, normalized size = 1.06 \[ \frac {6 \, a^{3} \cos \left (d x + c\right )^{5} + 36 \, a^{2} b \cos \left (d x + c\right )^{4} - 3 \, a^{3} \cos \left (d x + c\right )^{3} - 12 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\cos \left (d x + c\right )\right ) + 18 \, a b^{2} \cos \left (d x + c\right ) + 4 \, b^{3} + 12 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2}}{12 \, d \cos \left (d x + c\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*(6*a^3*cos(d*x + c)^5 + 36*a^2*b*cos(d*x + c)^4 - 3*a^3*cos(d*x + c)^3 - 12*(a^3 - 3*a*b^2)*cos(d*x + c)^
3*log(-cos(d*x + c)) + 18*a*b^2*cos(d*x + c) + 4*b^3 + 12*(3*a^2*b - b^3)*cos(d*x + c)^2)/(d*cos(d*x + c)^3)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Modg
cd: no suitable evaluation pointindex.cc index_m operator + Error: Bad Argument ValueUnable to check sign: (2*
pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sig
n: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to che
ck sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable
to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)U
nable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nost
ep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/
t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(
-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_noste
p/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t
_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (
2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check s
ign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to c
heck sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Evaluation time: 61.28Done

________________________________________________________________________________________

maple [A]  time = 0.11, size = 213, normalized size = 1.85 \[ -\frac {a^{3} \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a^{3} \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {3 a^{2} b \left (\sin ^{4}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )}+\frac {3 \cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) a^{2} b}{d}+\frac {6 a^{2} b \cos \left (d x +c \right )}{d}+\frac {3 a \,b^{2} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {3 a \,b^{2} \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{3 d \cos \left (d x +c \right )^{3}}-\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{3 d \cos \left (d x +c \right )}-\frac {b^{3} \cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right )}{3 d}-\frac {2 b^{3} \cos \left (d x +c \right )}{3 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 109, normalized size = 0.95 \[ -\frac {3 \, {\left (\sin \left (d x + c\right )^{2} + \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} a^{3} + 9 \, a b^{2} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} - 18 \, a^{2} b {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + \frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} b^{3}}{\cos \left (d x + c\right )^{3}}}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 4.45, size = 219, normalized size = 1.90 \[ \frac {2\,a^3\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )-6\,a\,b^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (-2\,a^3-12\,a^2\,b+6\,a\,b^2+\frac {4\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (6\,a^3-12\,a^2\,b+6\,a\,b^2-4\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (6\,a^3-12\,a^2\,b+6\,a\,b^2+\frac {20\,b^3}{3}\right )+12\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (6\,a\,b^2-2\,a^3\right )-\frac {4\,b^3}{3}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}^3\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*a^3*atanh(tan(c/2 + (d*x)/2)^2) - 6*a*b^2*atanh(tan(c/2 + (d*x)/2)^2))/d - (tan(c/2 + (d*x)/2)^2*(6*a*b^2 -
 12*a^2*b - 2*a^3 + (4*b^3)/3) - tan(c/2 + (d*x)/2)^6*(6*a*b^2 - 12*a^2*b + 6*a^3 - 4*b^3) + tan(c/2 + (d*x)/2
)^4*(6*a*b^2 - 12*a^2*b + 6*a^3 + (20*b^3)/3) + 12*a^2*b - tan(c/2 + (d*x)/2)^8*(6*a*b^2 - 2*a^3) - (4*b^3)/3)
/(d*(tan(c/2 + (d*x)/2)^2 - 1)^3*(tan(c/2 + (d*x)/2)^2 + 1)^2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{3} \sec {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________