Integrand size = 21, antiderivative size = 138 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {1}{2} a \left (a^2-6 b^2\right ) x+\frac {b \left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {15 a^2 b \sin (c+d x)}{2 d}-\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d} \] Output:
1/2*a*(a^2-6*b^2)*x+1/2*b*(6*a^2-b^2)*arctanh(sin(d*x+c))/d-15/2*a^2*b*sin (d*x+c)/d-5/2*a^3*cos(d*x+c)*sin(d*x+c)/d+3/2*a*(b+a*cos(d*x+c))^2*tan(d*x +c)/d+1/2*(b+a*cos(d*x+c))^3*sec(d*x+c)*tan(d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(327\) vs. \(2(138)=276\).
Time = 0.96 (sec) , antiderivative size = 327, normalized size of antiderivative = 2.37 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {\sec ^2(c+d x) \left (a^3 c-6 a b^2 c+a^3 d x-6 a b^2 d x-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\cos (2 (c+d x)) \left (a \left (a^2-6 b^2\right ) (c+d x)+\left (-6 a^2 b+b^3\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-b \left (-6 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (-3 a^2 b+2 b^3\right ) \sin (c+d x)-\frac {1}{2} a^3 \sin (2 (c+d x))+6 a b^2 \sin (2 (c+d x))-3 a^2 b \sin (3 (c+d x))-\frac {1}{4} a^3 \sin (4 (c+d x))\right )}{4 d} \] Input:
Integrate[(a + b*Sec[c + d*x])^3*Sin[c + d*x]^2,x]
Output:
(Sec[c + d*x]^2*(a^3*c - 6*a*b^2*c + a^3*d*x - 6*a*b^2*d*x - 6*a^2*b*Log[C os[(c + d*x)/2] - Sin[(c + d*x)/2]] + b^3*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 6*a^2*b*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] - b^3*Log[Cos[ (c + d*x)/2] + Sin[(c + d*x)/2]] + Cos[2*(c + d*x)]*(a*(a^2 - 6*b^2)*(c + d*x) + (-6*a^2*b + b^3)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - b*(-6*a ^2 + b^2)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + (-3*a^2*b + 2*b^3)*S in[c + d*x] - (a^3*Sin[2*(c + d*x)])/2 + 6*a*b^2*Sin[2*(c + d*x)] - 3*a^2* b*Sin[3*(c + d*x)] - (a^3*Sin[4*(c + d*x)])/4))/(4*d)
Time = 1.24 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.95, number of steps used = 19, number of rules used = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.905, Rules used = {3042, 4360, 25, 25, 3042, 3368, 3042, 3527, 3042, 3526, 3042, 3512, 27, 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 \sin ^2(c+d x) (a+b \sec (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos \left (c+d x-\frac {\pi }{2}\right )^2 \left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^3dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \tan ^2(c+d x) \sec (c+d x) \left (-(-a \cos (c+d x)-b)^3\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int -(b+a \cos (c+d x))^3 \sec (c+d x) \tan ^2(c+d x)dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int \tan ^2(c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos \left (c+d x+\frac {\pi }{2}\right )^2 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+b\right )^3}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 3368 |
\(\displaystyle \int \left (1-\cos ^2(c+d x)\right ) \sec ^3(c+d x) (a \cos (c+d x)+b)^3dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (1-\sin \left (c+d x+\frac {\pi }{2}\right )^2\right ) \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+b\right )^3}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 3527 |
\(\displaystyle \frac {1}{2} \int (b+a \cos (c+d x))^2 \left (-4 a \cos ^2(c+d x)-b \cos (c+d x)+3 a\right ) \sec ^2(c+d x)dx+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \int \frac {\left (b+a \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (-4 a \sin \left (c+d x+\frac {\pi }{2}\right )^2-b \sin \left (c+d x+\frac {\pi }{2}\right )+3 a\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3526 |
\(\displaystyle \frac {1}{2} \left (\int (b+a \cos (c+d x)) \left (-10 \cos ^2(c+d x) a^2+6 a^2-5 b \cos (c+d x) a-b^2\right ) \sec (c+d x)dx+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (\int \frac {\left (b+a \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (-10 \sin \left (c+d x+\frac {\pi }{2}\right )^2 a^2+6 a^2-5 b \sin \left (c+d x+\frac {\pi }{2}\right ) a-b^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3512 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \int 2 \left (-15 a^2 b \cos ^2(c+d x)+a \left (a^2-6 b^2\right ) \cos (c+d x)+b \left (6 a^2-b^2\right )\right ) \sec (c+d x)dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \left (\int \left (-15 a^2 b \cos ^2(c+d x)+a \left (a^2-6 b^2\right ) \cos (c+d x)+b \left (6 a^2-b^2\right )\right ) \sec (c+d x)dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (\int \frac {-15 a^2 b \sin \left (c+d x+\frac {\pi }{2}\right )^2+a \left (a^2-6 b^2\right ) \sin \left (c+d x+\frac {\pi }{2}\right )+b \left (6 a^2-b^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {1}{2} \left (\int \left (b \left (6 a^2-b^2\right )+a \left (a^2-6 b^2\right ) \cos (c+d x)\right ) \sec (c+d x)dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}-\frac {15 a^2 b \sin (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (\int \frac {b \left (6 a^2-b^2\right )+a \left (a^2-6 b^2\right ) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}-\frac {15 a^2 b \sin (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {1}{2} \left (b \left (6 a^2-b^2\right ) \int \sec (c+d x)dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+a x \left (a^2-6 b^2\right )-\frac {15 a^2 b \sin (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (b \left (6 a^2-b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+a x \left (a^2-6 b^2\right )-\frac {15 a^2 b \sin (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{2} \left (-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{d}+\frac {b \left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+a x \left (a^2-6 b^2\right )-\frac {15 a^2 b \sin (c+d x)}{d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{d}\right )+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d}\) |
Input:
Int[(a + b*Sec[c + d*x])^3*Sin[c + d*x]^2,x]
Output:
((b + a*Cos[c + d*x])^3*Sec[c + d*x]*Tan[c + d*x])/(2*d) + (a*(a^2 - 6*b^2 )*x + (b*(6*a^2 - b^2)*ArcTanh[Sin[c + d*x]])/d - (15*a^2*b*Sin[c + d*x])/ d - (5*a^3*Cos[c + d*x]*Sin[c + d*x])/d + (3*a*(b + a*Cos[c + d*x])^2*Tan[ c + d*x])/d)/2
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^m*(1 - Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, m, n }, x] && NeQ[a^2 - b^2, 0] && (IGtQ[m, 0] || IntegersQ[2*m, 2*n])
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[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-C)*d*Cos[e + f*x]*Sin[e + f*x]*((a + b*Si n[e + f*x])^(m + 1)/(b*f*(m + 3))), x] + Simp[1/(b*(m + 3)) Int[(a + b*Si n[e + f*x])^m*Simp[a*C*d + A*b*c*(m + 3) + b*(B*c*(m + 3) + d*(C*(m + 2) + A*(m + 3)))*Sin[e + f*x] - (2*a*C*d - b*(c*C + B*d)*(m + 3))*Sin[e + f*x]^2 , x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && !LtQ[m, -1]
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[(-(c^2*C - B*c*d + A*d^2))*Cos[e + f*x ]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Simp[1/(d*(n + 1)*(c^2 - d^2)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A*d*(b*d*m + a*c*(n + 1)) + (c*C - B* d)*(b*c*m + a*d*(n + 1)) - (d*(A*(a*d*(n + 2) - b*c*(n + 1)) + B*(b*d*(n + 1) - a*c*(n + 2))) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x ] + b*(d*(B*c - A*d)*(m + n + 2) - C*(c^2*(m + 1) + d^2*(n + 1)))*Sin[e + f *x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d , 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(c^2*C + A*d^2))*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Simp[1/(d*(n + 1)*(c^2 - d^ 2)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A* d*(b*d*m + a*c*(n + 1)) + c*C*(b*c*m + a*d*(n + 1)) - (A*d*(a*d*(n + 2) - b *c*(n + 1)) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x] - b*( A*d^2*(m + n + 2) + C*(c^2*(m + 1) + d^2*(n + 1)))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
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.55 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.93
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(128\) |
default | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(128\) |
parts | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}+\frac {3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(136\) |
parallelrisch | \(\frac {-24 b \left (a^{2}-\frac {b^{2}}{6}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+24 b \left (a^{2}-\frac {b^{2}}{6}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+4 a d x \left (a^{2}-6 b^{2}\right ) \cos \left (2 d x +2 c \right )+\left (-2 a^{3}+24 a \,b^{2}\right ) \sin \left (2 d x +2 c \right )-12 \sin \left (3 d x +3 c \right ) a^{2} b -a^{3} \sin \left (4 d x +4 c \right )+\left (-12 a^{2} b +8 b^{3}\right ) \sin \left (d x +c \right )+4 a d x \left (a^{2}-6 b^{2}\right )}{8 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(197\) |
risch | \(\frac {a^{3} x}{2}-3 a \,b^{2} x +\frac {i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b}{2 d}-\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b}{2 d}-\frac {i a^{3} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {i b^{2} \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-6 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) | \(236\) |
norman | \(\frac {\left (\frac {1}{2} a^{3}-3 a \,b^{2}\right ) x +\left (\frac {1}{2} a^{3}-3 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-a^{3}+6 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {\left (a^{3}-6 a^{2} b -6 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {3 \left (a^{3}-2 a^{2} b +2 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {3 \left (a^{3}+2 a^{2} b +2 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {\left (a^{3}+6 a^{2} b -6 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {b \left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(297\) |
Input:
int((a+b*sec(d*x+c))^3*sin(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a^3*(-1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+3*a^2*b*(-sin(d*x+c)+l n(sec(d*x+c)+tan(d*x+c)))+3*a*b^2*(tan(d*x+c)-d*x-c)+b^3*(1/2*sin(d*x+c)^3 /cos(d*x+c)^2+1/2*sin(d*x+c)-1/2*ln(sec(d*x+c)+tan(d*x+c))))
Time = 0.10 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.09 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {2 \, {\left (a^{3} - 6 \, a b^{2}\right )} d x \cos \left (d x + c\right )^{2} + {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{3} \cos \left (d x + c\right )^{3} + 6 \, a^{2} b \cos \left (d x + c\right )^{2} - 6 \, a b^{2} \cos \left (d x + c\right ) - b^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:
integrate((a+b*sec(d*x+c))^3*sin(d*x+c)^2,x, algorithm="fricas")
Output:
1/4*(2*(a^3 - 6*a*b^2)*d*x*cos(d*x + c)^2 + (6*a^2*b - b^3)*cos(d*x + c)^2 *log(sin(d*x + c) + 1) - (6*a^2*b - b^3)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*(a^3*cos(d*x + c)^3 + 6*a^2*b*cos(d*x + c)^2 - 6*a*b^2*cos(d*x + c) - b^3)*sin(d*x + c))/(d*cos(d*x + c)^2)
\[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sin ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((a+b*sec(d*x+c))**3*sin(d*x+c)**2,x)
Output:
Integral((a + b*sec(c + d*x))**3*sin(c + d*x)**2, x)
Time = 0.11 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} - 12 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b^{2} - b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )}}{4 \, d} \] Input:
integrate((a+b*sec(d*x+c))^3*sin(d*x+c)^2,x, algorithm="maxima")
Output:
1/4*((2*d*x + 2*c - sin(2*d*x + 2*c))*a^3 - 12*(d*x + c - tan(d*x + c))*a* b^2 - b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - l og(sin(d*x + c) - 1)) + 6*a^2*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)))/d
Leaf count of result is larger than twice the leaf count of optimal. 346 vs. \(2 (126) = 252\).
Time = 0.18 (sec) , antiderivative size = 346, normalized size of antiderivative = 2.51 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {{\left (a^{3} - 6 \, a b^{2}\right )} {\left (d x + c\right )} + {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{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 )^{4} - 1\right )}^{2}}}{2 \, d} \] Input:
integrate((a+b*sec(d*x+c))^3*sin(d*x+c)^2,x, algorithm="giac")
Output:
1/2*((a^3 - 6*a*b^2)*(d*x + c) + (6*a^2*b - b^3)*log(abs(tan(1/2*d*x + 1/2 *c) + 1)) - (6*a^2*b - b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(a^3*ta n(1/2*d*x + 1/2*c)^7 - 6*a^2*b*tan(1/2*d*x + 1/2*c)^7 - 6*a*b^2*tan(1/2*d* x + 1/2*c)^7 + b^3*tan(1/2*d*x + 1/2*c)^7 - 3*a^3*tan(1/2*d*x + 1/2*c)^5 + 6*a^2*b*tan(1/2*d*x + 1/2*c)^5 - 6*a*b^2*tan(1/2*d*x + 1/2*c)^5 + 3*b^3*t an(1/2*d*x + 1/2*c)^5 + 3*a^3*tan(1/2*d*x + 1/2*c)^3 + 6*a^2*b*tan(1/2*d*x + 1/2*c)^3 + 6*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 3*b^3*tan(1/2*d*x + 1/2*c)^ 3 - a^3*tan(1/2*d*x + 1/2*c) - 6*a^2*b*tan(1/2*d*x + 1/2*c) + 6*a*b^2*tan( 1/2*d*x + 1/2*c) + b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^4 - 1)^ 2)/d
Time = 11.86 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.46 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {a^3\,\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 {b^3\,\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 {b^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}-\frac {a^3\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}-\frac {3\,a^2\,b\,\sin \left (c+d\,x\right )}{d}-\frac {6\,a\,b^2\,\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 {6\,a^2\,b\,\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 {3\,a\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \] Input:
int(sin(c + d*x)^2*(a + b/cos(c + d*x))^3,x)
Output:
(a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (b^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^3*sin(c + d*x))/(2*d*cos(c + d*x)^2) - (a^3*cos(c + d*x)*sin(c + d*x))/(2*d) - (3*a^2*b*sin(c + d*x))/d - (6*a *b^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (6*a^2*b*atanh(sin(c /2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (3*a*b^2*sin(c + d*x))/(d*cos(c + d *x))
Time = 0.17 (sec) , antiderivative size = 433, normalized size of antiderivative = 3.14 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {-\cos \left (d x +c \right )^{2} \sin \left (d x +c \right )^{3} a^{3}+\cos \left (d x +c \right )^{2} \sin \left (d x +c \right ) a^{3}-6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a^{2} b +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{3}+6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2} b -\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{3}+6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a^{2} b -\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{3}-6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2} b +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{3}-6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a^{2} b +\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{3} d x -6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a \,b^{2} d x +6 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{2} b -\cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{3}-\cos \left (d x +c \right ) a^{3} d x +6 \cos \left (d x +c \right ) a \,b^{2} d x +6 \sin \left (d x +c \right )^{3} a \,b^{2}-6 \sin \left (d x +c \right ) a \,b^{2}}{2 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:
int((a+b*sec(d*x+c))^3*sin(d*x+c)^2,x)
Output:
( - cos(c + d*x)**2*sin(c + d*x)**3*a**3 + cos(c + d*x)**2*sin(c + d*x)*a* *3 - 6*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**2*b + cos (c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b**3 + 6*cos(c + d*x)* log(tan((c + d*x)/2) - 1)*a**2*b - cos(c + d*x)*log(tan((c + d*x)/2) - 1)* b**3 + 6*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**2*b - c os(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**3 - 6*cos(c + d*x )*log(tan((c + d*x)/2) + 1)*a**2*b + cos(c + d*x)*log(tan((c + d*x)/2) + 1 )*b**3 - 6*cos(c + d*x)*sin(c + d*x)**3*a**2*b + cos(c + d*x)*sin(c + d*x) **2*a**3*d*x - 6*cos(c + d*x)*sin(c + d*x)**2*a*b**2*d*x + 6*cos(c + d*x)* sin(c + d*x)*a**2*b - cos(c + d*x)*sin(c + d*x)*b**3 - cos(c + d*x)*a**3*d *x + 6*cos(c + d*x)*a*b**2*d*x + 6*sin(c + d*x)**3*a*b**2 - 6*sin(c + d*x) *a*b**2)/(2*cos(c + d*x)*d*(sin(c + d*x)**2 - 1))