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 + (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)

________________________________________________________________________________________

Rubi [A]  time = 0.0783303, antiderivative size = 76, normalized size of antiderivative = 1., 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 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]

Rule 3770

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

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, 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.265345, 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)

________________________________________________________________________________________

Maple [A]  time = 0.039, size = 110, normalized size = 1.5 \begin{align*} a{b}^{2}x+{\frac{a{b}^{2}d}{e}}+{\frac{5\,{a}^{2}b\ln \left ( \sec \left ( ex+d \right ) +\tan \left ( ex+d \right ) \right ) }{2\,e}}+{\frac{{a}^{3}\tan \left ( ex+d \right ) }{e}}+{\frac{{b}^{3}\ln \left ( \sec \left ( ex+d \right ) +\tan \left ( ex+d \right ) \right ) }{e}}+2\,{\frac{a{b}^{2}\tan \left ( ex+d \right ) }{e}}+{\frac{{a}^{2}b\sec \left ( ex+d \right ) \tan \left ( ex+d \right ) }{2\,e}} \end{align*}

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 = 1.0208, size = 170, normalized size = 2.24 \begin{align*} \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} \end{align*}

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

________________________________________________________________________________________

Fricas [A]  time = 1.74779, size = 305, normalized size = 4.01 \begin{align*} \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}} \end{align*}

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)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec{\left (d + e x \right )}\right ) \left (a \sec{\left (d + e x \right )} + b\right )^{2}\, dx \end{align*}

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)

________________________________________________________________________________________

Giac [B]  time = 1.22314, size = 258, normalized size = 3.39 \begin{align*} \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 )} \end{align*}

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)