\(\int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx\) [208]

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

Optimal result

Integrand size = 31, antiderivative size = 178 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=\frac {5 a^3 \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} (c+d)^{7/2} f}+\frac {a (a+a \sec (e+f x))^2 \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}-\frac {5 a^3 (c-d) \tan (e+f x)}{6 d (c+d)^2 f (c+d \sec (e+f x))^2}+\frac {5 a^3 (c+4 d) \tan (e+f x)}{6 d (c+d)^3 f (c+d \sec (e+f x))} \] Output:

5*a^3*arctanh((c-d)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d)^(1/2))/(c-d)^(1/2)/(c+d 
)^(7/2)/f+1/3*a*(a+a*sec(f*x+e))^2*tan(f*x+e)/(c+d)/f/(c+d*sec(f*x+e))^3-5 
/6*a^3*(c-d)*tan(f*x+e)/d/(c+d)^2/f/(c+d*sec(f*x+e))^2+5/6*a^3*(c+4*d)*tan 
(f*x+e)/d/(c+d)^3/f/(c+d*sec(f*x+e))
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 3.48 (sec) , antiderivative size = 398, normalized size of antiderivative = 2.24 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=\frac {a^3 (d+c \cos (e+f x)) \sec ^6\left (\frac {1}{2} (e+f x)\right ) \sec (e+f x) (1+\sec (e+f x))^3 \left (-\frac {120 i \arctan \left (\frac {(i \cos (e)+\sin (e)) \left (c \sin (e)+(-d+c \cos (e)) \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right ) (d+c \cos (e+f x))^3 (\cos (e)-i \sin (e))}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}+\frac {c \sec (e) \left (6 \left (8 c^4+6 c^3 d+30 c^2 d^2+9 c d^3+2 d^4\right ) \sin (f x)-3 \left (6 c^4-3 c^3 d+30 c^2 d^2+18 c d^3+4 d^4\right ) \sin (2 e+f x)+c \left (3 \left (3 c^3+38 c^2 d+12 c d^2+2 d^3\right ) \sin (e+2 f x)+3 \left (3 c^3-6 c^2 d-6 c d^2-2 d^3\right ) \sin (3 e+2 f x)+c \left (22 c^2+9 c d+2 d^2\right ) \sin (2 e+3 f x)\right )\right )-2 d \left (66 c^4+27 c^3 d+50 c^2 d^2+18 c d^3+4 d^4\right ) \tan (e)}{c^3}\right )}{192 (c+d)^3 f (c+d \sec (e+f x))^4} \] Input:

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x])^4,x]
 

Output:

(a^3*(d + c*Cos[e + f*x])*Sec[(e + f*x)/2]^6*Sec[e + f*x]*(1 + Sec[e + f*x 
])^3*(((-120*I)*ArcTan[((I*Cos[e] + Sin[e])*(c*Sin[e] + (-d + c*Cos[e])*Ta 
n[(f*x)/2]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*(d + c*Cos[e + 
 f*x])^3*(Cos[e] - I*Sin[e]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2] 
) + (c*Sec[e]*(6*(8*c^4 + 6*c^3*d + 30*c^2*d^2 + 9*c*d^3 + 2*d^4)*Sin[f*x] 
 - 3*(6*c^4 - 3*c^3*d + 30*c^2*d^2 + 18*c*d^3 + 4*d^4)*Sin[2*e + f*x] + c* 
(3*(3*c^3 + 38*c^2*d + 12*c*d^2 + 2*d^3)*Sin[e + 2*f*x] + 3*(3*c^3 - 6*c^2 
*d - 6*c*d^2 - 2*d^3)*Sin[3*e + 2*f*x] + c*(22*c^2 + 9*c*d + 2*d^2)*Sin[2* 
e + 3*f*x])) - 2*d*(66*c^4 + 27*c^3*d + 50*c^2*d^2 + 18*c*d^3 + 4*d^4)*Tan 
[e])/c^3))/(192*(c + d)^3*f*(c + d*Sec[e + f*x])^4)
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.62, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3042, 4475, 105, 105, 105, 104, 218}

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 \frac {\sec (e+f x) (a \sec (e+f x)+a)^3}{(c+d \sec (e+f x))^4} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^3}{\left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )^4}dx\)

\(\Big \downarrow \) 4475

\(\displaystyle -\frac {a^2 \tan (e+f x) \int \frac {(\sec (e+f x) a+a)^{5/2}}{\sqrt {a-a \sec (e+f x)} (c+d \sec (e+f x))^4}d\sec (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 105

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {5 a \int \frac {(\sec (e+f x) a+a)^{3/2}}{\sqrt {a-a \sec (e+f x)} (c+d \sec (e+f x))^3}d\sec (e+f x)}{3 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{5/2}}{3 a (c+d) (c+d \sec (e+f x))^3}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 105

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {5 a \left (\frac {3 a \int \frac {\sqrt {\sec (e+f x) a+a}}{\sqrt {a-a \sec (e+f x)} (c+d \sec (e+f x))^2}d\sec (e+f x)}{2 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{3/2}}{2 a (c+d) (c+d \sec (e+f x))^2}\right )}{3 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{5/2}}{3 a (c+d) (c+d \sec (e+f x))^3}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 105

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {5 a \left (\frac {3 a \left (\frac {a \int \frac {1}{\sqrt {a-a \sec (e+f x)} \sqrt {\sec (e+f x) a+a} (c+d \sec (e+f x))}d\sec (e+f x)}{c+d}-\frac {\sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}{a (c+d) (c+d \sec (e+f x))}\right )}{2 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{3/2}}{2 a (c+d) (c+d \sec (e+f x))^2}\right )}{3 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{5/2}}{3 a (c+d) (c+d \sec (e+f x))^3}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 104

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {5 a \left (\frac {3 a \left (\frac {2 a \int \frac {1}{a (c-d)+\frac {a (c+d) (\sec (e+f x) a+a)}{a-a \sec (e+f x)}}d\frac {\sqrt {\sec (e+f x) a+a}}{\sqrt {a-a \sec (e+f x)}}}{c+d}-\frac {\sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}{a (c+d) (c+d \sec (e+f x))}\right )}{2 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{3/2}}{2 a (c+d) (c+d \sec (e+f x))^2}\right )}{3 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{5/2}}{3 a (c+d) (c+d \sec (e+f x))^3}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 218

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {5 a \left (\frac {3 a \left (\frac {2 \arctan \left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{\sqrt {c-d} (c+d)^{3/2}}-\frac {\sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}{a (c+d) (c+d \sec (e+f x))}\right )}{2 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{3/2}}{2 a (c+d) (c+d \sec (e+f x))^2}\right )}{3 (c+d)}-\frac {\sqrt {a-a \sec (e+f x)} (a \sec (e+f x)+a)^{5/2}}{3 a (c+d) (c+d \sec (e+f x))^3}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

Input:

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x])^4,x]
 

Output:

-((a^2*(-1/3*(Sqrt[a - a*Sec[e + f*x]]*(a + a*Sec[e + f*x])^(5/2))/(a*(c + 
 d)*(c + d*Sec[e + f*x])^3) + (5*a*(-1/2*(Sqrt[a - a*Sec[e + f*x]]*(a + a* 
Sec[e + f*x])^(3/2))/(a*(c + d)*(c + d*Sec[e + f*x])^2) + (3*a*((2*ArcTan[ 
(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c - d]*Sqrt[a - a*Sec[e + f*x 
]])])/(Sqrt[c - d]*(c + d)^(3/2)) - (Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*S 
ec[e + f*x]])/(a*(c + d)*(c + d*Sec[e + f*x]))))/(2*(c + d))))/(3*(c + d)) 
)*Tan[e + f*x])/(f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]))
 

Defintions of rubi rules used

rule 104
Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x 
_)), x_] :> With[{q = Denominator[m]}, Simp[q   Subst[Int[x^(q*(m + 1) - 1) 
/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^(1/q)], x] 
] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && L 
tQ[-1, m, 0] && SimplerQ[a + b*x, c + d*x]
 

rule 105
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Simp[(a + b*x)^(m + 1)*(c + d*x)^n*((e + f*x)^(p + 1)/((m + 
1)*(b*e - a*f))), x] - Simp[n*((d*e - c*f)/((m + 1)*(b*e - a*f)))   Int[(a 
+ b*x)^(m + 1)*(c + d*x)^(n - 1)*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, 
e, f, m, p}, x] && EqQ[m + n + p + 2, 0] && GtQ[n, 0] && (SumSimplerQ[m, 1] 
 ||  !SumSimplerQ[p, 1]) && NeQ[m, -1]
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

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

rule 4475
Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_), x_Symbol] :> Simp[a 
^2*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]])) 
 Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*((c + d*x)^n/Sqrt[a - b*x]), x 
], x, Csc[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[ 
b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p, 1] || In 
tegerQ[m - 1/2])
 
Maple [A] (verified)

Time = 0.62 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.28

method result size
derivativedivides \(\frac {16 a^{3} \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{6 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{3}}-\frac {5 \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{2}}-\frac {3 \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )}+\frac {\operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{2 \left (c +d \right ) \sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{4 \left (c +d \right )}\right )}{6 \left (c +d \right )}\right )}{f}\) \(227\)
default \(\frac {16 a^{3} \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{6 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{3}}-\frac {5 \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{2}}-\frac {3 \left (-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c +d \right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )}+\frac {\operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{2 \left (c +d \right ) \sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{4 \left (c +d \right )}\right )}{6 \left (c +d \right )}\right )}{f}\) \(227\)
risch \(\frac {i a^{3} \left (22 c^{5}+9 c^{4} d -9 c^{5} {\mathrm e}^{5 i \left (f x +e \right )}+8 d^{5} {\mathrm e}^{3 i \left (f x +e \right )}+9 c^{5} {\mathrm e}^{i \left (f x +e \right )}+18 c^{5} {\mathrm e}^{4 i \left (f x +e \right )}+2 c^{3} d^{2}+132 c^{4} d \,{\mathrm e}^{3 i \left (f x +e \right )}+54 c^{3} d^{2} {\mathrm e}^{3 i \left (f x +e \right )}+100 c^{2} d^{3} {\mathrm e}^{3 i \left (f x +e \right )}+36 c \,d^{4} {\mathrm e}^{3 i \left (f x +e \right )}+36 c^{4} d \,{\mathrm e}^{2 i \left (f x +e \right )}+180 c^{3} d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+54 c^{2} d^{3} {\mathrm e}^{2 i \left (f x +e \right )}+12 c \,d^{4} {\mathrm e}^{2 i \left (f x +e \right )}+114 c^{4} d \,{\mathrm e}^{i \left (f x +e \right )}+36 c^{3} d^{2} {\mathrm e}^{i \left (f x +e \right )}+6 c^{2} d^{3} {\mathrm e}^{i \left (f x +e \right )}-9 c^{4} d \,{\mathrm e}^{4 i \left (f x +e \right )}+18 c^{3} d^{2} {\mathrm e}^{5 i \left (f x +e \right )}+90 c^{3} d^{2} {\mathrm e}^{4 i \left (f x +e \right )}+54 c^{2} d^{3} {\mathrm e}^{4 i \left (f x +e \right )}+12 c \,d^{4} {\mathrm e}^{4 i \left (f x +e \right )}+18 c^{4} d \,{\mathrm e}^{5 i \left (f x +e \right )}+6 c^{2} d^{3} {\mathrm e}^{5 i \left (f x +e \right )}+48 c^{5} {\mathrm e}^{2 i \left (f x +e \right )}\right )}{3 c^{3} \left (c +d \right )^{3} f \left (c \,{\mathrm e}^{2 i \left (f x +e \right )}+2 d \,{\mathrm e}^{i \left (f x +e \right )}+c \right )^{3}}+\frac {5 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+d \sqrt {c^{2}-d^{2}}}{\sqrt {c^{2}-d^{2}}\, c}\right )}{2 \sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{3} f}-\frac {5 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i c^{2}-i d^{2}-d \sqrt {c^{2}-d^{2}}}{\sqrt {c^{2}-d^{2}}\, c}\right )}{2 \sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{3} f}\) \(580\)

Input:

int(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^4,x,method=_RETURNVERBO 
SE)
 

Output:

16/f*a^3*(-1/6*tan(1/2*f*x+1/2*e)/(c+d)/(c*tan(1/2*f*x+1/2*e)^2-tan(1/2*f* 
x+1/2*e)^2*d-c-d)^3-5/6/(c+d)*(-1/4*tan(1/2*f*x+1/2*e)/(c+d)/(c*tan(1/2*f* 
x+1/2*e)^2-tan(1/2*f*x+1/2*e)^2*d-c-d)^2-3/4/(c+d)*(-1/2*tan(1/2*f*x+1/2*e 
)/(c+d)/(c*tan(1/2*f*x+1/2*e)^2-tan(1/2*f*x+1/2*e)^2*d-c-d)+1/2/(c+d)/((c- 
d)*(c+d))^(1/2)*arctanh((c-d)*tan(1/2*f*x+1/2*e)/((c-d)*(c+d))^(1/2)))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 477 vs. \(2 (163) = 326\).

Time = 0.19 (sec) , antiderivative size = 1012, normalized size of antiderivative = 5.69 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx =\text {Too large to display} \] Input:

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^4,x, algorithm="f 
ricas")
 

Output:

[1/12*(15*(a^3*c^3*cos(f*x + e)^3 + 3*a^3*c^2*d*cos(f*x + e)^2 + 3*a^3*c*d 
^2*cos(f*x + e) + a^3*d^3)*sqrt(c^2 - d^2)*log((2*c*d*cos(f*x + e) - (c^2 
- 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + 
 e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + 2*(2 
*a^3*c^4 + 9*a^3*c^3*d + 20*a^3*c^2*d^2 - 9*a^3*c*d^3 - 22*a^3*d^4 + (22*a 
^3*c^4 + 9*a^3*c^3*d - 20*a^3*c^2*d^2 - 9*a^3*c*d^3 - 2*a^3*d^4)*cos(f*x + 
 e)^2 + 3*(3*a^3*c^4 + 16*a^3*c^3*d - 16*a^3*c*d^3 - 3*a^3*d^4)*cos(f*x + 
e))*sin(f*x + e))/((c^8 + 3*c^7*d + 2*c^6*d^2 - 2*c^5*d^3 - 3*c^4*d^4 - c^ 
3*d^5)*f*cos(f*x + e)^3 + 3*(c^7*d + 3*c^6*d^2 + 2*c^5*d^3 - 2*c^4*d^4 - 3 
*c^3*d^5 - c^2*d^6)*f*cos(f*x + e)^2 + 3*(c^6*d^2 + 3*c^5*d^3 + 2*c^4*d^4 
- 2*c^3*d^5 - 3*c^2*d^6 - c*d^7)*f*cos(f*x + e) + (c^5*d^3 + 3*c^4*d^4 + 2 
*c^3*d^5 - 2*c^2*d^6 - 3*c*d^7 - d^8)*f), 1/6*(15*(a^3*c^3*cos(f*x + e)^3 
+ 3*a^3*c^2*d*cos(f*x + e)^2 + 3*a^3*c*d^2*cos(f*x + e) + a^3*d^3)*sqrt(-c 
^2 + d^2)*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*sin(f 
*x + e))) + (2*a^3*c^4 + 9*a^3*c^3*d + 20*a^3*c^2*d^2 - 9*a^3*c*d^3 - 22*a 
^3*d^4 + (22*a^3*c^4 + 9*a^3*c^3*d - 20*a^3*c^2*d^2 - 9*a^3*c*d^3 - 2*a^3* 
d^4)*cos(f*x + e)^2 + 3*(3*a^3*c^4 + 16*a^3*c^3*d - 16*a^3*c*d^3 - 3*a^3*d 
^4)*cos(f*x + e))*sin(f*x + e))/((c^8 + 3*c^7*d + 2*c^6*d^2 - 2*c^5*d^3 - 
3*c^4*d^4 - c^3*d^5)*f*cos(f*x + e)^3 + 3*(c^7*d + 3*c^6*d^2 + 2*c^5*d^3 - 
 2*c^4*d^4 - 3*c^3*d^5 - c^2*d^6)*f*cos(f*x + e)^2 + 3*(c^6*d^2 + 3*c^5...
 

Sympy [F]

\[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=a^{3} \left (\int \frac {\sec {\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec {\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{2}{\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec {\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{3}{\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec {\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx + \int \frac {\sec ^{4}{\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec {\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx\right ) \] Input:

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**3/(c+d*sec(f*x+e))**4,x)
 

Output:

a**3*(Integral(sec(e + f*x)/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*se 
c(e + f*x)**2 + 4*c*d**3*sec(e + f*x)**3 + d**4*sec(e + f*x)**4), x) + Int 
egral(3*sec(e + f*x)**2/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*sec(e 
+ f*x)**2 + 4*c*d**3*sec(e + f*x)**3 + d**4*sec(e + f*x)**4), x) + Integra 
l(3*sec(e + f*x)**3/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*sec(e + f* 
x)**2 + 4*c*d**3*sec(e + f*x)**3 + d**4*sec(e + f*x)**4), x) + Integral(se 
c(e + f*x)**4/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*sec(e + f*x)**2 
+ 4*c*d**3*sec(e + f*x)**3 + d**4*sec(e + f*x)**4), x))
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^4,x, algorithm="m 
axima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?` f 
or more de
 

Giac [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 307, normalized size of antiderivative = 1.72 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=-\frac {\frac {15 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} a^{3}}{{\left (c^{3} + 3 \, c^{2} d + 3 \, c d^{2} + d^{3}\right )} \sqrt {-c^{2} + d^{2}}} + \frac {15 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 30 \, a^{3} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 15 \, a^{3} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 40 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 40 \, a^{3} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 33 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 66 \, a^{3} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 33 \, a^{3} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (c^{3} + 3 \, c^{2} d + 3 \, c d^{2} + d^{3}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )}^{3}}}{3 \, f} \] Input:

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^4,x, algorithm="g 
iac")
 

Output:

-1/3*(15*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan( 
1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))*a^3/((c^3 + 
3*c^2*d + 3*c*d^2 + d^3)*sqrt(-c^2 + d^2)) + (15*a^3*c^2*tan(1/2*f*x + 1/2 
*e)^5 - 30*a^3*c*d*tan(1/2*f*x + 1/2*e)^5 + 15*a^3*d^2*tan(1/2*f*x + 1/2*e 
)^5 - 40*a^3*c^2*tan(1/2*f*x + 1/2*e)^3 + 40*a^3*d^2*tan(1/2*f*x + 1/2*e)^ 
3 + 33*a^3*c^2*tan(1/2*f*x + 1/2*e) + 66*a^3*c*d*tan(1/2*f*x + 1/2*e) + 33 
*a^3*d^2*tan(1/2*f*x + 1/2*e))/((c^3 + 3*c^2*d + 3*c*d^2 + d^3)*(c*tan(1/2 
*f*x + 1/2*e)^2 - d*tan(1/2*f*x + 1/2*e)^2 - c - d)^3))/f
 

Mupad [B] (verification not implemented)

Time = 13.48 (sec) , antiderivative size = 264, normalized size of antiderivative = 1.48 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx=\frac {\frac {5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (a^3\,c^2-2\,a^3\,c\,d+a^3\,d^2\right )}{{\left (c+d\right )}^3}+\frac {11\,a^3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{c+d}-\frac {40\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (a^3\,c-a^3\,d\right )}{3\,{\left (c+d\right )}^2}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (-3\,c^3-3\,c^2\,d+3\,c\,d^2+3\,d^3\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (-3\,c^3+3\,c^2\,d+3\,c\,d^2-3\,d^3\right )+3\,c\,d^2+3\,c^2\,d+c^3+d^3-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (c^3-3\,c^2\,d+3\,c\,d^2-d^3\right )\right )}+\frac {5\,a^3\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c-d}}{\sqrt {c+d}}\right )}{f\,{\left (c+d\right )}^{7/2}\,\sqrt {c-d}} \] Input:

int((a + a/cos(e + f*x))^3/(cos(e + f*x)*(c + d/cos(e + f*x))^4),x)
 

Output:

((5*tan(e/2 + (f*x)/2)^5*(a^3*c^2 + a^3*d^2 - 2*a^3*c*d))/(c + d)^3 + (11* 
a^3*tan(e/2 + (f*x)/2))/(c + d) - (40*tan(e/2 + (f*x)/2)^3*(a^3*c - a^3*d) 
)/(3*(c + d)^2))/(f*(tan(e/2 + (f*x)/2)^2*(3*c*d^2 - 3*c^2*d - 3*c^3 + 3*d 
^3) - tan(e/2 + (f*x)/2)^4*(3*c*d^2 + 3*c^2*d - 3*c^3 - 3*d^3) + 3*c*d^2 + 
 3*c^2*d + c^3 + d^3 - tan(e/2 + (f*x)/2)^6*(3*c*d^2 - 3*c^2*d + c^3 - d^3 
))) + (5*a^3*atanh((tan(e/2 + (f*x)/2)*(c - d)^(1/2))/(c + d)^(1/2)))/(f*( 
c + d)^(7/2)*(c - d)^(1/2))
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 933, normalized size of antiderivative = 5.24 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^4} \, dx =\text {Too large to display} \] Input:

int(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^4,x)
 

Output:

(a**3*(30*sqrt( - c**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2) 
*d)/sqrt( - c**2 + d**2))*cos(e + f*x)*sin(e + f*x)**2*c**3 - 30*sqrt( - c 
**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2)*d)/sqrt( - c**2 + 
d**2))*cos(e + f*x)*c**3 - 90*sqrt( - c**2 + d**2)*atan((tan((e + f*x)/2)* 
c - tan((e + f*x)/2)*d)/sqrt( - c**2 + d**2))*cos(e + f*x)*c*d**2 + 90*sqr 
t( - c**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2)*d)/sqrt( - c 
**2 + d**2))*sin(e + f*x)**2*c**2*d - 90*sqrt( - c**2 + d**2)*atan((tan((e 
 + f*x)/2)*c - tan((e + f*x)/2)*d)/sqrt( - c**2 + d**2))*c**2*d - 30*sqrt( 
 - c**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2)*d)/sqrt( - c** 
2 + d**2))*d**3 - 9*cos(e + f*x)*sin(e + f*x)*c**4 - 48*cos(e + f*x)*sin(e 
 + f*x)*c**3*d + 48*cos(e + f*x)*sin(e + f*x)*c*d**3 + 9*cos(e + f*x)*sin( 
e + f*x)*d**4 + 22*sin(e + f*x)**3*c**4 + 9*sin(e + f*x)**3*c**3*d - 20*si 
n(e + f*x)**3*c**2*d**2 - 9*sin(e + f*x)**3*c*d**3 - 2*sin(e + f*x)**3*d** 
4 - 24*sin(e + f*x)*c**4 - 18*sin(e + f*x)*c**3*d + 18*sin(e + f*x)*c*d**3 
 + 24*sin(e + f*x)*d**4))/(6*f*(cos(e + f*x)*sin(e + f*x)**2*c**8 + 3*cos( 
e + f*x)*sin(e + f*x)**2*c**7*d + 2*cos(e + f*x)*sin(e + f*x)**2*c**6*d**2 
 - 2*cos(e + f*x)*sin(e + f*x)**2*c**5*d**3 - 3*cos(e + f*x)*sin(e + f*x)* 
*2*c**4*d**4 - cos(e + f*x)*sin(e + f*x)**2*c**3*d**5 - cos(e + f*x)*c**8 
- 3*cos(e + f*x)*c**7*d - 5*cos(e + f*x)*c**6*d**2 - 7*cos(e + f*x)*c**5*d 
**3 - 3*cos(e + f*x)*c**4*d**4 + 7*cos(e + f*x)*c**3*d**5 + 9*cos(e + f...