Integrand size = 40, antiderivative size = 131 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^2 (3 b B+a C) x+\frac {b \left (6 a b B+6 a^2 C+b^2 C\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a B (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b \left (2 a^2 B-b^2 B-3 a b C\right ) \tan (c+d x)}{d}-\frac {b^2 (2 a B-b C) \sec (c+d x) \tan (c+d x)}{2 d} \] Output:
a^2*(3*B*b+C*a)*x+1/2*b*(6*B*a*b+6*C*a^2+C*b^2)*arctanh(sin(d*x+c))/d+a*B* (a+b*sec(d*x+c))^2*sin(d*x+c)/d-b*(2*B*a^2-B*b^2-3*C*a*b)*tan(d*x+c)/d-1/2 *b^2*(2*B*a-C*b)*sec(d*x+c)*tan(d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(277\) vs. \(2(131)=262\).
Time = 3.46 (sec) , antiderivative size = 277, normalized size of antiderivative = 2.11 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {4 a^2 (3 b B+a C) (c+d x)-2 b \left (6 a b B+6 a^2 C+b^2 C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 b \left (6 a b B+6 a^2 C+b^2 C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b^3 C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 b^2 (b B+3 a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}-\frac {b^3 C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 b^2 (b B+3 a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )}+4 a^3 B \sin (c+d x)}{4 d} \] Input:
Integrate[Cos[c + d*x]^2*(a + b*Sec[c + d*x])^3*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]
Output:
(4*a^2*(3*b*B + a*C)*(c + d*x) - 2*b*(6*a*b*B + 6*a^2*C + b^2*C)*Log[Cos[( c + d*x)/2] - Sin[(c + d*x)/2]] + 2*b*(6*a*b*B + 6*a^2*C + b^2*C)*Log[Cos[ (c + d*x)/2] + Sin[(c + d*x)/2]] + (b^3*C)/(Cos[(c + d*x)/2] - Sin[(c + d* x)/2])^2 + (4*b^2*(b*B + 3*a*C)*Sin[(c + d*x)/2])/(Cos[(c + d*x)/2] - Sin[ (c + d*x)/2]) - (b^3*C)/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 + (4*b^2*( b*B + 3*a*C)*Sin[(c + d*x)/2])/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]) + 4*a ^3*B*Sin[c + d*x])/(4*d)
Time = 0.66 (sec) , antiderivative size = 134, 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.200, Rules used = {3042, 4560, 3042, 4513, 25, 3042, 4536, 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 ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^3 \left (B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4560 |
\(\displaystyle \int \cos (c+d x) (a+b \sec (c+d x))^3 (B+C \sec (c+d x))dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^3 \left (B+C \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4513 |
\(\displaystyle \frac {a B \sin (c+d x) (a+b \sec (c+d x))^2}{d}-\int -\left ((a+b \sec (c+d x)) \left (-b (2 a B-b C) \sec ^2(c+d x)+b (b B+2 a C) \sec (c+d x)+a (3 b B+a C)\right )\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int (a+b \sec (c+d x)) \left (-b (2 a B-b C) \sec ^2(c+d x)+b (b B+2 a C) \sec (c+d x)+a (3 b B+a C)\right )dx+\frac {a B \sin (c+d x) (a+b \sec (c+d x))^2}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (-b (2 a B-b C) \csc \left (c+d x+\frac {\pi }{2}\right )^2+b (b B+2 a C) \csc \left (c+d x+\frac {\pi }{2}\right )+a (3 b B+a C)\right )dx+\frac {a B \sin (c+d x) (a+b \sec (c+d x))^2}{d}\) |
\(\Big \downarrow \) 4536 |
\(\displaystyle \frac {1}{2} \int \left (2 (3 b B+a C) a^2-2 b \left (2 B a^2-3 b C a-b^2 B\right ) \sec ^2(c+d x)+b \left (6 C a^2+6 b B a+b^2 C\right ) \sec (c+d x)\right )dx-\frac {b^2 (2 a B-b C) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a B \sin (c+d x) (a+b \sec (c+d x))^2}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \left (\frac {b \left (6 a^2 C+6 a b B+b^2 C\right ) \text {arctanh}(\sin (c+d x))}{d}-\frac {2 b \left (2 a^2 B-3 a b C-b^2 B\right ) \tan (c+d x)}{d}+2 a^2 x (a C+3 b B)\right )-\frac {b^2 (2 a B-b C) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a B \sin (c+d x) (a+b \sec (c+d x))^2}{d}\) |
Input:
Int[Cos[c + d*x]^2*(a + b*Sec[c + d*x])^3*(B*Sec[c + d*x] + C*Sec[c + d*x] ^2),x]
Output:
(a*B*(a + b*Sec[c + d*x])^2*Sin[c + d*x])/d - (b^2*(2*a*B - b*C)*Sec[c + d *x]*Tan[c + d*x])/(2*d) + (2*a^2*(3*b*B + a*C)*x + (b*(6*a*b*B + 6*a^2*C + b^2*C)*ArcTanh[Sin[c + d*x]])/d - (2*b*(2*a^2*B - b^2*B - 3*a*b*C)*Tan[c + d*x])/d)/2
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a*A*Cot [e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*n)), x] + Sim p[1/(d*n) Int[(a + b*Csc[e + f*x])^(m - 2)*(d*Csc[e + f*x])^(n + 1)*Simp[ a*(a*B*n - A*b*(m - n - 1)) + (2*a*b*B*n + A*(b^2*n + a^2*(1 + n)))*Csc[e + f*x] + b*(b*B*n + a*A*(m + n))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] & & LeQ[n, -1]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2 Int[Simp[2*A*a + (2*B*a + b*(2* A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a , b, e, f, A, B, C}, x]
Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_. )*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.) *(x_)]*(d_.))^(n_.), x_Symbol] :> Simp[1/b^2 Int[(a + b*Csc[e + f*x])^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Time = 1.24 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {B \,a^{3} \sin \left (d x +c \right )+a^{3} C \left (d x +c \right )+3 B \,a^{2} b \left (d x +c \right )+3 a^{2} b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 C a \,b^{2} \tan \left (d x +c \right )+B \,b^{3} \tan \left (d x +c \right )+C \,b^{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 )}{d}\) | \(141\) |
default | \(\frac {B \,a^{3} \sin \left (d x +c \right )+a^{3} C \left (d x +c \right )+3 B \,a^{2} b \left (d x +c \right )+3 a^{2} b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 C a \,b^{2} \tan \left (d x +c \right )+B \,b^{3} \tan \left (d x +c \right )+C \,b^{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 )}{d}\) | \(141\) |
parallelrisch | \(\frac {-6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B a b +C \,a^{2}+\frac {1}{6} C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B a b +C \,a^{2}+\frac {1}{6} C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+6 a^{2} \left (B b +\frac {C a}{3}\right ) x d \cos \left (2 d x +2 c \right )+\left (2 B \,b^{3}+6 C a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+B \,a^{3} \sin \left (3 d x +3 c \right )+\left (B \,a^{3}+2 C \,b^{3}\right ) \sin \left (d x +c \right )+6 a^{2} \left (B b +\frac {C a}{3}\right ) x d}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(200\) |
risch | \(3 B \,a^{2} b x +a^{3} x C -\frac {i B \,a^{3} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i B \,a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b^{2} \left (C b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 B b \,{\mathrm e}^{2 i \left (d x +c \right )}-6 C a \,{\mathrm e}^{2 i \left (d x +c \right )}-C b \,{\mathrm e}^{i \left (d x +c \right )}-2 B b -6 C a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a \,b^{2}}{d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C \,a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a \,b^{2}}{d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C \,a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}\) | \(272\) |
norman | \(\frac {\left (3 B \,a^{2} b +a^{3} C \right ) x +\left (-6 B \,a^{2} b -2 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-6 B \,a^{2} b -2 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-3 B \,a^{2} b -a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-3 B \,a^{2} b -a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (3 B \,a^{2} b +a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (12 B \,a^{2} b +4 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\frac {\left (2 B \,a^{3}-2 B \,b^{3}-6 C a \,b^{2}+C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {\left (2 B \,a^{3}+2 B \,b^{3}+6 C a \,b^{2}+C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 \left (2 B \,a^{3}-2 B \,b^{3}-6 C a \,b^{2}-C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {2 \left (2 B \,a^{3}+2 B \,b^{3}+6 C a \,b^{2}-C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {\left (6 B \,a^{3}-2 B \,b^{3}-6 C a \,b^{2}-C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}-\frac {\left (6 B \,a^{3}+2 B \,b^{3}+6 C a \,b^{2}-C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\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 )^{4}}-\frac {b \left (6 B a b +6 C \,a^{2}+C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 B a b +6 C \,a^{2}+C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(526\) |
Input:
int(cos(d*x+c)^2*(a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x,method =_RETURNVERBOSE)
Output:
1/d*(B*a^3*sin(d*x+c)+a^3*C*(d*x+c)+3*B*a^2*b*(d*x+c)+3*a^2*b*C*ln(sec(d*x +c)+tan(d*x+c))+3*B*a*b^2*ln(sec(d*x+c)+tan(d*x+c))+3*C*a*b^2*tan(d*x+c)+B *b^3*tan(d*x+c)+C*b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x +c))))
Time = 0.09 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.27 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {4 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} d x \cos \left (d x + c\right )^{2} + {\left (6 \, C a^{2} b + 6 \, B a b^{2} + C b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, C a^{2} b + 6 \, B a b^{2} + C b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, B a^{3} \cos \left (d x + c\right )^{2} + C b^{3} + 2 \, {\left (3 \, C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:
integrate(cos(d*x+c)^2*(a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")
Output:
1/4*(4*(C*a^3 + 3*B*a^2*b)*d*x*cos(d*x + c)^2 + (6*C*a^2*b + 6*B*a*b^2 + C *b^3)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (6*C*a^2*b + 6*B*a*b^2 + C*b^ 3)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*B*a^3*cos(d*x + c)^2 + C*b ^3 + 2*(3*C*a*b^2 + B*b^3)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2)
Timed out. \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)**2*(a+b*sec(d*x+c))**3*(B*sec(d*x+c)+C*sec(d*x+c)**2) ,x)
Output:
Timed out
Time = 0.04 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.29 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {4 \, {\left (d x + c\right )} C a^{3} + 12 \, {\left (d x + c\right )} B a^{2} b - C b^{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 \, C a^{2} b {\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 b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{3} \sin \left (d x + c\right ) + 12 \, C a b^{2} \tan \left (d x + c\right ) + 4 \, B b^{3} \tan \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")
Output:
1/4*(4*(d*x + c)*C*a^3 + 12*(d*x + c)*B*a^2*b - C*b^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*C*a^ 2*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 6*B*a*b^2*(log(sin(d *x + c) + 1) - log(sin(d*x + c) - 1)) + 4*B*a^3*sin(d*x + c) + 12*C*a*b^2* tan(d*x + c) + 4*B*b^3*tan(d*x + c))/d
Time = 0.27 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.84 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\frac {4 \, B 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 (C a^{3} + 3 \, B a^{2} b\right )} {\left (d x + c\right )} + {\left (6 \, C a^{2} b + 6 \, B a b^{2} + C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, C a^{2} b + 6 \, B a b^{2} + C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b^{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)^2*(a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")
Output:
1/2*(4*B*a^3*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 2*(C*a^3 + 3*B*a^2*b)*(d*x + c) + (6*C*a^2*b + 6*B*a*b^2 + C*b^3)*log(abs(tan(1/2*d *x + 1/2*c) + 1)) - (6*C*a^2*b + 6*B*a*b^2 + C*b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(6*C*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 2*B*b^3*tan(1/2*d*x + 1/2*c)^3 - C*b^3*tan(1/2*d*x + 1/2*c)^3 - 6*C*a*b^2*tan(1/2*d*x + 1/2*c) - 2*B*b^3*tan(1/2*d*x + 1/2*c) - C*b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
Time = 13.83 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.90 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\frac {B\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {C\,b^3\,\sin \left (c+d\,x\right )}{2}+\frac {3\,C\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {2\,\left (-C\,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 )+\frac {C\,b^3\,\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 )\,1{}\mathrm {i}}{2}-3\,B\,a^2\,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 )+B\,a\,b^2\,\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 )\,3{}\mathrm {i}+C\,a^2\,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 )\,3{}\mathrm {i}\right )}{d} \] Input:
int(cos(c + d*x)^2*(B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + b/cos(c + d*x) )^3,x)
Output:
((B*a^3*sin(3*c + 3*d*x))/4 + (B*b^3*sin(2*c + 2*d*x))/2 + (B*a^3*sin(c + d*x))/4 + (C*b^3*sin(c + d*x))/2 + (3*C*a*b^2*sin(2*c + 2*d*x))/2)/(d*(cos (2*c + 2*d*x)/2 + 1/2)) - (2*((C*b^3*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*1i)/2 - C*a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) - 3* B*a^2*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) + B*a*b^2*atan((sin(c/ 2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*3i + C*a^2*b*atan((sin(c/2 + (d*x)/2) *1i)/cos(c/2 + (d*x)/2))*3i))/d
Time = 0.15 (sec) , antiderivative size = 460, normalized size of antiderivative = 3.51 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {-6 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a \,b^{2} c -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a^{2} b c +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a^{2} b c +2 \sin \left (d x +c \right )^{2} a^{3} c^{2}-6 a^{2} b^{2} c +6 \sin \left (d x +c \right )^{2} a^{2} b^{2} c -2 a^{3} c d x -6 a^{2} b^{2} d x +2 \sin \left (d x +c \right )^{2} a^{3} c d x -\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{3} c +2 \sin \left (d x +c \right )^{3} a^{3} b -2 \sin \left (d x +c \right ) a^{3} b -\sin \left (d x +c \right ) b^{3} c +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \,b^{3}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{3} c -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a \,b^{3}-6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a \,b^{3}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{3} c +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2} b c +6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a \,b^{3}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{3} c -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2} b c +6 \sin \left (d x +c \right )^{2} a^{2} b^{2} d x -2 a^{3} c^{2}-2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{4}}{2 d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:
int(cos(d*x+c)^2*(a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x)
Output:
( - 6*cos(c + d*x)*sin(c + d*x)*a*b**2*c - 2*cos(c + d*x)*sin(c + d*x)*b** 4 - 6*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**2*b*c - 6*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a*b**3 - log(tan((c + d*x)/2) - 1)*sin(c + d* x)**2*b**3*c + 6*log(tan((c + d*x)/2) - 1)*a**2*b*c + 6*log(tan((c + d*x)/ 2) - 1)*a*b**3 + log(tan((c + d*x)/2) - 1)*b**3*c + 6*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**2*b*c + 6*log(tan((c + d*x)/2) + 1)*sin(c + d*x)* *2*a*b**3 + log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**3*c - 6*log(tan(( c + d*x)/2) + 1)*a**2*b*c - 6*log(tan((c + d*x)/2) + 1)*a*b**3 - log(tan(( c + d*x)/2) + 1)*b**3*c + 2*sin(c + d*x)**3*a**3*b + 2*sin(c + d*x)**2*a** 3*c**2 + 2*sin(c + d*x)**2*a**3*c*d*x + 6*sin(c + d*x)**2*a**2*b**2*c + 6* sin(c + d*x)**2*a**2*b**2*d*x - 2*sin(c + d*x)*a**3*b - sin(c + d*x)*b**3* c - 2*a**3*c**2 - 2*a**3*c*d*x - 6*a**2*b**2*c - 6*a**2*b**2*d*x)/(2*d*(si n(c + d*x)**2 - 1))