Integrand size = 27, antiderivative size = 27 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=B x+\frac {A \text {arctanh}(\sin (c+d x))}{d}+\frac {C \sin (c+d x)}{d} \] Output:
B*x+A*arctanh(sin(d*x+c))/d+C*sin(d*x+c)/d
Time = 0.02 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.41 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=B x+\frac {A \coth ^{-1}(\sin (c+d x))}{d}+\frac {C \cos (d x) \sin (c)}{d}+\frac {C \cos (c) \sin (d x)}{d} \] Input:
Integrate[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x],x]
Output:
B*x + (A*ArcCoth[Sin[c + d*x]])/d + (C*Cos[d*x]*Sin[c])/d + (C*Cos[c]*Sin[ d*x])/d
Time = 0.32 (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.222, Rules used = {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 (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 )}dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \int (A+B \cos (c+d x)) \sec (c+d x)dx+\frac {C \sin (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {C \sin (c+d x)}{d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle A \int \sec (c+d x)dx+B x+\frac {C \sin (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+B x+\frac {C \sin (c+d x)}{d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {A \text {arctanh}(\sin (c+d x))}{d}+B x+\frac {C \sin (c+d x)}{d}\) |
Input:
Int[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x],x]
Output:
B*x + (A*ArcTanh[Sin[c + d*x]])/d + (C*Sin[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[(-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[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.37
method | result | size |
derivativedivides | \(\frac {A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \left (d x +c \right )+C \sin \left (d x +c \right )}{d}\) | \(37\) |
default | \(\frac {A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \left (d x +c \right )+C \sin \left (d x +c \right )}{d}\) | \(37\) |
parts | \(\frac {A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {B \left (d x +c \right )}{d}+\frac {C \sin \left (d x +c \right )}{d}\) | \(42\) |
parallelrisch | \(\frac {B x d +A \left (-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )\right )+C \sin \left (d x +c \right )}{d}\) | \(47\) |
risch | \(B x -\frac {i C \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i C \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(74\) |
norman | \(\frac {B x +B x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+2 B x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {2 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 C \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}}+\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(118\) |
Input:
int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x,method=_RETURNVERBOSE)
Output:
1/d*(A*ln(sec(d*x+c)+tan(d*x+c))+B*(d*x+c)+C*sin(d*x+c))
Time = 0.09 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.67 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 \, B d x + A \log \left (\sin \left (d x + c\right ) + 1\right ) - A \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, C \sin \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),x, algorithm="fricas" )
Output:
1/2*(2*B*d*x + A*log(sin(d*x + c) + 1) - A*log(-sin(d*x + c) + 1) + 2*C*si n(d*x + c))/d
\[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \] Input:
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c),x)
Output:
Integral((A + B*cos(c + d*x) + C*cos(c + d*x)**2)*sec(c + d*x), x)
Time = 0.04 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.33 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {{\left (d x + c\right )} B + A \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + C \sin \left (d x + c\right )}{d} \] Input:
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x, algorithm="maxima" )
Output:
((d*x + c)*B + A*log(sec(d*x + c) + tan(d*x + c)) + C*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (27) = 54\).
Time = 0.16 (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 (c+d x) \, dx=\frac {{\left (d x + c\right )} B + A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, C \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),x, algorithm="giac")
Output:
((d*x + c)*B + A*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - A*log(abs(tan(1/2*d* x + 1/2*c) - 1)) + 2*C*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/ d
Time = 0.25 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.52 \[ \int \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2\,A\,\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\,\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 {C\,\sin \left (c+d\,x\right )}{d} \] Input:
int((A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x),x)
Output:
(2*A*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (C*sin(c + d*x))/d
Time = 0.16 (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 (c+d x) \, dx=\frac {-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a +\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a +\sin \left (d x +c \right ) c +b d x}{d} \] Input:
int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x)
Output:
( - log(tan((c + d*x)/2) - 1)*a + log(tan((c + d*x)/2) + 1)*a + sin(c + d* x)*c + b*d*x)/d