3.519 \(\int (a+b \sec (d+e x)) (b^2+2 a b \sec (d+e x)+a^2 \sec ^2(d+e x)) \, dx\)

Optimal. Leaf size=76 \[ \frac {a \left (a^2+2 b^2\right ) \tan (d+e x)}{e}+\frac {b \left (5 a^2+2 b^2\right ) \tanh ^{-1}(\sin (d+e x))}{2 e}+\frac {a^2 b \tan (d+e x) \sec (d+e x)}{2 e}+a b^2 x \]

[Out]

a*b^2*x+1/2*b*(5*a^2+2*b^2)*arctanh(sin(e*x+d))/e+a*(a^2+2*b^2)*tan(e*x+d)/e+1/2*a^2*b*sec(e*x+d)*tan(e*x+d)/e

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.108, Rules used = {4048, 3770, 3767, 8} \[ \frac {a \left (a^2+2 b^2\right ) \tan (d+e x)}{e}+\frac {b \left (5 a^2+2 b^2\right ) \tanh ^{-1}(\sin (d+e x))}{2 e}+\frac {a^2 b \tan (d+e x) \sec (d+e x)}{2 e}+a b^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[d + e*x])*(b^2 + 2*a*b*Sec[d + e*x] + a^2*Sec[d + e*x]^2),x]

[Out]

a*b^2*x + (b*(5*a^2 + 2*b^2)*ArcTanh[Sin[d + e*x]])/(2*e) + (a*(a^2 + 2*b^2)*Tan[d + e*x])/e + (a^2*b*Sec[d +
e*x]*Tan[d + e*x])/(2*e)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4048

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_)), x_Symbol] :> -Simp[(b*C*Csc[e + f*x]*Cot[e + f*x])/(2*f), x] + Dist[1/2, Int[Simp[2*A*a + (2*B*a + b*(
2*A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x]

Rubi steps

\begin {align*} \int (a+b \sec (d+e x)) \left (b^2+2 a b \sec (d+e x)+a^2 \sec ^2(d+e x)\right ) \, dx &=\frac {a^2 b \sec (d+e x) \tan (d+e x)}{2 e}+\frac {1}{2} \int \left (2 a b^2+b \left (5 a^2+2 b^2\right ) \sec (d+e x)+2 a \left (a^2+2 b^2\right ) \sec ^2(d+e x)\right ) \, dx\\ &=a b^2 x+\frac {a^2 b \sec (d+e x) \tan (d+e x)}{2 e}+\left (a \left (a^2+2 b^2\right )\right ) \int \sec ^2(d+e x) \, dx+\frac {1}{2} \left (b \left (5 a^2+2 b^2\right )\right ) \int \sec (d+e x) \, dx\\ &=a b^2 x+\frac {b \left (5 a^2+2 b^2\right ) \tanh ^{-1}(\sin (d+e x))}{2 e}+\frac {a^2 b \sec (d+e x) \tan (d+e x)}{2 e}-\frac {\left (a \left (a^2+2 b^2\right )\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (d+e x))}{e}\\ &=a b^2 x+\frac {b \left (5 a^2+2 b^2\right ) \tanh ^{-1}(\sin (d+e x))}{2 e}+\frac {a \left (a^2+2 b^2\right ) \tan (d+e x)}{e}+\frac {a^2 b \sec (d+e x) \tan (d+e x)}{2 e}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.28, size = 64, normalized size = 0.84 \[ \frac {b \left (5 a^2+2 b^2\right ) \tanh ^{-1}(\sin (d+e x))+a \tan (d+e x) \left (2 a^2+a b \sec (d+e x)+4 b^2\right )+2 a b^2 e x}{2 e} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[d + e*x])*(b^2 + 2*a*b*Sec[d + e*x] + a^2*Sec[d + e*x]^2),x]

[Out]

(2*a*b^2*e*x + b*(5*a^2 + 2*b^2)*ArcTanh[Sin[d + e*x]] + a*(2*a^2 + 4*b^2 + a*b*Sec[d + e*x])*Tan[d + e*x])/(2
*e)

________________________________________________________________________________________

fricas [A]  time = 1.50, size = 125, normalized size = 1.64 \[ \frac {4 \, a b^{2} e x \cos \left (e x + d\right )^{2} + {\left (5 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (e x + d\right )^{2} \log \left (\sin \left (e x + d\right ) + 1\right ) - {\left (5 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (e x + d\right )^{2} \log \left (-\sin \left (e x + d\right ) + 1\right ) + 2 \, {\left (a^{2} b + 2 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cos \left (e x + d\right )\right )} \sin \left (e x + d\right )}{4 \, e \cos \left (e x + d\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(e*x+d))*(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2),x, algorithm="fricas")

[Out]

1/4*(4*a*b^2*e*x*cos(e*x + d)^2 + (5*a^2*b + 2*b^3)*cos(e*x + d)^2*log(sin(e*x + d) + 1) - (5*a^2*b + 2*b^3)*c
os(e*x + d)^2*log(-sin(e*x + d) + 1) + 2*(a^2*b + 2*(a^3 + 2*a*b^2)*cos(e*x + d))*sin(e*x + d))/(e*cos(e*x + d
)^2)

________________________________________________________________________________________

giac [B]  time = 0.25, size = 191, normalized size = 2.51 \[ \frac {1}{2} \, {\left (2 \, {\left (x e + d\right )} a b^{2} + {\left (5 \, a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right ) + 1 \right |}\right ) - {\left (5 \, a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, a^{3} \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{3} - a^{2} b \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{3} + 4 \, a b^{2} \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{3} - 2 \, a^{3} \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right ) - a^{2} b \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right ) - 4 \, a b^{2} \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{2} - 1\right )}^{2}}\right )} e^{\left (-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(e*x+d))*(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2),x, algorithm="giac")

[Out]

1/2*(2*(x*e + d)*a*b^2 + (5*a^2*b + 2*b^3)*log(abs(tan(1/2*x*e + 1/2*d) + 1)) - (5*a^2*b + 2*b^3)*log(abs(tan(
1/2*x*e + 1/2*d) - 1)) - 2*(2*a^3*tan(1/2*x*e + 1/2*d)^3 - a^2*b*tan(1/2*x*e + 1/2*d)^3 + 4*a*b^2*tan(1/2*x*e
+ 1/2*d)^3 - 2*a^3*tan(1/2*x*e + 1/2*d) - a^2*b*tan(1/2*x*e + 1/2*d) - 4*a*b^2*tan(1/2*x*e + 1/2*d))/(tan(1/2*
x*e + 1/2*d)^2 - 1)^2)*e^(-1)

________________________________________________________________________________________

maple [A]  time = 0.09, size = 110, normalized size = 1.45 \[ a \,b^{2} x +\frac {a \,b^{2} d}{e}+\frac {5 a^{2} b \ln \left (\sec \left (e x +d \right )+\tan \left (e x +d \right )\right )}{2 e}+\frac {a^{3} \tan \left (e x +d \right )}{e}+\frac {b^{3} \ln \left (\sec \left (e x +d \right )+\tan \left (e x +d \right )\right )}{e}+\frac {2 a \,b^{2} \tan \left (e x +d \right )}{e}+\frac {a^{2} b \sec \left (e x +d \right ) \tan \left (e x +d \right )}{2 e} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(e*x+d))*(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2),x)

[Out]

a*b^2*x+1/e*a*b^2*d+5/2/e*a^2*b*ln(sec(e*x+d)+tan(e*x+d))+1/e*a^3*tan(e*x+d)+1/e*b^3*ln(sec(e*x+d)+tan(e*x+d))
+2*a*b^2*tan(e*x+d)/e+1/2*a^2*b*sec(e*x+d)*tan(e*x+d)/e

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 126, normalized size = 1.66 \[ \frac {4 \, {\left (e x + d\right )} a b^{2} - a^{2} b {\left (\frac {2 \, \sin \left (e x + d\right )}{\sin \left (e x + d\right )^{2} - 1} - \log \left (\sin \left (e x + d\right ) + 1\right ) + \log \left (\sin \left (e x + d\right ) - 1\right )\right )} + 8 \, a^{2} b \log \left (\sec \left (e x + d\right ) + \tan \left (e x + d\right )\right ) + 4 \, b^{3} \log \left (\sec \left (e x + d\right ) + \tan \left (e x + d\right )\right ) + 4 \, a^{3} \tan \left (e x + d\right ) + 8 \, a b^{2} \tan \left (e x + d\right )}{4 \, e} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(e*x+d))*(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2),x, algorithm="maxima")

[Out]

1/4*(4*(e*x + d)*a*b^2 - a^2*b*(2*sin(e*x + d)/(sin(e*x + d)^2 - 1) - log(sin(e*x + d) + 1) + log(sin(e*x + d)
 - 1)) + 8*a^2*b*log(sec(e*x + d) + tan(e*x + d)) + 4*b^3*log(sec(e*x + d) + tan(e*x + d)) + 4*a^3*tan(e*x + d
) + 8*a*b^2*tan(e*x + d))/e

________________________________________________________________________________________

mupad [B]  time = 2.91, size = 160, normalized size = 2.11 \[ \frac {2\,b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {d}{2}+\frac {e\,x}{2}\right )}{\cos \left (\frac {d}{2}+\frac {e\,x}{2}\right )}\right )}{e}+\frac {a^3\,\sin \left (d+e\,x\right )}{e\,\cos \left (d+e\,x\right )}+\frac {2\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {d}{2}+\frac {e\,x}{2}\right )}{\cos \left (\frac {d}{2}+\frac {e\,x}{2}\right )}\right )}{e}+\frac {5\,a^2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {d}{2}+\frac {e\,x}{2}\right )}{\cos \left (\frac {d}{2}+\frac {e\,x}{2}\right )}\right )}{e}+\frac {2\,a\,b^2\,\sin \left (d+e\,x\right )}{e\,\cos \left (d+e\,x\right )}+\frac {a^2\,b\,\sin \left (d+e\,x\right )}{2\,e\,{\cos \left (d+e\,x\right )}^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(d + e*x))*(b^2 + a^2/cos(d + e*x)^2 + (2*a*b)/cos(d + e*x)),x)

[Out]

(2*b^3*atanh(sin(d/2 + (e*x)/2)/cos(d/2 + (e*x)/2)))/e + (a^3*sin(d + e*x))/(e*cos(d + e*x)) + (2*a*b^2*atan(s
in(d/2 + (e*x)/2)/cos(d/2 + (e*x)/2)))/e + (5*a^2*b*atanh(sin(d/2 + (e*x)/2)/cos(d/2 + (e*x)/2)))/e + (2*a*b^2
*sin(d + e*x))/(e*cos(d + e*x)) + (a^2*b*sin(d + e*x))/(2*e*cos(d + e*x)^2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(e*x+d))*(b**2+2*a*b*sec(e*x+d)+a**2*sec(e*x+d)**2),x)

[Out]

Integral((a + b*sec(d + e*x))*(a*sec(d + e*x) + b)**2, x)

________________________________________________________________________________________