3.185 \(\int (a+a \cos (x)) (A+B \sec (x)) \, dx\)

Optimal. Leaf size=18 \[ a x (A+B)+a A \sin (x)+a B \tanh ^{-1}(\sin (x)) \]

[Out]

a*(A+B)*x+a*B*arctanh(sin(x))+a*A*sin(x)

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2828, 2968, 3023, 2735, 3770} \[ a x (A+B)+a A \sin (x)+a B \tanh ^{-1}(\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Cos[x])*(A + B*Sec[x]),x]

[Out]

a*(A + B)*x + a*B*ArcTanh[Sin[x]] + a*A*Sin[x]

Rule 2735

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

Rule 2828

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> In
t[((a + b*Sin[e + f*x])^m*(d + c*Sin[e + f*x])^n)/Sin[e + f*x]^n, x] /; FreeQ[{a, b, c, d, e, f, m}, x] && Int
egerQ[n]

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3770

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

Rubi steps

\begin {align*} \int (a+a \cos (x)) (A+B \sec (x)) \, dx &=\int (a+a \cos (x)) (B+A \cos (x)) \sec (x) \, dx\\ &=\int \left (a B+(a A+a B) \cos (x)+a A \cos ^2(x)\right ) \sec (x) \, dx\\ &=a A \sin (x)+\int (a B+a (A+B) \cos (x)) \sec (x) \, dx\\ &=a (A+B) x+a A \sin (x)+(a B) \int \sec (x) \, dx\\ &=a (A+B) x+a B \tanh ^{-1}(\sin (x))+a A \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.01, size = 51, normalized size = 2.83 \[ a A x+a A \sin (x)+a B x-a B \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+a B \log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Cos[x])*(A + B*Sec[x]),x]

[Out]

a*A*x + a*B*x - a*B*Log[Cos[x/2] - Sin[x/2]] + a*B*Log[Cos[x/2] + Sin[x/2]] + a*A*Sin[x]

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 32, normalized size = 1.78 \[ {\left (A + B\right )} a x + \frac {1}{2} \, B a \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, B a \log \left (-\sin \relax (x) + 1\right ) + A a \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(x))*(A+B*sec(x)),x, algorithm="fricas")

[Out]

(A + B)*a*x + 1/2*B*a*log(sin(x) + 1) - 1/2*B*a*log(-sin(x) + 1) + A*a*sin(x)

________________________________________________________________________________________

giac [B]  time = 0.18, size = 51, normalized size = 2.83 \[ B a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) - B a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right ) + {\left (A a + B a\right )} x + \frac {2 \, A a \tan \left (\frac {1}{2} \, x\right )}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(x))*(A+B*sec(x)),x, algorithm="giac")

[Out]

B*a*log(abs(tan(1/2*x) + 1)) - B*a*log(abs(tan(1/2*x) - 1)) + (A*a + B*a)*x + 2*A*a*tan(1/2*x)/(tan(1/2*x)^2 +
 1)

________________________________________________________________________________________

maple [A]  time = 0.10, size = 24, normalized size = 1.33 \[ a A \sin \relax (x )+B a x +a A x +B a \ln \left (\sec \relax (x )+\tan \relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*cos(x))*(A+B*sec(x)),x)

[Out]

a*A*sin(x)+B*a*x+a*A*x+B*a*ln(sec(x)+tan(x))

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 23, normalized size = 1.28 \[ A a x + B a x + B a \log \left (\sec \relax (x) + \tan \relax (x)\right ) + A a \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(x))*(A+B*sec(x)),x, algorithm="maxima")

[Out]

A*a*x + B*a*x + B*a*log(sec(x) + tan(x)) + A*a*sin(x)

________________________________________________________________________________________

mupad [B]  time = 2.48, size = 54, normalized size = 3.00 \[ 2\,A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )+2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )+2\,B\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )+A\,a\,\sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*cos(x))*(A + B/cos(x)),x)

[Out]

2*A*a*atan(sin(x/2)/cos(x/2)) + 2*B*a*atan(sin(x/2)/cos(x/2)) + 2*B*a*atanh(sin(x/2)/cos(x/2)) + A*a*sin(x)

________________________________________________________________________________________

sympy [A]  time = 2.17, size = 27, normalized size = 1.50 \[ A a x + A a \sin {\relax (x )} + B a x + B a \log {\left (\tan {\relax (x )} + \sec {\relax (x )} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(x))*(A+B*sec(x)),x)

[Out]

A*a*x + A*a*sin(x) + B*a*x + B*a*log(tan(x) + sec(x))

________________________________________________________________________________________