\(\int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx\) [277]

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

Optimal result

Integrand size = 26, antiderivative size = 152 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {f \text {arctanh}(\sin (c+d x))}{6 a d^2}+\frac {2 f \log (\cos (c+d x))}{3 a d^2}-\frac {f \sec ^2(c+d x)}{6 a d^2}-\frac {(e+f x) \sec ^3(c+d x)}{3 a d}+\frac {2 (e+f x) \tan (c+d x)}{3 a d}+\frac {f \sec (c+d x) \tan (c+d x)}{6 a d^2}+\frac {(e+f x) \sec ^2(c+d x) \tan (c+d x)}{3 a d} \] Output:

1/6*f*arctanh(sin(d*x+c))/a/d^2+2/3*f*ln(cos(d*x+c))/a/d^2-1/6*f*sec(d*x+c 
)^2/a/d^2-1/3*(f*x+e)*sec(d*x+c)^3/a/d+2/3*(f*x+e)*tan(d*x+c)/a/d+1/6*f*se 
c(d*x+c)*tan(d*x+c)/a/d^2+1/3*(f*x+e)*sec(d*x+c)^2*tan(d*x+c)/a/d
 

Mathematica [A] (verified)

Time = 7.52 (sec) , antiderivative size = 231, normalized size of antiderivative = 1.52 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {-2 d (e+f x) (\cos (2 (c+d x))-2 \sin (c+d x))+\cos (c+d x) \left (d e-f-c f+3 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+5 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\left (d e-c f+3 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+5 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin (c+d x)\right )}{6 a d^2 \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (1+\sin (c+d x))} \] Input:

Integrate[((e + f*x)*Sec[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
 

Output:

(-2*d*(e + f*x)*(Cos[2*(c + d*x)] - 2*Sin[c + d*x]) + Cos[c + d*x]*(d*e - 
f - c*f + 3*f*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 5*f*Log[Cos[(c + 
d*x)/2] + Sin[(c + d*x)/2]] + (d*e - c*f + 3*f*Log[Cos[(c + d*x)/2] - Sin[ 
(c + d*x)/2]] + 5*f*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])*Sin[c + d*x] 
))/(6*a*d^2*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[ 
(c + d*x)/2])*(1 + Sin[c + d*x]))
 

Rubi [A] (verified)

Time = 0.93 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.97, number of steps used = 13, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {5042, 3042, 4673, 3042, 4672, 25, 3042, 3956, 4909, 3042, 4255, 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 \frac {(e+f x) \sec ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 5042

\(\displaystyle \frac {\int (e+f x) \sec ^4(c+d x)dx}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (e+f x) \csc \left (c+d x+\frac {\pi }{2}\right )^4dx}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 4673

\(\displaystyle \frac {\frac {2}{3} \int (e+f x) \sec ^2(c+d x)dx-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2}{3} \int (e+f x) \csc \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 4672

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \int -\tan (c+d x)dx}{d}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {2}{3} \left (\frac {(e+f x) \tan (c+d x)}{d}-\frac {f \int \tan (c+d x)dx}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2}{3} \left (\frac {(e+f x) \tan (c+d x)}{d}-\frac {f \int \tan (c+d x)dx}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 3956

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\int (e+f x) \sec ^3(c+d x) \tan (c+d x)dx}{a}\)

\(\Big \downarrow \) 4909

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\frac {(e+f x) \sec ^3(c+d x)}{3 d}-\frac {f \int \sec ^3(c+d x)dx}{3 d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\frac {(e+f x) \sec ^3(c+d x)}{3 d}-\frac {f \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{3 d}}{a}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\frac {(e+f x) \sec ^3(c+d x)}{3 d}-\frac {f \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{3 d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\frac {(e+f x) \sec ^3(c+d x)}{3 d}-\frac {f \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{3 d}}{a}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {\frac {2}{3} \left (\frac {f \log (\cos (c+d x))}{d^2}+\frac {(e+f x) \tan (c+d x)}{d}\right )-\frac {f \sec ^2(c+d x)}{6 d^2}+\frac {(e+f x) \tan (c+d x) \sec ^2(c+d x)}{3 d}}{a}-\frac {\frac {(e+f x) \sec ^3(c+d x)}{3 d}-\frac {f \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{3 d}}{a}\)

Input:

Int[((e + f*x)*Sec[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
 

Output:

(-1/6*(f*Sec[c + d*x]^2)/d^2 + ((e + f*x)*Sec[c + d*x]^2*Tan[c + d*x])/(3* 
d) + (2*((f*Log[Cos[c + d*x]])/d^2 + ((e + f*x)*Tan[c + d*x])/d))/3)/a - ( 
((e + f*x)*Sec[c + d*x]^3)/(3*d) - (f*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[ 
c + d*x]*Tan[c + d*x])/(2*d)))/(3*d))/a
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4672
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp 
[(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f)   Int[(c + d*x)^(m - 1) 
*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
 

rule 4673
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> 
 Simp[(-b^2)*(c + d*x)*Cot[e + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), 
 x] + (-Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x] + S 
imp[b^2*((n - 2)/(n - 1))   Int[(c + d*x)*(b*Csc[e + f*x])^(n - 2), x], x]) 
 /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2]
 

rule 4909
Int[((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]^(n_.)*Tan[(a_.) + (b 
_.)*(x_)]^(p_.), x_Symbol] :> Simp[(c + d*x)^m*(Sec[a + b*x]^n/(b*n)), x] - 
 Simp[d*(m/(b*n))   Int[(c + d*x)^(m - 1)*Sec[a + b*x]^n, x], x] /; FreeQ[{ 
a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]
 

rule 5042
Int[(((e_.) + (f_.)*(x_))^(m_.)*Sec[(c_.) + (d_.)*(x_)]^(n_.))/((a_) + (b_. 
)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a   Int[(e + f*x)^m*Sec[c + 
 d*x]^(n + 2), x], x] - Simp[1/b   Int[(e + f*x)^m*Sec[c + d*x]^(n + 1)*Tan 
[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && EqQ[a 
^2 - b^2, 0]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 2.47 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.09

method result size
risch \(-\frac {4 i f x}{3 d a}-\frac {4 i f c}{3 d^{2} a}-\frac {i \left (f \,{\mathrm e}^{3 i \left (d x +c \right )}+4 d x f -8 i d f x \,{\mathrm e}^{i \left (d x +c \right )}+4 d e +{\mathrm e}^{i \left (d x +c \right )} f -8 i d e \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{3} d^{2} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a}+\frac {f \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d^{2} a}+\frac {5 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{6 d^{2} a}\) \(166\)
parallelrisch \(\frac {-4 f \left (\sin \left (2 d x +2 c \right )+2 \cos \left (d x +c \right )\right ) \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+3 f \left (\sin \left (2 d x +2 c \right )+2 \cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+5 f \left (\sin \left (2 d x +2 c \right )+2 \cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (-2 d e +f \right ) \sin \left (2 d x +2 c \right )-4 \left (\left (f x +e \right ) \cos \left (2 d x +2 c \right )+\cos \left (d x +c \right ) e -2 \sin \left (d x +c \right ) \left (f x +e \right )\right ) d}{6 d^{2} a \left (\sin \left (2 d x +2 c \right )+2 \cos \left (d x +c \right )\right )}\) \(185\)
default \(\frac {\frac {e \left (-\frac {2}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\right )}{d}+\frac {f \left (-\frac {d x +c}{3 \cos \left (d x +c \right )^{3}}+\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{6}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{6}+\frac {\left (d x +c \right ) \sin \left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {1}{6 \cos \left (d x +c \right )^{2}}+\frac {2 \left (d x +c \right ) \tan \left (d x +c \right )}{3}+\frac {2 \ln \left (\cos \left (d x +c \right )\right )}{3}+\frac {c}{3 \cos \left (d x +c \right )^{3}}+c \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )\right )}{d^{2}}}{a}\) \(205\)
norman \(\frac {\frac {2 e}{3 d a}-\frac {2 e \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d a}+\frac {f x}{3 a d}+\frac {\left (-6 d e +f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d^{2} a}-\frac {\left (2 d e +f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d^{2} a}-\frac {4 f x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 a d}-\frac {2 f x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a d}-\frac {4 f x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}+\frac {f x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{3 a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {f \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d^{2} a}+\frac {5 f \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{6 d^{2} a}-\frac {2 f \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{3 d^{2} a}\) \(264\)

Input:

int((f*x+e)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)
 

Output:

-4/3*I*f/d/a*x-4/3*I*f/d^2/a*c-1/3*I*(f*exp(3*I*(d*x+c))+4*d*x*f-8*I*d*f*x 
*exp(I*(d*x+c))+4*d*e+exp(I*(d*x+c))*f-8*I*d*e*exp(I*(d*x+c)))/(exp(I*(d*x 
+c))+I)^3/d^2/(exp(I*(d*x+c))-I)/a+1/2*f/d^2/a*ln(exp(I*(d*x+c))-I)+5/6*f/ 
d^2/a*ln(exp(I*(d*x+c))+I)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.03 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {4 \, d f x - 8 \, {\left (d f x + d e\right )} \cos \left (d x + c\right )^{2} + 4 \, d e - 2 \, f \cos \left (d x + c\right ) + 5 \, {\left (f \cos \left (d x + c\right ) \sin \left (d x + c\right ) + f \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (f \cos \left (d x + c\right ) \sin \left (d x + c\right ) + f \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 8 \, {\left (d f x + d e\right )} \sin \left (d x + c\right )}{12 \, {\left (a d^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a d^{2} \cos \left (d x + c\right )\right )}} \] Input:

integrate((f*x+e)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")
 

Output:

1/12*(4*d*f*x - 8*(d*f*x + d*e)*cos(d*x + c)^2 + 4*d*e - 2*f*cos(d*x + c) 
+ 5*(f*cos(d*x + c)*sin(d*x + c) + f*cos(d*x + c))*log(sin(d*x + c) + 1) + 
 3*(f*cos(d*x + c)*sin(d*x + c) + f*cos(d*x + c))*log(-sin(d*x + c) + 1) + 
 8*(d*f*x + d*e)*sin(d*x + c))/(a*d^2*cos(d*x + c)*sin(d*x + c) + a*d^2*co 
s(d*x + c))
 

Sympy [F]

\[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {e \sec ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f x \sec ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \] Input:

integrate((f*x+e)*sec(d*x+c)**2/(a+a*sin(d*x+c)),x)
 

Output:

(Integral(e*sec(c + d*x)**2/(sin(c + d*x) + 1), x) + Integral(f*x*sec(c + 
d*x)**2/(sin(c + d*x) + 1), x))/a
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1115 vs. \(2 (138) = 276\).

Time = 0.07 (sec) , antiderivative size = 1115, normalized size of antiderivative = 7.34 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Too large to display} \] Input:

integrate((f*x+e)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")
 

Output:

-1/12*(8*c*f*(sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^2/(cos(d*x 
+ c) + 1)^2 + 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 1)/(a*d + 2*a*d*sin( 
d*x + c)/(cos(d*x + c) + 1) - 2*a*d*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 
a*d*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) + (4*(8*(d*x + c)*cos(d*x + c) - 
sin(3*d*x + 3*c) - sin(d*x + c))*cos(4*d*x + 4*c) + 16*(2*d*x + 4*(d*x + c 
)*sin(d*x + c) + 2*c + cos(d*x + c))*cos(3*d*x + 3*c) + 8*cos(3*d*x + 3*c) 
^2 + 8*cos(d*x + c)^2 + 5*(2*(2*sin(3*d*x + 3*c) + 2*sin(d*x + c) + 1)*cos 
(4*d*x + 4*c) - cos(4*d*x + 4*c)^2 - 4*cos(3*d*x + 3*c)^2 - 8*cos(3*d*x + 
3*c)*cos(d*x + c) - 4*cos(d*x + c)^2 - 4*(cos(3*d*x + 3*c) + cos(d*x + c)) 
*sin(4*d*x + 4*c) - sin(4*d*x + 4*c)^2 - 4*(2*sin(d*x + c) + 1)*sin(3*d*x 
+ 3*c) - 4*sin(3*d*x + 3*c)^2 - 4*sin(d*x + c)^2 - 4*sin(d*x + c) - 1)*log 
(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) + 3*(2*(2*sin(3*d*x 
 + 3*c) + 2*sin(d*x + c) + 1)*cos(4*d*x + 4*c) - cos(4*d*x + 4*c)^2 - 4*co 
s(3*d*x + 3*c)^2 - 8*cos(3*d*x + 3*c)*cos(d*x + c) - 4*cos(d*x + c)^2 - 4* 
(cos(3*d*x + 3*c) + cos(d*x + c))*sin(4*d*x + 4*c) - sin(4*d*x + 4*c)^2 - 
4*(2*sin(d*x + c) + 1)*sin(3*d*x + 3*c) - 4*sin(3*d*x + 3*c)^2 - 4*sin(d*x 
 + c)^2 - 4*sin(d*x + c) - 1)*log(cos(d*x + c)^2 + sin(d*x + c)^2 - 2*sin( 
d*x + c) + 1) + 4*(4*d*x + 8*(d*x + c)*sin(d*x + c) + 4*c + cos(3*d*x + 3* 
c) + cos(d*x + c))*sin(4*d*x + 4*c) - 4*(16*(d*x + c)*cos(d*x + c) - 4*sin 
(d*x + c) - 1)*sin(3*d*x + 3*c) + 8*sin(3*d*x + 3*c)^2 + 8*sin(d*x + c)...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 5555 vs. \(2 (138) = 276\).

Time = 1.29 (sec) , antiderivative size = 5555, normalized size of antiderivative = 36.55 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Too large to display} \] Input:

integrate((f*x+e)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")
 

Output:

-1/12*(4*d*f*x*tan(1/2*d*x)^4*tan(1/2*c)^4 + 16*d*f*x*tan(1/2*d*x)^4*tan(1 
/2*c)^3 + 16*d*f*x*tan(1/2*d*x)^3*tan(1/2*c)^4 + 4*d*e*tan(1/2*d*x)^4*tan( 
1/2*c)^4 - 3*f*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1 
/2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*ta 
n(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x) 
^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 - 5*f*log(2*(tan(1/2*d 
*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2* 
c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/ 
(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2 
*d*x)^4*tan(1/2*c)^4 - 24*d*f*x*tan(1/2*d*x)^4*tan(1/2*c)^2 - 64*d*f*x*tan 
(1/2*d*x)^3*tan(1/2*c)^3 + 16*d*e*tan(1/2*d*x)^4*tan(1/2*c)^3 + 6*f*log(2* 
(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/2*d*x 
)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/ 
2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1 
))*tan(1/2*d*x)^4*tan(1/2*c)^3 + 10*f*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 
 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^ 
2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan( 
1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^4*tan(1/2*c)^3 
 - 24*d*f*x*tan(1/2*d*x)^2*tan(1/2*c)^4 + 16*d*e*tan(1/2*d*x)^3*tan(1/2*c) 
^4 + 6*f*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*...
 

Mupad [B] (verification not implemented)

Time = 44.83 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.58 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2\,\left (d\,e+d\,f\,x\right )}{3\,a\,d^2\,\left (3\,{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}-{\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}\,3{}\mathrm {i}-{\mathrm {e}}^{c\,3{}\mathrm {i}+d\,x\,3{}\mathrm {i}}+1{}\mathrm {i}\right )}-\frac {3\,d\,e+3\,d\,f\,x+f\,2{}\mathrm {i}}{6\,a\,d^2\,\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1{}\mathrm {i}\right )}+\frac {e+f\,x}{2\,a\,d\,\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}-\mathrm {i}\right )}-\frac {\left (24\,d\,e+24\,d\,f\,x-f\,8{}\mathrm {i}\right )\,1{}\mathrm {i}}{24\,a\,d^2\,\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}-1+{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,2{}\mathrm {i}\right )}-\frac {f\,x\,4{}\mathrm {i}}{3\,a\,d}+\frac {f\,\ln \left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}-\mathrm {i}\right )}{2\,a\,d^2}+\frac {5\,f\,\ln \left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1{}\mathrm {i}\right )}{6\,a\,d^2} \] Input:

int((e + f*x)/(cos(c + d*x)^2*(a + a*sin(c + d*x))),x)
 

Output:

(2*(d*e + d*f*x))/(3*a*d^2*(3*exp(c*1i + d*x*1i) - exp(c*2i + d*x*2i)*3i - 
 exp(c*3i + d*x*3i) + 1i)) - (f*2i + 3*d*e + 3*d*f*x)/(6*a*d^2*(exp(c*1i + 
 d*x*1i) + 1i)) + (e + f*x)/(2*a*d*(exp(c*1i + d*x*1i) - 1i)) - ((24*d*e - 
 f*8i + 24*d*f*x)*1i)/(24*a*d^2*(exp(c*1i + d*x*1i)*2i + exp(c*2i + d*x*2i 
) - 1)) - (f*x*4i)/(3*a*d) + (f*log(exp(c*1i + d*x*1i) - 1i))/(2*a*d^2) + 
(5*f*log(exp(c*1i + d*x*1i) + 1i))/(6*a*d^2)
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 265, normalized size of antiderivative = 1.74 \[ \int \frac {(e+f x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {-4 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right ) f -4 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) f +3 \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 ) f +3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) f +5 \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 ) f +5 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) f +4 \cos \left (d x +c \right ) \sin \left (d x +c \right ) d e +4 \cos \left (d x +c \right ) d e -\cos \left (d x +c \right ) f +4 \sin \left (d x +c \right )^{2} d e +4 \sin \left (d x +c \right )^{2} d f x +4 \sin \left (d x +c \right ) d e +4 \sin \left (d x +c \right ) d f x -2 d e -2 d f x}{6 \cos \left (d x +c \right ) a \,d^{2} \left (\sin \left (d x +c \right )+1\right )} \] Input:

int((f*x+e)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x)
 

Output:

( - 4*cos(c + d*x)*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)*f - 4*cos(c + 
 d*x)*log(tan((c + d*x)/2)**2 + 1)*f + 3*cos(c + d*x)*log(tan((c + d*x)/2) 
 - 1)*sin(c + d*x)*f + 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*f + 5*cos( 
c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)*f + 5*cos(c + d*x)*log(tan 
((c + d*x)/2) + 1)*f + 4*cos(c + d*x)*sin(c + d*x)*d*e + 4*cos(c + d*x)*d* 
e - cos(c + d*x)*f + 4*sin(c + d*x)**2*d*e + 4*sin(c + d*x)**2*d*f*x + 4*s 
in(c + d*x)*d*e + 4*sin(c + d*x)*d*f*x - 2*d*e - 2*d*f*x)/(6*cos(c + d*x)* 
a*d**2*(sin(c + d*x) + 1))