Integrand size = 29, antiderivative size = 108 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^3 (3 A+B) x+\frac {a^3 (6 A+7 B) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d} \] Output:
a^3*(3*A+B)*x+1/2*a^3*(6*A+7*B)*arctanh(sin(d*x+c))/d-5/2*a^3*B*sin(d*x+c) /d+1/2*a*B*(a+a*sec(d*x+c))^2*sin(d*x+c)/d+(A+2*B)*(a^3+a^3*sec(d*x+c))*si n(d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(335\) vs. \(2(108)=216\).
Time = 3.36 (sec) , antiderivative size = 335, normalized size of antiderivative = 3.10 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^3 \cos ^4(c+d x) \sec ^6\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^3 (A+B \sec (c+d x)) \left (4 (3 A+B) x-\frac {2 (6 A+7 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {2 (6 A+7 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 A \cos (d x) \sin (c)}{d}+\frac {4 A \cos (c) \sin (d x)}{d}+\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+3 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+3 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{32 (B+A \cos (c+d x))} \] Input:
Integrate[Cos[c + d*x]*(a + a*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]
Output:
(a^3*Cos[c + d*x]^4*Sec[(c + d*x)/2]^6*(1 + Sec[c + d*x])^3*(A + B*Sec[c + d*x])*(4*(3*A + B)*x - (2*(6*A + 7*B)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x )/2]])/d + (2*(6*A + 7*B)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/d + (4 *A*Cos[d*x]*Sin[c])/d + (4*A*Cos[c]*Sin[d*x])/d + B/(d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2) + (4*(A + 3*B)*Sin[(d*x)/2])/(d*(Cos[c/2] - Sin[c/2] )*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) - B/(d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2) + (4*(A + 3*B)*Sin[(d*x)/2])/(d*(Cos[c/2] + Sin[c/2])*(Cos[ (c + d*x)/2] + Sin[(c + d*x)/2]))))/(32*(B + A*Cos[c + d*x]))
Time = 0.65 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.02, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {3042, 4506, 3042, 4506, 25, 3042, 4484, 2009}
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 \cos (c+d x) (a \sec (c+d x)+a)^3 (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^3 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4506 |
\(\displaystyle \frac {1}{2} \int \cos (c+d x) (\sec (c+d x) a+a)^2 (a (2 A-B)+2 a (A+2 B) \sec (c+d x))dx+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \int \frac {\left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (a (2 A-B)+2 a (A+2 B) \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 4506 |
\(\displaystyle \frac {1}{2} \left (\int -\cos (c+d x) (\sec (c+d x) a+a) \left (5 a^2 B-a^2 (6 A+7 B) \sec (c+d x)\right )dx+\frac {2 (A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}\right )+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} \left (\frac {2 (A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}-\int \cos (c+d x) (\sec (c+d x) a+a) \left (5 a^2 B-a^2 (6 A+7 B) \sec (c+d x)\right )dx\right )+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (\frac {2 (A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}-\int \frac {\left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (5 a^2 B-a^2 (6 A+7 B) \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\right )+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 4484 |
\(\displaystyle \frac {1}{2} \left (\int \left (2 (3 A+B) a^3+(6 A+7 B) \sec (c+d x) a^3\right )dx+\frac {2 (A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}-\frac {5 a^3 B \sin (c+d x)}{d}\right )+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \left (\frac {a^3 (6 A+7 B) \text {arctanh}(\sin (c+d x))}{d}+\frac {2 (A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}+2 a^3 x (3 A+B)-\frac {5 a^3 B \sin (c+d x)}{d}\right )+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d}\) |
Input:
Int[Cos[c + d*x]*(a + a*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]
Output:
(a*B*(a + a*Sec[c + d*x])^2*Sin[c + d*x])/(2*d) + (2*a^3*(3*A + B)*x + (a^ 3*(6*A + 7*B)*ArcTanh[Sin[c + d*x]])/d - (5*a^3*B*Sin[c + d*x])/d + (2*(A + 2*B)*(a^3 + a^3*Sec[c + d*x])*Sin[c + d*x])/d)/2
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Simp[1/(d*n) Int[(d*Csc[e + f*x])^( n + 1)*Simp[n*(B*a + A*b) + (B*b*n + A*a*(n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && LeQ[n, -1]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-b)*B* Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*(m + n))), x] + Simp[1/(d*(m + n)) Int[(a + b*Csc[e + f*x])^(m - 1)*(d*Csc[e + f*x] )^n*Simp[a*A*d*(m + n) + B*(b*d*n) + (A*b*d*(m + n) + a*B*d*(2*m + n - 1))* Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && GtQ[m, 1/2] && !LtQ[n, -1]
Time = 0.66 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.27
method | result | size |
derivativedivides | \(\frac {a^{3} A \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \left (d x +c \right )+3 B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} A \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )}{d}\) | \(137\) |
default | \(\frac {a^{3} A \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \left (d x +c \right )+3 B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} A \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )}{d}\) | \(137\) |
parallelrisch | \(\frac {\left (-6 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {7 B}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {7 B}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+6 d \left (A +\frac {B}{3}\right ) x \cos \left (2 d x +2 c \right )+\left (2 A +6 B \right ) \sin \left (2 d x +2 c \right )+A \sin \left (3 d x +3 c \right )+\sin \left (d x +c \right ) \left (A +2 B \right )+6 d \left (A +\frac {B}{3}\right ) x \right ) a^{3}}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(150\) |
risch | \(3 a^{3} A x +a^{3} x B -\frac {i a^{3} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{3} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i a^{3} \left (B \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A \,{\mathrm e}^{2 i \left (d x +c \right )}-6 B \,{\mathrm e}^{2 i \left (d x +c \right )}-B \,{\mathrm e}^{i \left (d x +c \right )}-2 A -6 B \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d}\) | \(217\) |
norman | \(\frac {\left (-3 a^{3} A -B \,a^{3}\right ) x +\left (-6 a^{3} A -2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 a^{3} A +B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (6 a^{3} A +2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {a^{3} \left (8 A +5 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {5 B \,a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {a^{3} \left (4 A -7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{3} \left (4 A +7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}-\frac {a^{3} \left (6 A +7 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{3} \left (6 A +7 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(275\) |
Input:
int(cos(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/d*(a^3*A*tan(d*x+c)+B*a^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+t an(d*x+c)))+3*a^3*A*ln(sec(d*x+c)+tan(d*x+c))+3*B*a^3*tan(d*x+c)+3*a^3*A*( d*x+c)+3*B*a^3*ln(sec(d*x+c)+tan(d*x+c))+a^3*A*sin(d*x+c)+B*a^3*(d*x+c))
Time = 0.09 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.27 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (3 \, A + B\right )} a^{3} d x \cos \left (d x + c\right )^{2} + {\left (6 \, A + 7 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, A + 7 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{3} \cos \left (d x + c\right )^{2} + 2 \, {\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right ) + B a^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:
integrate(cos(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="fri cas")
Output:
1/4*(4*(3*A + B)*a^3*d*x*cos(d*x + c)^2 + (6*A + 7*B)*a^3*cos(d*x + c)^2*l og(sin(d*x + c) + 1) - (6*A + 7*B)*a^3*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*A*a^3*cos(d*x + c)^2 + 2*(A + 3*B)*a^3*cos(d*x + c) + B*a^3)*sin (d*x + c))/(d*cos(d*x + c)^2)
\[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^{3} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate(cos(d*x+c)*(a+a*sec(d*x+c))**3*(A+B*sec(d*x+c)),x)
Output:
a**3*(Integral(A*cos(c + d*x), x) + Integral(3*A*cos(c + d*x)*sec(c + d*x) , x) + Integral(3*A*cos(c + d*x)*sec(c + d*x)**2, x) + Integral(A*cos(c + d*x)*sec(c + d*x)**3, x) + Integral(B*cos(c + d*x)*sec(c + d*x), x) + Inte gral(3*B*cos(c + d*x)*sec(c + d*x)**2, x) + Integral(3*B*cos(c + d*x)*sec( c + d*x)**3, x) + Integral(B*cos(c + d*x)*sec(c + d*x)**4, x))
Time = 0.03 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.53 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {12 \, {\left (d x + c\right )} A a^{3} + 4 \, {\left (d x + c\right )} B a^{3} - B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, A a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a^{3} \sin \left (d x + c\right ) + 4 \, A a^{3} \tan \left (d x + c\right ) + 12 \, B a^{3} \tan \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="max ima")
Output:
1/4*(12*(d*x + c)*A*a^3 + 4*(d*x + c)*B*a^3 - B*a^3*(2*sin(d*x + c)/(sin(d *x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 6*A*a^3* (log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 6*B*a^3*(log(sin(d*x + c ) + 1) - log(sin(d*x + c) - 1)) + 4*A*a^3*sin(d*x + c) + 4*A*a^3*tan(d*x + c) + 12*B*a^3*tan(d*x + c))/d
Time = 0.18 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.78 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {4 \, A a^{3} \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} + 2 \, {\left (3 \, A a^{3} + B a^{3}\right )} {\left (d x + c\right )} + {\left (6 \, A a^{3} + 7 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, A a^{3} + 7 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 7 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \] Input:
integrate(cos(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="gia c")
Output:
1/2*(4*A*a^3*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 2*(3*A*a^ 3 + B*a^3)*(d*x + c) + (6*A*a^3 + 7*B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (6*A*a^3 + 7*B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(2*A*a^3* tan(1/2*d*x + 1/2*c)^3 + 5*B*a^3*tan(1/2*d*x + 1/2*c)^3 - 2*A*a^3*tan(1/2* d*x + 1/2*c) - 7*B*a^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^ 2)/d
Time = 10.81 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.92 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {A\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {6\,A\,a^3\,\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 {6\,A\,a^3\,\mathrm {atanh}\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 {2\,B\,a^3\,\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 {7\,B\,a^3\,\mathrm {atanh}\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^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {3\,B\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2} \] Input:
int(cos(c + d*x)*(A + B/cos(c + d*x))*(a + a/cos(c + d*x))^3,x)
Output:
(A*a^3*sin(c + d*x))/d + (6*A*a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/ 2)))/d + (6*A*a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*a ^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (7*B*a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (A*a^3*sin(c + d*x))/(d*cos(c + d*x)) + (3*B*a^3*sin(c + d*x))/(d*cos(c + d*x)) + (B*a^3*sin(c + d*x))/(2*d*cos (c + d*x)^2)
Time = 0.17 (sec) , antiderivative size = 300, normalized size of antiderivative = 2.78 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^{3} \left (-2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a -6 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a -7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a +7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a +7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a -7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b +2 \sin \left (d x +c \right )^{3} a +6 \sin \left (d x +c \right )^{2} a c +6 \sin \left (d x +c \right )^{2} a d x +2 \sin \left (d x +c \right )^{2} b c +2 \sin \left (d x +c \right )^{2} b d x -2 \sin \left (d x +c \right ) a -\sin \left (d x +c \right ) b -6 a c -6 a d x -2 b c -2 b d x \right )}{2 d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:
int(cos(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x)
Output:
(a**3*( - 2*cos(c + d*x)*sin(c + d*x)*a - 6*cos(c + d*x)*sin(c + d*x)*b - 6*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a - 7*log(tan((c + d*x)/2) - 1 )*sin(c + d*x)**2*b + 6*log(tan((c + d*x)/2) - 1)*a + 7*log(tan((c + d*x)/ 2) - 1)*b + 6*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a + 7*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b - 6*log(tan((c + d*x)/2) + 1)*a - 7*log(ta n((c + d*x)/2) + 1)*b + 2*sin(c + d*x)**3*a + 6*sin(c + d*x)**2*a*c + 6*si n(c + d*x)**2*a*d*x + 2*sin(c + d*x)**2*b*c + 2*sin(c + d*x)**2*b*d*x - 2* sin(c + d*x)*a - sin(c + d*x)*b - 6*a*c - 6*a*d*x - 2*b*c - 2*b*d*x))/(2*d *(sin(c + d*x)**2 - 1))