Integrand size = 29, antiderivative size = 27 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=C x+\frac {B \text {arctanh}(\sin (c+d x))}{d}+\frac {A \tan (c+d x)}{d} \] Output:
C*x+B*arctanh(sin(d*x+c))/d+A*tan(d*x+c)/d
Time = 0.02 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=C x+\frac {B \coth ^{-1}(\sin (c+d x))}{d}+\frac {A \tan (c+d x)}{d} \] Input:
Integrate[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]
Output:
C*x + (B*ArcCoth[Sin[c + d*x]])/d + (A*Tan[c + d*x])/d
Time = 0.34 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {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) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \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 (B+C \cos (c+d x)) \sec (c+d x)dx+\frac {A \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B+C \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {A \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle B \int \sec (c+d x)dx+\frac {A \tan (c+d x)}{d}+C x\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle B \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {A \tan (c+d x)}{d}+C x\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {A \tan (c+d x)}{d}+\frac {B \text {arctanh}(\sin (c+d x))}{d}+C x\) |
Input:
Int[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]
Output:
C*x + (B*ArcTanh[Sin[c + d*x]])/d + (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_.)*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 = 0.37 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.37
method | result | size |
derivativedivides | \(\frac {A \tan \left (d x +c \right )+B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \left (d x +c \right )}{d}\) | \(37\) |
default | \(\frac {A \tan \left (d x +c \right )+B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \left (d x +c \right )}{d}\) | \(37\) |
parts | \(\frac {A \tan \left (d x +c \right )}{d}+\frac {B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {C \left (d x +c \right )}{d}\) | \(42\) |
risch | \(C x +\frac {2 i A}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {B \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {B \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(62\) |
parallelrisch | \(\frac {A \sin \left (d x +c \right )-\cos \left (d x +c \right ) B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\cos \left (d x +c \right ) B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+d x C \cos \left (d x +c \right )}{d \cos \left (d x +c \right )}\) | \(73\) |
norman | \(\frac {C x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+C x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-C x -\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-C 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 {B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(165\) |
Input:
int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/d*(A*tan(d*x+c)+B*ln(sec(d*x+c)+tan(d*x+c))+C*(d*x+c))
Leaf count of result is larger than twice the leaf count of optimal. 71 vs. \(2 (27) = 54\).
Time = 0.11 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.63 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {2 \, C d x \cos \left (d x + c\right ) + B \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - B \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="frica s")
Output:
1/2*(2*C*d*x*cos(d*x + c) + B*cos(d*x + c)*log(sin(d*x + c) + 1) - B*cos(d *x + c)*log(-sin(d*x + c) + 1) + 2*A*sin(d*x + c))/(d*cos(d*x + c))
\[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\int \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**2,x)
Output:
Integral((A + B*cos(c + d*x) + C*cos(c + d*x)**2)*sec(c + d*x)**2, x)
Time = 0.04 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.70 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {2 \, {\left (d x + c\right )} C + 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 \tan \left (d x + c\right )}{2 \, d} \] Input:
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="maxim a")
Output:
1/2*(2*(d*x + c)*C + B*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2 *A*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (27) = 54\).
Time = 0.13 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.59 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} C + B \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - B \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, 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)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="giac" )
Output:
((d*x + c)*C + B*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - B*log(abs(tan(1/2*d* x + 1/2*c) - 1)) - 2*A*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 1))/ d
Time = 0.26 (sec) , antiderivative size = 161, normalized size of antiderivative = 5.96 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {2\,B\,\mathrm {atanh}\left (\frac {64\,B^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,B^3+64\,B\,C^2}+\frac {64\,B\,C^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,B^3+64\,B\,C^2}\right )}{d}+\frac {2\,C\,\mathrm {atan}\left (\frac {64\,C^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,B^2\,C+64\,C^3}+\frac {64\,B^2\,C\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,B^2\,C+64\,C^3}\right )}{d}-\frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \] Input:
int((A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^2,x)
Output:
(2*B*atanh((64*B^3*tan(c/2 + (d*x)/2))/(64*B*C^2 + 64*B^3) + (64*B*C^2*tan (c/2 + (d*x)/2))/(64*B*C^2 + 64*B^3)))/d + (2*C*atan((64*C^3*tan(c/2 + (d* x)/2))/(64*B^2*C + 64*C^3) + (64*B^2*C*tan(c/2 + (d*x)/2))/(64*B^2*C + 64* C^3)))/d - (2*A*tan(c/2 + (d*x)/2))/(d*(tan(c/2 + (d*x)/2)^2 - 1))
Time = 0.17 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.67 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {-\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 ) b +\cos \left (d x +c \right ) c d x +\sin \left (d x +c \right ) a}{\cos \left (d x +c \right ) d} \] Input:
int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x)
Output:
( - cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b + cos(c + d*x)*log(tan((c + d *x)/2) + 1)*b + cos(c + d*x)*c*d*x + sin(c + d*x)*a)/(cos(c + d*x)*d)