\(\int (a+a \cos (x)) (A+B \sec (x)) \, dx\) [185]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 18 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=a (A+B) x+a B \text {arctanh}(\sin (x))+a A \sin (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2907, 3047, 3102, 2814, 3855} \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=a x (A+B)+a A \sin (x)+a B \text {arctanh}(\sin (x)) \]

[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 2814

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 2907

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 3047

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 3102

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 3855

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

Rubi steps \begin{align*} \text {integral}& = \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 \text {arctanh}(\sin (x))+a A \sin (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.11 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=a A x+a B x+a B \text {arctanh}(\sin (x))+a A \sin (x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.33

method result size
default \(a A \sin \left (x \right )+B a x +a A x +B a \ln \left (\sec \left (x \right )+\tan \left (x \right )\right )\) \(24\)
parts \(a A \sin \left (x \right )+B a x +a A x +B a \ln \left (\sec \left (x \right )+\tan \left (x \right )\right )\) \(24\)
parallelrisch \(a \left (-B \ln \left (-\cot \left (x \right )+\csc \left (x \right )-1\right )+B \ln \left (\csc \left (x \right )-\cot \left (x \right )+1\right )+A \sin \left (x \right )+x \left (A +B \right )\right )\) \(36\)
risch \(a A x +B a x -\frac {i A a \,{\mathrm e}^{i x}}{2}+\frac {i A a \,{\mathrm e}^{-i x}}{2}+B a \ln \left (i+{\mathrm e}^{i x}\right )-B a \ln \left ({\mathrm e}^{i x}-i\right )\) \(55\)
norman \(\frac {\left (A a +B a \right ) x +\left (A a +B a \right ) x \tan \left (\frac {x}{2}\right )^{2}+2 A a \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}+B a \ln \left (\tan \left (\frac {x}{2}\right )+1\right )-B a \ln \left (\tan \left (\frac {x}{2}\right )-1\right )\) \(67\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.78 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx={\left (A + B\right )} a x + \frac {1}{2} \, B a \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, B a \log \left (-\sin \left (x\right ) + 1\right ) + A a \sin \left (x\right ) \]

[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)

Sympy [A] (verification not implemented)

Time = 0.84 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.50 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=A a x + A a \sin {\left (x \right )} + B a x + B a \log {\left (\tan {\left (x \right )} + \sec {\left (x \right )} \right )} \]

[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))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.28 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=A a x + B a x + B a \log \left (\sec \left (x\right ) + \tan \left (x\right )\right ) + A a \sin \left (x\right ) \]

[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)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 51 vs. \(2 (18) = 36\).

Time = 0.28 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.83 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=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} \]

[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)

Mupad [B] (verification not implemented)

Time = 26.88 (sec) , antiderivative size = 54, normalized size of antiderivative = 3.00 \[ \int (a+a \cos (x)) (A+B \sec (x)) \, dx=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 \left (x\right ) \]

[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)