Integrand size = 29, antiderivative size = 35 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=b B x+\frac {(A b+a B) \text {arctanh}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d} \] Output:
b*B*x+(A*b+B*a)*arctanh(sin(d*x+c))/d+a*A*tan(d*x+c)/d
Time = 0.02 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.23 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=b B x+\frac {A b \coth ^{-1}(\sin (c+d x))}{d}+\frac {a B \coth ^{-1}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d} \] Input:
Integrate[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x])*Sec[c + d*x]^2,x]
Output:
b*B*x + (A*b*ArcCoth[Sin[c + d*x]])/d + (a*B*ArcCoth[Sin[c + d*x]])/d + (a *A*Tan[c + d*x])/d
Time = 0.44 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {3042, 3447, 3042, 3500, 3042, 3214, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \int \sec ^2(c+d x) \left ((a B+A b) \cos (c+d x)+a A+b B \cos ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a B+A b) \sin \left (c+d x+\frac {\pi }{2}\right )+a A+b B \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3500 |
\(\displaystyle \int (A b+B \cos (c+d x) b+a B) \sec (c+d x)dx+\frac {a A \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A b+B \sin \left (c+d x+\frac {\pi }{2}\right ) b+a B}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {a A \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle (a B+A b) \int \sec (c+d x)dx+\frac {a A \tan (c+d x)}{d}+b B x\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (a B+A b) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {a A \tan (c+d x)}{d}+b B x\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {(a B+A b) \text {arctanh}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d}+b B x\) |
Input:
Int[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x])*Sec[c + d*x]^2,x]
Output:
b*B*x + ((A*b + a*B)*ArcTanh[Sin[c + d*x]])/d + (a*A*Tan[c + d*x])/d
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(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]
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]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* (a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x ])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A *b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 3.54 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.43
method | result | size |
parts | \(\frac {a A \tan \left (d x +c \right )}{d}+\frac {\left (A b +B a \right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {B b \left (d x +c \right )}{d}\) | \(50\) |
derivativedivides | \(\frac {A \tan \left (d x +c \right ) a +B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \left (d x +c \right )}{d}\) | \(57\) |
default | \(\frac {A \tan \left (d x +c \right ) a +B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \left (d x +c \right )}{d}\) | \(57\) |
parallelrisch | \(\frac {-\left (A b +B a \right ) \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (A b +B a \right ) \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+B b d x \cos \left (d x +c \right )+A a \sin \left (d x +c \right )}{\cos \left (d x +c \right ) d}\) | \(87\) |
risch | \(b B x +\frac {2 i A a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a}{d}\) | \(105\) |
norman | \(\frac {b B x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+b B x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-b B x -\frac {2 A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {2 A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-b B x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}+\frac {\left (A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {\left (A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(184\) |
Input:
int((a+cos(d*x+c)*b)*(A+B*cos(d*x+c))*sec(d*x+c)^2,x,method=_RETURNVERBOSE )
Output:
a*A*tan(d*x+c)/d+(A*b+B*a)/d*ln(sec(d*x+c)+tan(d*x+c))+B*b/d*(d*x+c)
Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (35) = 70\).
Time = 0.09 (sec) , antiderivative size = 85, normalized size of antiderivative = 2.43 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {2 \, B b d x \cos \left (d x + c\right ) + {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A a \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^2,x, algorithm="fri cas")
Output:
1/2*(2*B*b*d*x*cos(d*x + c) + (B*a + A*b)*cos(d*x + c)*log(sin(d*x + c) + 1) - (B*a + A*b)*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*A*a*sin(d*x + c)) /(d*cos(d*x + c))
\[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\int \left (A + B \cos {\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)**2,x)
Output:
Integral((A + B*cos(c + d*x))*(a + b*cos(c + d*x))*sec(c + d*x)**2, x)
Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (35) = 70\).
Time = 0.08 (sec) , antiderivative size = 73, normalized size of antiderivative = 2.09 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {2 \, {\left (d x + c\right )} B b + B a {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + A b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a \tan \left (d x + c\right )}{2 \, d} \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^2,x, algorithm="max ima")
Output:
1/2*(2*(d*x + c)*B*b + B*a*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + A*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*A*a*tan(d*x + c ))/d
Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (35) = 70\).
Time = 0.19 (sec) , antiderivative size = 84, normalized size of antiderivative = 2.40 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} B b + {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}{d} \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^2,x, algorithm="gia c")
Output:
((d*x + c)*B*b + (B*a + A*b)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (B*a + A *b)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*A*a*tan(1/2*d*x + 1/2*c)/(tan(1 /2*d*x + 1/2*c)^2 - 1))/d
Time = 41.25 (sec) , antiderivative size = 114, normalized size of antiderivative = 3.26 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {2\,B\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {A\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d} \] Input:
int(((A + B*cos(c + d*x))*(a + b*cos(c + d*x)))/cos(c + d*x)^2,x)
Output:
(2*B*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (B*a*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*2i)/d - (A*b*atan((sin(c/2 + (d*x)/2)* 1i)/cos(c/2 + (d*x)/2))*2i)/d + (A*a*sin(c + d*x))/(d*cos(c + d*x))
Time = 0.17 (sec) , antiderivative size = 79, normalized size of antiderivative = 2.26 \[ \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {-2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a b +2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a b +\cos \left (d x +c \right ) b^{2} d x +\sin \left (d x +c \right ) a^{2}}{\cos \left (d x +c \right ) d} \] Input:
int((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^2,x)
Output:
( - 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b + 2*cos(c + d*x)*log(tan( (c + d*x)/2) + 1)*a*b + cos(c + d*x)*b**2*d*x + sin(c + d*x)*a**2)/(cos(c + d*x)*d)