\(\int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx\) [391]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F(-2)]
Maxima [B] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [F]

Optimal result

Integrand size = 23, antiderivative size = 57 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=\frac {d \text {arctanh}(\sin (a+b x))}{b^2}-\frac {4 (c+d x) \cos (a+b x)}{b}-\frac {(c+d x) \sec (a+b x)}{b}+\frac {4 d \sin (a+b x)}{b^2} \] Output:

d*arctanh(sin(b*x+a))/b^2-4*(d*x+c)*cos(b*x+a)/b-(d*x+c)*sec(b*x+a)/b+4*d* 
sin(b*x+a)/b^2
 

Mathematica [A] (verified)

Time = 0.64 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.84 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=-\frac {\sec (a+b x) \left (3 b c+3 b d x+2 b (c+d x) \cos (2 (a+b x))+d \cos (a+b x) \left (\log \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (a+b x)\right )+\sin \left (\frac {1}{2} (a+b x)\right )\right )\right )-2 d \sin (2 (a+b x))\right )}{b^2} \] Input:

Integrate[(c + d*x)*Sec[a + b*x]^2*Sin[3*a + 3*b*x],x]
 

Output:

-((Sec[a + b*x]*(3*b*c + 3*b*d*x + 2*b*(c + d*x)*Cos[2*(a + b*x)] + d*Cos[ 
a + b*x]*(Log[Cos[(a + b*x)/2] - Sin[(a + b*x)/2]] - Log[Cos[(a + b*x)/2] 
+ Sin[(a + b*x)/2]]) - 2*d*Sin[2*(a + b*x)]))/b^2)
 

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {4931, 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 (c+d x) \sin (3 a+3 b x) \sec ^2(a+b x) \, dx\)

\(\Big \downarrow \) 4931

\(\displaystyle \int \left (3 (c+d x) \sin (a+b x)-(c+d x) \sin (a+b x) \tan ^2(a+b x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {d \text {arctanh}(\sin (a+b x))}{b^2}+\frac {4 d \sin (a+b x)}{b^2}-\frac {4 (c+d x) \cos (a+b x)}{b}-\frac {(c+d x) \sec (a+b x)}{b}\)

Input:

Int[(c + d*x)*Sec[a + b*x]^2*Sin[3*a + 3*b*x],x]
 

Output:

(d*ArcTanh[Sin[a + b*x]])/b^2 - (4*(c + d*x)*Cos[a + b*x])/b - ((c + d*x)* 
Sec[a + b*x])/b + (4*d*Sin[a + b*x])/b^2
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 4931
Int[((e_.) + (f_.)*(x_))^(m_.)*(F_)[(a_.) + (b_.)*(x_)]^(p_.)*(G_)[(c_.) + 
(d_.)*(x_)]^(q_.), x_Symbol] :> Int[ExpandTrigExpand[(e + f*x)^m*G[c + d*x] 
^q, F, c + d*x, p, b/d, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && Member 
Q[{Sin, Cos}, F] && MemberQ[{Sec, Csc}, G] && IGtQ[p, 0] && IGtQ[q, 0] && E 
qQ[b*c - a*d, 0] && IGtQ[b/d, 1]
 
Maple [A] (verified)

Time = 1.55 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.68

method result size
default \(-\frac {4 c \cos \left (b x +a \right )}{b}-\frac {c}{b \cos \left (b x +a \right )}+\frac {4 d \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )+a \cos \left (b x +a \right )\right )}{b^{2}}-\frac {d x}{b \cos \left (b x +a \right )}+\frac {d \ln \left (\sec \left (b x +a \right )+\tan \left (b x +a \right )\right )}{b^{2}}\) \(96\)
risch \(-\frac {2 \left (b d x +c b +i d \right ) {\mathrm e}^{i \left (b x +a \right )}}{b^{2}}-\frac {2 \left (b d x +c b -i d \right ) {\mathrm e}^{-i \left (b x +a \right )}}{b^{2}}-\frac {2 \,{\mathrm e}^{i \left (b x +a \right )} \left (d x +c \right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}-\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}-i\right )}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+i\right )}{b^{2}}\) \(123\)

Input:

int((d*x+c)*sec(b*x+a)^2*sin(3*b*x+3*a),x,method=_RETURNVERBOSE)
 

Output:

-4*c/b*cos(b*x+a)-c/b/cos(b*x+a)+4*d/b^2*(sin(b*x+a)-(b*x+a)*cos(b*x+a)+a* 
cos(b*x+a))-d/b/cos(b*x+a)*x+d/b^2*ln(sec(b*x+a)+tan(b*x+a))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.63 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=-\frac {2 \, b d x + 8 \, {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} - d \cos \left (b x + a\right ) \log \left (\sin \left (b x + a\right ) + 1\right ) + d \cos \left (b x + a\right ) \log \left (-\sin \left (b x + a\right ) + 1\right ) - 8 \, d \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 2 \, b c}{2 \, b^{2} \cos \left (b x + a\right )} \] Input:

integrate((d*x+c)*sec(b*x+a)^2*sin(3*b*x+3*a),x, algorithm="fricas")
 

Output:

-1/2*(2*b*d*x + 8*(b*d*x + b*c)*cos(b*x + a)^2 - d*cos(b*x + a)*log(sin(b* 
x + a) + 1) + d*cos(b*x + a)*log(-sin(b*x + a) + 1) - 8*d*cos(b*x + a)*sin 
(b*x + a) + 2*b*c)/(b^2*cos(b*x + a))
 

Sympy [F(-2)]

Exception generated. \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

integrate((d*x+c)*sec(b*x+a)**2*sin(3*b*x+3*a),x)
 

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 3330 vs. \(2 (57) = 114\).

Time = 0.31 (sec) , antiderivative size = 3330, normalized size of antiderivative = 58.42 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=\text {Too large to display} \] Input:

integrate((d*x+c)*sec(b*x+a)^2*sin(3*b*x+3*a),x, algorithm="maxima")
 

Output:

-2*((cos(3*b*x + 3*a) + cos(b*x + a))*cos(4*b*x + 4*a) + (3*cos(2*b*x + 2* 
a) + 1)*cos(3*b*x + 3*a) + 3*cos(2*b*x + 2*a)*cos(b*x + a) + (sin(3*b*x + 
3*a) + sin(b*x + a))*sin(4*b*x + 4*a) + 3*sin(3*b*x + 3*a)*sin(2*b*x + 2*a 
) + 3*sin(2*b*x + 2*a)*sin(b*x + a) + cos(b*x + a))*c/(b*cos(3*b*x + 3*a)^ 
2 + 2*b*cos(3*b*x + 3*a)*cos(b*x + a) + b*cos(b*x + a)^2 + b*sin(3*b*x + 3 
*a)^2 + 2*b*sin(3*b*x + 3*a)*sin(b*x + a) + b*sin(b*x + a)^2) - 1/2*(4*(co 
s(a)^2 + sin(a)^2)*b*x*cos(b*x + a) + 12*(b*x*cos(2*b*x + 3*a)*cos(b*x + 2 
*a) + b*x*cos(b*x + 2*a)*cos(a) + b*x*sin(2*b*x + 3*a)*sin(b*x + 2*a) + b* 
x*sin(b*x + 2*a)*sin(a))*cos(3*b*x + 3*a)^2 + 4*(b*x*cos(b*x + a) - sin(b* 
x + a))*cos(2*b*x + 3*a)^2 + 12*(b*x*cos(2*b*x + 3*a)*cos(b*x + 2*a) + b*x 
*cos(b*x + 2*a)*cos(a) + b*x*sin(2*b*x + 3*a)*sin(b*x + 2*a) + b*x*sin(b*x 
 + 2*a)*sin(a))*sin(3*b*x + 3*a)^2 + 4*(b*x*cos(b*x + a) - sin(b*x + a))*s 
in(2*b*x + 3*a)^2 + 4*((b*x*cos(2*b*x + 3*a) + b*x*cos(a) + sin(2*b*x + 3* 
a) + sin(a))*cos(3*b*x + 3*a)^2 + (b*x*cos(a) + sin(a))*cos(b*x + a)^2 + ( 
b*x*cos(2*b*x + 3*a) + b*x*cos(a) + sin(2*b*x + 3*a) + sin(a))*sin(3*b*x + 
 3*a)^2 + (b*x*cos(a) + sin(a))*sin(b*x + a)^2 + 2*(b*x*cos(2*b*x + 3*a)*c 
os(b*x + a) + (b*x*cos(a) + sin(a))*cos(b*x + a) + cos(b*x + a)*sin(2*b*x 
+ 3*a))*cos(3*b*x + 3*a) + (b*x*cos(b*x + a)^2 + b*x*sin(b*x + a)^2)*cos(2 
*b*x + 3*a) + 2*(b*x*cos(2*b*x + 3*a)*sin(b*x + a) + (b*x*cos(a) + sin(a)) 
*sin(b*x + a) + sin(2*b*x + 3*a)*sin(b*x + a))*sin(3*b*x + 3*a) + (cos(...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 365 vs. \(2 (57) = 114\).

Time = 0.21 (sec) , antiderivative size = 365, normalized size of antiderivative = 6.40 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx=\frac {10 \, b c \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} + 10 \, {\left (b x + a\right )} d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} - 10 \, a d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} + d \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} - d \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} - 12 \, b c \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} - 12 \, {\left (b x + a\right )} d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 12 \, a d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 16 \, d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{3} + 10 \, b c + 10 \, {\left (b x + a\right )} d - 10 \, a d - d \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 1}\right ) + d \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{2} + 1}\right ) - 16 \, d \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )}{2 \, {\left (b \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right )^{4} - b\right )} b} \] Input:

integrate((d*x+c)*sec(b*x+a)^2*sin(3*b*x+3*a),x, algorithm="giac")
 

Output:

1/2*(10*b*c*tan(1/2*b*x + 1/2*a)^4 + 10*(b*x + a)*d*tan(1/2*b*x + 1/2*a)^4 
 - 10*a*d*tan(1/2*b*x + 1/2*a)^4 + d*log(2*(tan(1/2*b*x + 1/2*a)^2 + 2*tan 
(1/2*b*x + 1/2*a) + 1)/(tan(1/2*b*x + 1/2*a)^2 + 1))*tan(1/2*b*x + 1/2*a)^ 
4 - d*log(2*(tan(1/2*b*x + 1/2*a)^2 - 2*tan(1/2*b*x + 1/2*a) + 1)/(tan(1/2 
*b*x + 1/2*a)^2 + 1))*tan(1/2*b*x + 1/2*a)^4 - 12*b*c*tan(1/2*b*x + 1/2*a) 
^2 - 12*(b*x + a)*d*tan(1/2*b*x + 1/2*a)^2 + 12*a*d*tan(1/2*b*x + 1/2*a)^2 
 + 16*d*tan(1/2*b*x + 1/2*a)^3 + 10*b*c + 10*(b*x + a)*d - 10*a*d - d*log( 
2*(tan(1/2*b*x + 1/2*a)^2 + 2*tan(1/2*b*x + 1/2*a) + 1)/(tan(1/2*b*x + 1/2 
*a)^2 + 1)) + d*log(2*(tan(1/2*b*x + 1/2*a)^2 - 2*tan(1/2*b*x + 1/2*a) + 1 
)/(tan(1/2*b*x + 1/2*a)^2 + 1)) - 16*d*tan(1/2*b*x + 1/2*a))/((b*tan(1/2*b 
*x + 1/2*a)^4 - b)*b)
 

Mupad [B] (verification not implemented)

Time = 1.45 (sec) , antiderivative size = 150, normalized size of antiderivative = 2.63 \[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx={\mathrm {e}}^{-a\,1{}\mathrm {i}-b\,x\,1{}\mathrm {i}}\,\left (\frac {-2\,b\,c+d\,2{}\mathrm {i}}{b^2}-\frac {2\,d\,x}{b}\right )-{\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (\frac {2\,b\,c+d\,2{}\mathrm {i}}{b^2}+\frac {2\,d\,x}{b}\right )-\frac {d\,\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}-\mathrm {i}\right )}{b^2}+\frac {d\,\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}+1{}\mathrm {i}\right )}{b^2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (c+d\,x\right )\,2{}\mathrm {i}}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}+1{}\mathrm {i}\right )} \] Input:

int((sin(3*a + 3*b*x)*(c + d*x))/cos(a + b*x)^2,x)
 

Output:

exp(- a*1i - b*x*1i)*((d*2i - 2*b*c)/b^2 - (2*d*x)/b) - exp(a*1i + b*x*1i) 
*((d*2i + 2*b*c)/b^2 + (2*d*x)/b) - (d*log(exp(a*1i + b*x*1i) - 1i))/b^2 + 
 (d*log(exp(a*1i + b*x*1i) + 1i))/b^2 - (exp(a*1i + b*x*1i)*(c + d*x)*2i)/ 
(b*(exp(a*2i + b*x*2i)*1i + 1i))
 

Reduce [F]

\[ \int (c+d x) \sec ^2(a+b x) \sin (3 a+3 b x) \, dx =\text {Too large to display} \] Input:

int((d*x+c)*sec(b*x+a)^2*sin(3*b*x+3*a),x)
 

Output:

(33*cos(3*a + 3*b*x)*cos(a + b*x)*b*c + 33*cos(3*a + 3*b*x)*cos(a + b*x)*b 
*d*x + 12*cos(3*a + 3*b*x)*sin(a + b*x)*d + 66*cos(3*a + 3*b*x)*b*c + 66*c 
os(3*a + 3*b*x)*b*d*x + 792*cos(a + b*x)*int(tan((3*a + 3*b*x)/2)/(tan((3* 
a + 3*b*x)/2)**2*tan((a + b*x)/2)**4 - 2*tan((3*a + 3*b*x)/2)**2*tan((a + 
b*x)/2)**2 + tan((3*a + 3*b*x)/2)**2 + tan((a + b*x)/2)**4 - 2*tan((a + b* 
x)/2)**2 + 1),x)*b**2*c - 528*cos(a + b*x)*int(tan((a + b*x)/2)/(tan((3*a 
+ 3*b*x)/2)**2*tan((a + b*x)/2)**4 - 2*tan((3*a + 3*b*x)/2)**2*tan((a + b* 
x)/2)**2 + tan((3*a + 3*b*x)/2)**2 + tan((a + b*x)/2)**4 - 2*tan((a + b*x) 
/2)**2 + 1),x)*b**2*c + 264*cos(a + b*x)*int((tan((3*a + 3*b*x)/2)**2*tan( 
(a + b*x)/2)*x)/(tan((3*a + 3*b*x)/2)**2*tan((a + b*x)/2)**4 - 2*tan((3*a 
+ 3*b*x)/2)**2*tan((a + b*x)/2)**2 + tan((3*a + 3*b*x)/2)**2 + tan((a + b* 
x)/2)**4 - 2*tan((a + b*x)/2)**2 + 1),x)*b**2*d + 112*cos(a + b*x)*int((ta 
n((3*a + 3*b*x)/2)*tan((a + b*x)/2))/(tan((3*a + 3*b*x)/2)**2*tan((a + b*x 
)/2)**4 - 2*tan((3*a + 3*b*x)/2)**2*tan((a + b*x)/2)**2 + tan((3*a + 3*b*x 
)/2)**2 + tan((a + b*x)/2)**4 - 2*tan((a + b*x)/2)**2 + 1),x)*b*d + 792*co 
s(a + b*x)*int((tan((3*a + 3*b*x)/2)*x)/(tan((3*a + 3*b*x)/2)**2*tan((a + 
b*x)/2)**4 - 2*tan((3*a + 3*b*x)/2)**2*tan((a + b*x)/2)**2 + tan((3*a + 3* 
b*x)/2)**2 + tan((a + b*x)/2)**4 - 2*tan((a + b*x)/2)**2 + 1),x)*b**2*d - 
264*cos(a + b*x)*int((tan((a + b*x)/2)*x)/(tan((3*a + 3*b*x)/2)**2*tan((a 
+ b*x)/2)**4 - 2*tan((3*a + 3*b*x)/2)**2*tan((a + b*x)/2)**2 + tan((3*a...