Integrand size = 40, antiderivative size = 74 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=a^2 (B+2 C) x+\frac {a^2 (2 B+C) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d} \] Output:
a^2*(B+2*C)*x+a^2*(2*B+C)*arctanh(sin(d*x+c))/d-a^2*(B-C)*sin(d*x+c)/d+B*( a^2+a^2*cos(d*x+c))*tan(d*x+c)/d
Time = 2.23 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.93 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {a^2 \left (B c+2 c C+B d x+2 C d x-2 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+C \sin (c+d x)+B \tan (c+d x)\right )}{d} \] Input:
Integrate[(a + a*Cos[c + d*x])^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^3,x]
Output:
(a^2*(B*c + 2*c*C + B*d*x + 2*C*d*x - 2*B*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - C*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 2*B*Log[Cos[(c + d *x)/2] + Sin[(c + d*x)/2]] + C*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + C*Sin[c + d*x] + B*Tan[c + d*x]))/d
Time = 0.82 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3042, 3508, 3042, 3454, 3042, 3447, 3042, 3502, 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 ^3(c+d x) (a \cos (c+d x)+a)^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \sec ^2(c+d x) (a \cos (c+d x)+a)^2 (B+C \cos (c+d x))dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3454 |
\(\displaystyle \int (\cos (c+d x) a+a) (a (2 B+C)-a (B-C) \cos (c+d x)) \sec (c+d x)dx+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (a (2 B+C)-a (B-C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \int \left (-\left ((B-C) \cos ^2(c+d x) a^2\right )+(2 B+C) a^2+\left (a^2 (2 B+C)-a^2 (B-C)\right ) \cos (c+d x)\right ) \sec (c+d x)dx+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {-\left ((B-C) \sin \left (c+d x+\frac {\pi }{2}\right )^2 a^2\right )+(2 B+C) a^2+\left (a^2 (2 B+C)-a^2 (B-C)\right ) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \int \left ((2 B+C) a^2+(B+2 C) \cos (c+d x) a^2\right ) \sec (c+d x)dx-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(2 B+C) a^2+(B+2 C) \sin \left (c+d x+\frac {\pi }{2}\right ) a^2}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle a^2 (2 B+C) \int \sec (c+d x)dx-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}+a^2 x (B+2 C)\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^2 (2 B+C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}+a^2 x (B+2 C)\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {a^2 (2 B+C) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}+a^2 x (B+2 C)\) |
Input:
Int[(a + a*Cos[c + d*x])^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x ]^3,x]
Output:
a^2*(B + 2*C)*x + (a^2*(2*B + C)*ArcTanh[Sin[c + d*x]])/d - (a^2*(B - C)*S in[c + d*x])/d + (B*(a^2 + a^2*Cos[c + d*x])*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_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[(-b^2)*(B*c - A*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[ e + f*x])^(n + 1)/(d*f*(n + 1)*(b*c + a*d))), x] - Simp[b/(d*(n + 1)*(b*c + a*d)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp [a*A*d*(m - n - 2) - B*(a*c*(m - 1) + b*d*(n + 1)) - (A*b*d*(m + n + 1) - B *(b*c*m - a*d*(n + 1)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f , A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1/2] && LtQ[n, -1] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0 ])
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[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]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 1.11 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.09
method | result | size |
parts | \(\frac {\left (B \,a^{2}+2 a^{2} C \right ) \left (d x +c \right )}{d}+\frac {\left (2 B \,a^{2}+a^{2} C \right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} B \tan \left (d x +c \right )}{d}+\frac {\sin \left (d x +c \right ) a^{2} C}{d}\) | \(81\) |
derivativedivides | \(\frac {a^{2} C \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+2 a^{2} C \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )}{d}\) | \(88\) |
default | \(\frac {a^{2} C \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+2 a^{2} C \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )}{d}\) | \(88\) |
parallelrisch | \(-\frac {2 a^{2} \left (\cos \left (d x +c \right ) \left (B +\frac {C}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\cos \left (d x +c \right ) \left (B +\frac {C}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {C \sin \left (2 d x +2 c \right )}{4}-\frac {d x \left (B +2 C \right ) \cos \left (d x +c \right )}{2}-\frac {B \sin \left (d x +c \right )}{2}\right )}{\cos \left (d x +c \right ) d}\) | \(103\) |
risch | \(a^{2} x B +2 a^{2} C x -\frac {i a^{2} C \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} C \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i B \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 B \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {2 B \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(163\) |
norman | \(\frac {\left (B \,a^{2}+2 a^{2} C \right ) x +\left (-4 B \,a^{2}-8 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (-B \,a^{2}-2 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-B \,a^{2}-2 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (B \,a^{2}+2 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (2 B \,a^{2}+4 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (2 B \,a^{2}+4 a^{2} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\frac {4 a^{2} \left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {2 a^{2} \left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {2 a^{2} \left (B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 a^{2} \left (B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {2 a^{2} \left (3 B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}+\frac {2 a^{2} \left (3 B +C \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 )^{4} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}+\frac {a^{2} \left (2 B +C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \left (2 B +C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(392\) |
Input:
int((a+a*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x,method =_RETURNVERBOSE)
Output:
(B*a^2+2*C*a^2)/d*(d*x+c)+(2*B*a^2+C*a^2)/d*ln(sec(d*x+c)+tan(d*x+c))+a^2* B*tan(d*x+c)/d+1/d*sin(d*x+c)*a^2*C
Time = 0.08 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.46 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {2 \, {\left (B + 2 \, C\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (C a^{2} \cos \left (d x + c\right ) + B a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:
integrate((a+a*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="fricas")
Output:
1/2*(2*(B + 2*C)*a^2*d*x*cos(d*x + c) + (2*B + C)*a^2*cos(d*x + c)*log(sin (d*x + c) + 1) - (2*B + C)*a^2*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*(C* a^2*cos(d*x + c) + B*a^2)*sin(d*x + c))/(d*cos(d*x + c))
\[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=a^{2} \left (\int B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 2 B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos ^{3}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 2 C \cos ^{3}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{4}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate((a+a*cos(d*x+c))**2*(B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**3 ,x)
Output:
a**2*(Integral(B*cos(c + d*x)*sec(c + d*x)**3, x) + Integral(2*B*cos(c + d *x)**2*sec(c + d*x)**3, x) + Integral(B*cos(c + d*x)**3*sec(c + d*x)**3, x ) + Integral(C*cos(c + d*x)**2*sec(c + d*x)**3, x) + Integral(2*C*cos(c + d*x)**3*sec(c + d*x)**3, x) + Integral(C*cos(c + d*x)**4*sec(c + d*x)**3, x))
Time = 0.05 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.42 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {2 \, {\left (d x + c\right )} B a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + C a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, C a^{2} \sin \left (d x + c\right ) + 2 \, B a^{2} \tan \left (d x + c\right )}{2 \, d} \] Input:
integrate((a+a*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="maxima")
Output:
1/2*(2*(d*x + c)*B*a^2 + 4*(d*x + c)*C*a^2 + 2*B*a^2*(log(sin(d*x + c) + 1 ) - log(sin(d*x + c) - 1)) + C*a^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*C*a^2*sin(d*x + c) + 2*B*a^2*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (74) = 148\).
Time = 0.15 (sec) , antiderivative size = 155, normalized size of antiderivative = 2.09 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {{\left (B a^{2} + 2 \, C a^{2}\right )} {\left (d x + c\right )} + {\left (2 \, B a^{2} + C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a^{2} + C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \] Input:
integrate((a+a*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="giac")
Output:
((B*a^2 + 2*C*a^2)*(d*x + c) + (2*B*a^2 + C*a^2)*log(abs(tan(1/2*d*x + 1/2 *c) + 1)) - (2*B*a^2 + C*a^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(B*a^ 2*tan(1/2*d*x + 1/2*c)^3 - C*a^2*tan(1/2*d*x + 1/2*c)^3 + B*a^2*tan(1/2*d* x + 1/2*c) + C*a^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^4 - 1))/d
Time = 0.29 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.18 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {2\,B\,a^2\,\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 {4\,B\,a^2\,\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 {4\,C\,a^2\,\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 {2\,C\,a^2\,\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 {B\,a^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \] Input:
int(((B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2)/cos(c + d *x)^3,x)
Output:
(C*a^2*sin(c + d*x))/d + (2*B*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/ 2)))/d + (4*B*a^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (4*C*a ^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*C*a^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (B*a^2*sin(c + d*x))/(d*cos(c + d*x))
Time = 0.24 (sec) , antiderivative size = 162, normalized size of antiderivative = 2.19 \[ \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {a^{2} \left (-2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b -\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) c +2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) c +\cos \left (d x +c \right ) \sin \left (d x +c \right ) c +\cos \left (d x +c \right ) b c +\cos \left (d x +c \right ) b d x +2 \cos \left (d x +c \right ) c^{2}+2 \cos \left (d x +c \right ) c d x +\sin \left (d x +c \right ) b \right )}{\cos \left (d x +c \right ) d} \] Input:
int((a+a*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x)
Output:
(a**2*( - 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b - cos(c + d*x)*log(ta n((c + d*x)/2) - 1)*c + 2*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*b + cos(c + d*x)*log(tan((c + d*x)/2) + 1)*c + cos(c + d*x)*sin(c + d*x)*c + cos(c + d*x)*b*c + cos(c + d*x)*b*d*x + 2*cos(c + d*x)*c**2 + 2*cos(c + d*x)*c*d *x + sin(c + d*x)*b))/(cos(c + d*x)*d)