3.524 \(\int \frac {a+b \sec (d+e x)}{\sqrt {b^2+2 a b \sec (d+e x)+a^2 \sec ^2(d+e x)}} \, dx\)

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

[Out]

x*(a*b+a^2*sec(e*x+d))/b/(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2)^(1/2)-2*arctan((a-b)^(1/2)*tan(1/2*e*x+1/2*d)
/(a+b)^(1/2))*(b+a*sec(e*x+d))*(a-b)^(1/2)*(a+b)^(1/2)/b/e/(b^2+2*a*b*sec(e*x+d)+a^2*sec(e*x+d)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.21, antiderivative size = 142, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {4174, 3919, 3831, 2659, 205} \[ \frac {x \left (a^2 \sec (d+e x)+a b\right )}{b \sqrt {a^2 \sec ^2(d+e x)+2 a b \sec (d+e x)+b^2}}-\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a+b}}\right ) (a \sec (d+e x)+b)}{b e \sqrt {a^2 \sec ^2(d+e x)+2 a b \sec (d+e x)+b^2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-2*Sqrt[a - b]*Sqrt[a + b]*ArcTan[(Sqrt[a - b]*Tan[(d + e*x)/2])/Sqrt[a + b]]*(b + a*Sec[d + e*x]))/(b*e*Sqrt
[b^2 + 2*a*b*Sec[d + e*x] + a^2*Sec[d + e*x]^2]) + (x*(a*b + a^2*Sec[d + e*x]))/(b*Sqrt[b^2 + 2*a*b*Sec[d + e*
x] + a^2*Sec[d + e*x]^2])

Rule 205

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

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 3919

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(c*x)/a,
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rule 4174

Int[((A_) + (B_.)*sec[(d_.) + (e_.)*(x_)])*((a_) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*sec[(d_.) + (e_.)*(x_
)]^2)^(n_), x_Symbol] :> Dist[(a + b*Sec[d + e*x] + c*Sec[d + e*x]^2)^n/(b + 2*c*Sec[d + e*x])^(2*n), Int[(A +
 B*Sec[d + e*x])*(b + 2*c*Sec[d + e*x])^(2*n), x], x] /; FreeQ[{a, b, c, d, e, A, B}, x] && EqQ[b^2 - 4*a*c, 0
] &&  !IntegerQ[n]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.37, size = 92, normalized size = 0.65 \[ \frac {\sec (d+e x) (a+b \cos (d+e x)) \left (2 \sqrt {b^2-a^2} \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {b^2-a^2}}\right )+a (d+e x)\right )}{b e \sqrt {(a \sec (d+e x)+b)^2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((a*(d + e*x) + 2*Sqrt[-a^2 + b^2]*ArcTanh[((-a + b)*Tan[(d + e*x)/2])/Sqrt[-a^2 + b^2]])*(a + b*Cos[d + e*x])
*Sec[d + e*x])/(b*e*Sqrt[(b + a*Sec[d + e*x])^2])

________________________________________________________________________________________

fricas [A]  time = 1.06, size = 184, normalized size = 1.30 \[ \left [\frac {2 \, a e x + \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (e x + d\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (e x + d\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (e x + d\right ) + b\right )} \sin \left (e x + d\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (e x + d\right )^{2} + 2 \, a b \cos \left (e x + d\right ) + a^{2}}\right )}{2 \, b e}, \frac {a e x - \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (e x + d\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (e x + d\right )}\right )}{b e}\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)^(1/2),x, algorithm="fricas")

[Out]

[1/2*(2*a*e*x + sqrt(-a^2 + b^2)*log((2*a*b*cos(e*x + d) + (2*a^2 - b^2)*cos(e*x + d)^2 + 2*sqrt(-a^2 + b^2)*(
a*cos(e*x + d) + b)*sin(e*x + d) - a^2 + 2*b^2)/(b^2*cos(e*x + d)^2 + 2*a*b*cos(e*x + d) + a^2)))/(b*e), (a*e*
x - sqrt(a^2 - b^2)*arctan(-(a*cos(e*x + d) + b)/(sqrt(a^2 - b^2)*sin(e*x + d))))/(b*e)]

________________________________________________________________________________________

giac [B]  time = 4.83, size = 1504, normalized size = 10.59 \[ \text {result too large to display} \]

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)^(1/2),x, algorithm="giac")

[Out]

((sqrt(a^2 - b^2)*abs(a - b)*abs(b)*abs(sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*
x*e + 1/2*d)^2 - a - b)) + sqrt(a^2 - b^2)*(2*a + b)*abs(a - b)*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e +
 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))*arctan(tan(1/2*x*e + 1/2*d)/sqrt((a*sgn(a*tan(1/2*x*e + 1/2*d
)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) + sqrt(-(a*sgn(a*tan(1/2*x*e + 1/2*d)^4 -
 b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) + b*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x
*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))*(a*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^
4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) - b*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(
1/2*x*e + 1/2*d)^2 - a - b)) + a^2))/(a*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*
x*e + 1/2*d)^2 - a - b) - b*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)
^2 - a - b))))/((a^2 - a*b)*abs(b)*abs(sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x
*e + 1/2*d)^2 - a - b))*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 -
 a - b) + (a - b)*b^2) + (a*abs(b)*abs(sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x
*e + 1/2*d)^2 - a - b)) - b*abs(b)*abs(sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x
*e + 1/2*d)^2 - a - b)) - 2*a^2*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/
2*d)^2 - a - b) + a*b*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a
 - b) + b^2*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))*arc
tan(tan(1/2*x*e + 1/2*d)/sqrt((a*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1
/2*d)^2 - a - b) - sqrt(-(a*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)
^2 - a - b) + b*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))
*(a*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) - b*sgn(a*ta
n(1/2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b)) + a^2))/(a*sgn(a*tan(1/
2*x*e + 1/2*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) - b*sgn(a*tan(1/2*x*e + 1/2*
d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))))/(a*abs(b)*abs(sgn(a*tan(1/2*x*e + 1/2
*d)^4 - b*tan(1/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b))*sgn(a*tan(1/2*x*e + 1/2*d)^4 - b*tan(1
/2*x*e + 1/2*d)^4 + 2*b*tan(1/2*x*e + 1/2*d)^2 - a - b) - b^2))*e^(-1)

________________________________________________________________________________________

maple [A]  time = 0.66, size = 157, normalized size = 1.11 \[ \frac {\left (b \cos \left (e x +d \right )+a \right ) \left (2 \arctan \left (\frac {\left (\cos \left (e x +d \right )-1\right ) \left (a -b \right )}{\sin \left (e x +d \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) a^{2}-2 \arctan \left (\frac {\left (\cos \left (e x +d \right )-1\right ) \left (a -b \right )}{\sin \left (e x +d \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) b^{2}+a \left (e x +d \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}\right )}{e \cos \left (e x +d \right ) \sqrt {\frac {\left (b \cos \left (e x +d \right )+a \right )^{2}}{\cos \left (e x +d \right )^{2}}}\, b \sqrt {\left (a +b \right ) \left (a -b \right )}} \]

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)^(1/2),x)

[Out]

1/e*(b*cos(e*x+d)+a)*(2*arctan((cos(e*x+d)-1)*(a-b)/sin(e*x+d)/((a+b)*(a-b))^(1/2))*a^2-2*arctan((cos(e*x+d)-1
)*(a-b)/sin(e*x+d)/((a+b)*(a-b))^(1/2))*b^2+a*(e*x+d)*((a+b)*(a-b))^(1/2))/cos(e*x+d)/((b*cos(e*x+d)+a)^2/cos(
e*x+d)^2)^(1/2)/b/((a+b)*(a-b))^(1/2)

________________________________________________________________________________________

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

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)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {a+\frac {b}{\cos \left (d+e\,x\right )}}{\sqrt {b^2+\frac {a^2}{{\cos \left (d+e\,x\right )}^2}+\frac {2\,a\,b}{\cos \left (d+e\,x\right )}}} \,d x \]

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))^(1/2),x)

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + b \sec {\left (d + e x \right )}}{\sqrt {\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)**(1/2),x)

[Out]

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

________________________________________________________________________________________