Integrand size = 21, antiderivative size = 33 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=b^2 x+\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d} \] Output:
b^2*x+2*a*b*arctanh(sin(d*x+c))/d+a^2*tan(d*x+c)/d
Time = 0.10 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.97 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {b^2 d x+2 a b \coth ^{-1}(\sin (c+d x))+a^2 \tan (c+d x)}{d} \] Input:
Integrate[(a + b*Cos[c + d*x])^2*Sec[c + d*x]^2,x]
Output:
(b^2*d*x + 2*a*b*ArcCoth[Sin[c + d*x]] + a^2*Tan[c + d*x])/d
Time = 0.33 (sec) , antiderivative size = 33, 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.286, Rules used = {3042, 3268, 3042, 3491, 24, 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) (a+b \cos (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3268 |
\(\displaystyle \int \left (a^2+b^2 \cos ^2(c+d x)\right ) \sec ^2(c+d x)dx+2 a b \int \sec (c+d x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a^2+b^2 \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx+2 a b \int \csc \left (c+d x+\frac {\pi }{2}\right )dx\) |
\(\Big \downarrow \) 3491 |
\(\displaystyle 2 a b \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+b^2 \int 1dx+\frac {a^2 \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle 2 a b \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {a^2 \tan (c+d x)}{d}+b^2 x\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {a^2 \tan (c+d x)}{d}+\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}+b^2 x\) |
Input:
Int[(a + b*Cos[c + d*x])^2*Sec[c + d*x]^2,x]
Output:
b^2*x + (2*a*b*ArcTanh[Sin[c + d*x]])/d + (a^2*Tan[c + d*x])/d
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)])^2, x_Symbol] :> Simp[2*c*(d/b) Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x _)]^2), x_Symbol] :> Simp[A*Cos[e + f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Simp[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)) Int[(b*Sin[e + f* x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 2.96 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.30
method | result | size |
derivativedivides | \(\frac {\tan \left (d x +c \right ) a^{2}+2 a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b^{2} \left (d x +c \right )}{d}\) | \(43\) |
default | \(\frac {\tan \left (d x +c \right ) a^{2}+2 a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b^{2} \left (d x +c \right )}{d}\) | \(43\) |
parts | \(\frac {a^{2} \tan \left (d x +c \right )}{d}+\frac {b^{2} \left (d x +c \right )}{d}+\frac {2 a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(48\) |
risch | \(b^{2} x +\frac {2 i a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(69\) |
parallelrisch | \(\frac {2 \cos \left (d x +c \right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-2 \cos \left (d x +c \right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\cos \left (d x +c \right ) b^{2} d x +a^{2} \sin \left (d x +c \right )}{\cos \left (d x +c \right ) d}\) | \(80\) |
norman | \(\frac {b^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+b^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-b^{2} x -\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-b^{2} 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 {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(182\) |
Input:
int((a+cos(d*x+c)*b)^2*sec(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/d*(tan(d*x+c)*a^2+2*a*b*ln(sec(d*x+c)+tan(d*x+c))+b^2*(d*x+c))
Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (33) = 66\).
Time = 0.09 (sec) , antiderivative size = 74, normalized size of antiderivative = 2.24 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {b^{2} d x \cos \left (d x + c\right ) + a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + a^{2} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \] Input:
integrate((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x, algorithm="fricas")
Output:
(b^2*d*x*cos(d*x + c) + a*b*cos(d*x + c)*log(sin(d*x + c) + 1) - a*b*cos(d *x + c)*log(-sin(d*x + c) + 1) + a^2*sin(d*x + c))/(d*cos(d*x + c))
\[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\int \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((a+b*cos(d*x+c))**2*sec(d*x+c)**2,x)
Output:
Integral((a + b*cos(c + d*x))**2*sec(c + d*x)**2, x)
Time = 0.05 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.45 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} b^{2} + a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + a^{2} \tan \left (d x + c\right )}{d} \] Input:
integrate((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x, algorithm="maxima")
Output:
((d*x + c)*b^2 + a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + a^2 *tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 77 vs. \(2 (33) = 66\).
Time = 0.54 (sec) , antiderivative size = 77, normalized size of antiderivative = 2.33 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} b^{2} + 2 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, a^{2} \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))^2*sec(d*x+c)^2,x, algorithm="giac")
Output:
((d*x + c)*b^2 + 2*a*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*a*b*log(abs( tan(1/2*d*x + 1/2*c) - 1)) - 2*a^2*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2 *c)^2 - 1))/d
Time = 39.68 (sec) , antiderivative size = 181, normalized size of antiderivative = 5.48 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {2\,b^2\,\mathrm {atan}\left (\frac {64\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^2\,b^4+64\,b^6}+\frac {256\,a^2\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^2\,b^4+64\,b^6}\right )}{d}-\frac {2\,a^2\,\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 )}+\frac {4\,a\,b\,\mathrm {atanh}\left (\frac {128\,a\,b^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{512\,a^3\,b^3+128\,a\,b^5}+\frac {512\,a^3\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{512\,a^3\,b^3+128\,a\,b^5}\right )}{d} \] Input:
int((a + b*cos(c + d*x))^2/cos(c + d*x)^2,x)
Output:
(2*b^2*atan((64*b^6*tan(c/2 + (d*x)/2))/(64*b^6 + 256*a^2*b^4) + (256*a^2* b^4*tan(c/2 + (d*x)/2))/(64*b^6 + 256*a^2*b^4)))/d - (2*a^2*tan(c/2 + (d*x )/2))/(d*(tan(c/2 + (d*x)/2)^2 - 1)) + (4*a*b*atanh((128*a*b^5*tan(c/2 + ( d*x)/2))/(128*a*b^5 + 512*a^3*b^3) + (512*a^3*b^3*tan(c/2 + (d*x)/2))/(128 *a*b^5 + 512*a^3*b^3)))/d
Time = 0.17 (sec) , antiderivative size = 79, normalized size of antiderivative = 2.39 \[ \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx=\frac {-2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a b +2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a b +\cos \left (d x +c \right ) b^{2} d x +\sin \left (d x +c \right ) a^{2}}{\cos \left (d x +c \right ) d} \] Input:
int((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x)
Output:
( - 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b + 2*cos(c + d*x)*log(tan( (c + d*x)/2) + 1)*a*b + cos(c + d*x)*b**2*d*x + sin(c + d*x)*a**2)/(cos(c + d*x)*d)