Integrand size = 40, antiderivative size = 122 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {3 (B-C) x}{2 a}-\frac {(3 B-4 C) \sin (c+d x)}{a d}+\frac {3 (B-C) \cos (c+d x) \sin (c+d x)}{2 a d}+\frac {(B-C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \cos (c+d x))}+\frac {(3 B-4 C) \sin ^3(c+d x)}{3 a d} \] Output:
3/2*(B-C)*x/a-(3*B-4*C)*sin(d*x+c)/a/d+3/2*(B-C)*cos(d*x+c)*sin(d*x+c)/a/d +(B-C)*cos(d*x+c)^3*sin(d*x+c)/d/(a+a*cos(d*x+c))+1/3*(3*B-4*C)*sin(d*x+c) ^3/a/d
Leaf count is larger than twice the leaf count of optimal. \(249\) vs. \(2(122)=244\).
Time = 1.55 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.04 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (36 (B-C) d x \cos \left (\frac {d x}{2}\right )+36 (B-C) d x \cos \left (c+\frac {d x}{2}\right )-60 B \sin \left (\frac {d x}{2}\right )+69 C \sin \left (\frac {d x}{2}\right )-12 B \sin \left (c+\frac {d x}{2}\right )+21 C \sin \left (c+\frac {d x}{2}\right )-9 B \sin \left (c+\frac {3 d x}{2}\right )+18 C \sin \left (c+\frac {3 d x}{2}\right )-9 B \sin \left (2 c+\frac {3 d x}{2}\right )+18 C \sin \left (2 c+\frac {3 d x}{2}\right )+3 B \sin \left (2 c+\frac {5 d x}{2}\right )-2 C \sin \left (2 c+\frac {5 d x}{2}\right )+3 B \sin \left (3 c+\frac {5 d x}{2}\right )-2 C \sin \left (3 c+\frac {5 d x}{2}\right )+C \sin \left (3 c+\frac {7 d x}{2}\right )+C \sin \left (4 c+\frac {7 d x}{2}\right )\right )}{24 a d (1+\cos (c+d x))} \] Input:
Integrate[(Cos[c + d*x]^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2))/(a + a*Cos[ c + d*x]),x]
Output:
(Cos[(c + d*x)/2]*Sec[c/2]*(36*(B - C)*d*x*Cos[(d*x)/2] + 36*(B - C)*d*x*C os[c + (d*x)/2] - 60*B*Sin[(d*x)/2] + 69*C*Sin[(d*x)/2] - 12*B*Sin[c + (d* x)/2] + 21*C*Sin[c + (d*x)/2] - 9*B*Sin[c + (3*d*x)/2] + 18*C*Sin[c + (3*d *x)/2] - 9*B*Sin[2*c + (3*d*x)/2] + 18*C*Sin[2*c + (3*d*x)/2] + 3*B*Sin[2* c + (5*d*x)/2] - 2*C*Sin[2*c + (5*d*x)/2] + 3*B*Sin[3*c + (5*d*x)/2] - 2*C *Sin[3*c + (5*d*x)/2] + C*Sin[3*c + (7*d*x)/2] + C*Sin[4*c + (7*d*x)/2]))/ (24*a*d*(1 + Cos[c + d*x]))
Time = 0.71 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.88, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.275, Rules used = {3042, 3508, 3042, 3456, 3042, 3227, 3042, 3113, 2009, 3115, 24}
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 \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a \cos (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\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 )}{a \sin \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \frac {\cos ^3(c+d x) (B+C \cos (c+d x))}{a \cos (c+d x)+a}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )^3 \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{a \sin \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 3456 |
\(\displaystyle \frac {\int \cos ^2(c+d x) (3 a (B-C)-a (3 B-4 C) \cos (c+d x))dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (3 a (B-C)-a (3 B-4 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {3 a (B-C) \int \cos ^2(c+d x)dx-a (3 B-4 C) \int \cos ^3(c+d x)dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {3 a (B-C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-a (3 B-4 C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^3dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3113 |
\(\displaystyle \frac {\frac {a (3 B-4 C) \int \left (1-\sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}+3 a (B-C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {3 a (B-C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx+\frac {a (3 B-4 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {3 a (B-C) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {a (3 B-4 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {a (3 B-4 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}+3 a (B-C) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^3(c+d x)}{d (a \cos (c+d x)+a)}\) |
Input:
Int[(Cos[c + d*x]^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2))/(a + a*Cos[c + d* x]),x]
Output:
((B - C)*Cos[c + d*x]^3*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])) + (3*a*(B - C)*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)) + (a*(3*B - 4*C)*(-Sin[c + d *x] + Sin[c + d*x]^3/3))/d)/a^2
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
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[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^n/( a*f*(2*m + 1))), x] - Simp[1/(a*b*(2*m + 1)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n - 1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x], x] /; Fre eQ[{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] && LtQ[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (In tegerQ[2*n] || EqQ[c, 0])
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]
Time = 0.37 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.64
method | result | size |
parallelrisch | \(\frac {\left (\left (3 B -C \right ) \cos \left (2 d x +2 c \right )+\cos \left (3 d x +3 c \right ) C +\left (-6 B +17 C \right ) \cos \left (d x +c \right )-21 B +31 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+18 d x \left (B -C \right )}{12 d a}\) | \(78\) |
derivativedivides | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \left (-\frac {3 B}{2}+\frac {5 C}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+2 \left (-2 B +\frac {8 C}{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+2 \left (-\frac {B}{2}+\frac {3 C}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+3 \left (B -C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(122\) |
default | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \left (-\frac {3 B}{2}+\frac {5 C}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+2 \left (-2 B +\frac {8 C}{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+2 \left (-\frac {B}{2}+\frac {3 C}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+3 \left (B -C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(122\) |
risch | \(\frac {3 x B}{2 a}-\frac {3 C x}{2 a}+\frac {i {\mathrm e}^{i \left (d x +c \right )} B}{2 a d}-\frac {7 i {\mathrm e}^{i \left (d x +c \right )} C}{8 a d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a d}+\frac {7 i {\mathrm e}^{-i \left (d x +c \right )} C}{8 a d}-\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {C \sin \left (3 d x +3 c \right )}{12 a d}+\frac {\sin \left (2 d x +2 c \right ) B}{4 a d}-\frac {\sin \left (2 d x +2 c \right ) C}{4 a d}\) | \(192\) |
norman | \(\frac {\frac {3 \left (B -C \right ) x}{2 a}-\frac {2 \left (B -2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{a d}+\frac {6 \left (B -C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {9 \left (B -C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a}+\frac {6 \left (B -C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{a}+\frac {3 \left (B -C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{2 a}-\frac {\left (7 B -9 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{a d}-\frac {\left (27 B -37 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}-\frac {\left (39 B -49 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) | \(241\) |
Input:
int(cos(d*x+c)^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c)),x,method=_ RETURNVERBOSE)
Output:
1/12*(((3*B-C)*cos(2*d*x+2*c)+cos(3*d*x+3*c)*C+(-6*B+17*C)*cos(d*x+c)-21*B +31*C)*tan(1/2*d*x+1/2*c)+18*d*x*(B-C))/d/a
Time = 0.08 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.80 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {9 \, {\left (B - C\right )} d x \cos \left (d x + c\right ) + 9 \, {\left (B - C\right )} d x + {\left (2 \, C \cos \left (d x + c\right )^{3} + {\left (3 \, B - C\right )} \cos \left (d x + c\right )^{2} - {\left (3 \, B - 7 \, C\right )} \cos \left (d x + c\right ) - 12 \, B + 16 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \] Input:
integrate(cos(d*x+c)^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c)),x, a lgorithm="fricas")
Output:
1/6*(9*(B - C)*d*x*cos(d*x + c) + 9*(B - C)*d*x + (2*C*cos(d*x + c)^3 + (3 *B - C)*cos(d*x + c)^2 - (3*B - 7*C)*cos(d*x + c) - 12*B + 16*C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)
Leaf count of result is larger than twice the leaf count of optimal. 1166 vs. \(2 (105) = 210\).
Time = 1.64 (sec) , antiderivative size = 1166, normalized size of antiderivative = 9.56 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\text {Too large to display} \] Input:
integrate(cos(d*x+c)**2*(B*cos(d*x+c)+C*cos(d*x+c)**2)/(a+a*cos(d*x+c)),x)
Output:
Piecewise((9*B*d*x*tan(c/2 + d*x/2)**6/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d *tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) + 27*B*d*x*tan( c/2 + d*x/2)**4/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) + 27*B*d*x*tan(c/2 + d*x/2)**2/(6*a*d* tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2) **2 + 6*a*d) + 9*B*d*x/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2 )**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) - 6*B*tan(c/2 + d*x/2)**7/(6*a* d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/ 2)**2 + 6*a*d) - 36*B*tan(c/2 + d*x/2)**5/(6*a*d*tan(c/2 + d*x/2)**6 + 18* a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) - 42*B*tan(c /2 + d*x/2)**3/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 1 8*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) - 12*B*tan(c/2 + d*x/2)/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6* a*d) - 9*C*d*x*tan(c/2 + d*x/2)**6/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan (c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) - 27*C*d*x*tan(c/2 + d*x/2)**4/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a *d*tan(c/2 + d*x/2)**2 + 6*a*d) - 27*C*d*x*tan(c/2 + d*x/2)**2/(6*a*d*tan( c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) - 9*C*d*x/(6*a*d*tan(c/2 + d*x/2)**6 + 18*a*d*tan(c/2 + d*x/2)**4 + 18*a*d*tan(c/2 + d*x/2)**2 + 6*a*d) + 6*C*tan(c/2 + d*x/2)**7/(6*a*d...
Leaf count of result is larger than twice the leaf count of optimal. 310 vs. \(2 (116) = 232\).
Time = 0.13 (sec) , antiderivative size = 310, normalized size of antiderivative = 2.54 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {C {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {16 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a + \frac {3 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {9 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {3 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 3 \, B {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{3 \, d} \] Input:
integrate(cos(d*x+c)^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c)),x, a lgorithm="maxima")
Output:
1/3*(C*((9*sin(d*x + c)/(cos(d*x + c) + 1) + 16*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 15*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/(a + 3*a*sin(d*x + c)^ 2/(cos(d*x + c) + 1)^2 + 3*a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + a*sin(d *x + c)^6/(cos(d*x + c) + 1)^6) - 9*arctan(sin(d*x + c)/(cos(d*x + c) + 1) )/a + 3*sin(d*x + c)/(a*(cos(d*x + c) + 1))) - 3*B*((sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a + 2*a*sin(d*x + c)^ 2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) - 3*arctan (sin(d*x + c)/(cos(d*x + c) + 1))/a + sin(d*x + c)/(a*(cos(d*x + c) + 1))) )/d
Time = 0.12 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.24 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\frac {9 \, {\left (d x + c\right )} {\left (B - C\right )}}{a} - \frac {6 \, {\left (B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (9 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, C \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 )}^{3} a}}{6 \, d} \] Input:
integrate(cos(d*x+c)^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c)),x, a lgorithm="giac")
Output:
1/6*(9*(d*x + c)*(B - C)/a - 6*(B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1 /2*c))/a - 2*(9*B*tan(1/2*d*x + 1/2*c)^5 - 15*C*tan(1/2*d*x + 1/2*c)^5 + 1 2*B*tan(1/2*d*x + 1/2*c)^3 - 16*C*tan(1/2*d*x + 1/2*c)^3 + 3*B*tan(1/2*d*x + 1/2*c) - 9*C*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 + 1)^3*a))/ d
Time = 0.91 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.13 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {3\,x\,\left (B-C\right )}{2\,a}-\frac {\left (3\,B-5\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (4\,B-\frac {16\,C}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (B-3\,C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a\,d} \] Input:
int((cos(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d* x)),x)
Output:
(3*x*(B - C))/(2*a) - (tan(c/2 + (d*x)/2)^5*(3*B - 5*C) + tan(c/2 + (d*x)/ 2)^3*(4*B - (16*C)/3) + tan(c/2 + (d*x)/2)*(B - 3*C))/(d*(a + 3*a*tan(c/2 + (d*x)/2)^2 + 3*a*tan(c/2 + (d*x)/2)^4 + a*tan(c/2 + (d*x)/2)^6)) - (tan( c/2 + (d*x)/2)*(B - C))/(a*d)
Time = 0.17 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.07 \[ \int \frac {\cos ^2(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {3 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b -3 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} c +6 \cos \left (d x +c \right ) b -6 \cos \left (d x +c \right ) c -2 \sin \left (d x +c \right )^{4} c -6 \sin \left (d x +c \right )^{2} b +12 \sin \left (d x +c \right )^{2} c +9 \sin \left (d x +c \right ) b d x -9 \sin \left (d x +c \right ) c d x -6 b +6 c}{6 \sin \left (d x +c \right ) a d} \] Input:
int(cos(d*x+c)^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c)),x)
Output:
(3*cos(c + d*x)*sin(c + d*x)**2*b - 3*cos(c + d*x)*sin(c + d*x)**2*c + 6*c os(c + d*x)*b - 6*cos(c + d*x)*c - 2*sin(c + d*x)**4*c - 6*sin(c + d*x)**2 *b + 12*sin(c + d*x)**2*c + 9*sin(c + d*x)*b*d*x - 9*sin(c + d*x)*c*d*x - 6*b + 6*c)/(6*sin(c + d*x)*a*d)