Integrand size = 21, antiderivative size = 69 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {5 x}{2 a^2}+\frac {2 \sin (c+d x)}{a^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {2 \sin (c+d x)}{a^2 d (1+\cos (c+d x))} \] Output:
-5/2*x/a^2+2*sin(d*x+c)/a^2/d-1/2*cos(d*x+c)*sin(d*x+c)/a^2/d+2*sin(d*x+c) /a^2/d/(1+cos(d*x+c))
Time = 0.22 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.75 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {\sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (60 d x \cos \left (\frac {d x}{2}\right )+60 d x \cos \left (c+\frac {d x}{2}\right )-119 \sin \left (\frac {d x}{2}\right )-25 \sin \left (c+\frac {d x}{2}\right )-21 \sin \left (c+\frac {3 d x}{2}\right )-21 \sin \left (2 c+\frac {3 d x}{2}\right )+3 \sin \left (2 c+\frac {5 d x}{2}\right )+3 \sin \left (3 c+\frac {5 d x}{2}\right )\right )}{48 a^2 d} \] Input:
Integrate[Sin[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]
Output:
-1/48*(Sec[c/2]*Sec[(c + d*x)/2]*(60*d*x*Cos[(d*x)/2] + 60*d*x*Cos[c + (d* x)/2] - 119*Sin[(d*x)/2] - 25*Sin[c + (d*x)/2] - 21*Sin[c + (3*d*x)/2] - 2 1*Sin[2*c + (3*d*x)/2] + 3*Sin[2*c + (5*d*x)/2] + 3*Sin[3*c + (5*d*x)/2])) /(a^2*d)
Time = 0.64 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.88, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 4360, 3042, 3353, 3042, 3429, 3042, 3188, 2009}
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 {\sin ^2(c+d x)}{(a \sec (c+d x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos \left (c+d x-\frac {\pi }{2}\right )^2}{\left (a-a \csc \left (c+d x-\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \frac {\sin ^2(c+d x) \cos ^2(c+d x)}{(a (-\cos (c+d x))-a)^2}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )^2 \cos \left (c+d x+\frac {\pi }{2}\right )^2}{\left (a \left (-\sin \left (c+d x+\frac {\pi }{2}\right )\right )-a\right )^2}dx\) |
\(\Big \downarrow \) 3353 |
\(\displaystyle \frac {\int \frac {\cos ^2(c+d x) (a-a \cos (c+d x))}{\cos (c+d x) a+a}dx}{a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a-a \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{a^2}\) |
\(\Big \downarrow \) 3429 |
\(\displaystyle \frac {\int (a-a \cos (c+d x))^2 \cot ^2(c+d x)dx}{a^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (\sin \left (c+d x-\frac {\pi }{2}\right ) a+a\right )^2 \tan \left (c+d x-\frac {\pi }{2}\right )^2dx}{a^4}\) |
\(\Big \downarrow \) 3188 |
\(\displaystyle \frac {\int \left (-\cos ^2(c+d x)+2 \cos (c+d x)+\frac {2}{\cos (c+d x)+1}-2\right )dx}{a^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {2 \sin (c+d x)}{d}-\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {2 \sin (c+d x)}{d (\cos (c+d x)+1)}-\frac {5 x}{2}}{a^2}\) |
Input:
Int[Sin[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]
Output:
((-5*x)/2 + (2*Sin[c + d*x])/d - (Cos[c + d*x]*Sin[c + d*x])/(2*d) + (2*Si n[c + d*x])/(d*(1 + Cos[c + d*x])))/a^2
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ ), x_Symbol] :> Simp[a^p Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m - p/2, 0])
Int[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[1/b^2 Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^(m + 1)*(a - b*Sin[e + f*x]), x], x] /; Fre eQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] && (ILtQ[m, 0] || !IGtQ[ n, 0])
Int[sin[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ .)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[a^n*c^n Int[Tan[e + f*x]^p*(a + b*Sin[e + f*x])^(m - n), x], x] /; FreeQ[{a, b, c , d, e, f, m}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && EqQ[p + 2*n, 0] && IntegerQ[n]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
Time = 0.17 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.64
method | result | size |
parallelrisch | \(\frac {-10 d x -\sin \left (2 d x +2 c \right )+8 \sin \left (d x +c \right )+8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \,a^{2}}\) | \(44\) |
derivativedivides | \(\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {2 \left (-\frac {5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{2}-\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-5 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) | \(73\) |
default | \(\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {2 \left (-\frac {5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{2}-\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-5 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) | \(73\) |
risch | \(-\frac {5 x}{2 a^{2}}-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{d \,a^{2}}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{d \,a^{2}}+\frac {4 i}{a^{2} d \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {\sin \left (2 d x +2 c \right )}{4 d \,a^{2}}\) | \(83\) |
norman | \(\frac {-\frac {5 x}{2 a}+\frac {5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {9 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}-\frac {5 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}-\frac {5 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} a}\) | \(116\) |
Input:
int(sin(d*x+c)^2/(a+a*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/4*(-10*d*x-sin(2*d*x+2*c)+8*sin(d*x+c)+8*tan(1/2*d*x+1/2*c))/d/a^2
Time = 0.08 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.88 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {5 \, d x \cos \left (d x + c\right ) + 5 \, d x + {\left (\cos \left (d x + c\right )^{2} - 3 \, \cos \left (d x + c\right ) - 8\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \] Input:
integrate(sin(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="fricas")
Output:
-1/2*(5*d*x*cos(d*x + c) + 5*d*x + (cos(d*x + c)^2 - 3*cos(d*x + c) - 8)*s in(d*x + c))/(a^2*d*cos(d*x + c) + a^2*d)
\[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\int \frac {\sin ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \] Input:
integrate(sin(d*x+c)**2/(a+a*sec(d*x+c))**2,x)
Output:
Integral(sin(c + d*x)**2/(sec(c + d*x)**2 + 2*sec(c + d*x) + 1), x)/a**2
Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (65) = 130\).
Time = 0.11 (sec) , antiderivative size = 140, normalized size of antiderivative = 2.03 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\frac {\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {5 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {2 \, \sin \left (d x + c\right )}{a^{2} {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \] Input:
integrate(sin(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="maxima")
Output:
((3*sin(d*x + c)/(cos(d*x + c) + 1) + 5*sin(d*x + c)^3/(cos(d*x + c) + 1)^ 3)/(a^2 + 2*a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a^2*sin(d*x + c)^4/( cos(d*x + c) + 1)^4) - 5*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 + 2*s in(d*x + c)/(a^2*(cos(d*x + c) + 1)))/d
Time = 0.13 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.09 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {\frac {5 \, {\left (d x + c\right )}}{a^{2}} - \frac {4 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2}} - \frac {2 \, {\left (5 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, \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 )}^{2} a^{2}}}{2 \, d} \] Input:
integrate(sin(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="giac")
Output:
-1/2*(5*(d*x + c)/a^2 - 4*tan(1/2*d*x + 1/2*c)/a^2 - 2*(5*tan(1/2*d*x + 1/ 2*c)^3 + 3*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 + 1)^2*a^2))/d
Time = 11.19 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.32 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-5\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (c+d\,x\right )+10\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-4\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a^2\,d\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )} \] Input:
int(sin(c + d*x)^2/(a + a/cos(c + d*x))^2,x)
Output:
(4*sin(c/2 + (d*x)/2) - 5*cos(c/2 + (d*x)/2)*(c + d*x) + 10*cos(c/2 + (d*x )/2)^2*sin(c/2 + (d*x)/2) - 4*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d*x)/2))/(2* a^2*d*cos(c/2 + (d*x)/2))
Time = 0.17 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.90 \[ \int \frac {\sin ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {-\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-4 \cos \left (d x +c \right )+4 \sin \left (d x +c \right )^{2}-5 \sin \left (d x +c \right ) d x +4}{2 \sin \left (d x +c \right ) a^{2} d} \] Input:
int(sin(d*x+c)^2/(a+a*sec(d*x+c))^2,x)
Output:
( - cos(c + d*x)*sin(c + d*x)**2 - 4*cos(c + d*x) + 4*sin(c + d*x)**2 - 5* sin(c + d*x)*d*x + 4)/(2*sin(c + d*x)*a**2*d)