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

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

Optimal result

Integrand size = 18, antiderivative size = 148 \[ \int \frac {c+d x}{(a+a \sin (e+f x))^2} \, dx=-\frac {(c+d x) \cot \left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right )}{3 a^2 f}-\frac {d \csc ^2\left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right )}{6 a^2 f^2}-\frac {(c+d x) \cot \left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right ) \csc ^2\left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {2 d \log \left (\sin \left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right )\right )}{3 a^2 f^2} \] Output:

-1/3*(d*x+c)*cot(1/2*e+1/4*Pi+1/2*f*x)/a^2/f-1/6*d*csc(1/2*e+1/4*Pi+1/2*f* 
x)^2/a^2/f^2-1/6*(d*x+c)*cot(1/2*e+1/4*Pi+1/2*f*x)*csc(1/2*e+1/4*Pi+1/2*f* 
x)^2/a^2/f+2/3*d*ln(sin(1/2*e+1/4*Pi+1/2*f*x))/a^2/f^2
 

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.99, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 3799, 3042, 4673, 3042, 4672, 3042, 25, 3956}

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 {c+d x}{(a \sin (e+f x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {c+d x}{(a \sin (e+f x)+a)^2}dx\)

\(\Big \downarrow \) 3799

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4673

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4672

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3956

\(\displaystyle \frac {\frac {2}{3} \left (\frac {4 d \log \left (-\cos \left (\frac {e}{2}+\frac {f x}{2}-\frac {\pi }{4}\right )\right )}{f^2}-\frac {2 (c+d x) \cot \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}\right )-\frac {2 (c+d x) \cot \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right ) \csc ^2\left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{3 f}-\frac {2 d \csc ^2\left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{3 f^2}}{4 a^2}\)

Input:

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

Output:

((-2*d*Csc[e/2 + Pi/4 + (f*x)/2]^2)/(3*f^2) - (2*(c + d*x)*Cot[e/2 + Pi/4 
+ (f*x)/2]*Csc[e/2 + Pi/4 + (f*x)/2]^2)/(3*f) + (2*((-2*(c + d*x)*Cot[e/2 
+ Pi/4 + (f*x)/2])/f + (4*d*Log[-Cos[e/2 - Pi/4 + (f*x)/2]])/f^2))/3)/(4*a 
^2)
 

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 3799
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Simp[(2*a)^n   Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) 
+ f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 
2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], 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]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 2.43 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.89

method result size
risch \(-\frac {2 i d x}{3 a^{2} f}-\frac {2 i d e}{3 a^{2} f^{2}}-\frac {2 i \left (i d f x +3 d f x \,{\mathrm e}^{i \left (f x +e \right )}+i c f +i d \,{\mathrm e}^{i \left (f x +e \right )}+3 c f \,{\mathrm e}^{i \left (f x +e \right )}+d \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{3 f^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{3} a^{2}}+\frac {2 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{3 a^{2} f^{2}}\) \(132\)
parallelrisch \(\frac {-d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3} \ln \left (\sec \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )+2 d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+2 x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d f +\left (-6 c f +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (-6 c f +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-4 f \left (\frac {d x}{2}+c \right )}{3 f^{2} a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) \(142\)
norman \(\frac {-\frac {4 c}{3 f a}-\frac {2 d x}{3 f a}+\frac {\left (-6 c f +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{3 a \,f^{2}}+\frac {\left (-6 c f +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 a \,f^{2}}+\frac {2 d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f a}}{a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {2 d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{3 a^{2} f^{2}}-\frac {d \ln \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )}{3 a^{2} f^{2}}\) \(156\)
default \(-\frac {2 \left (-\frac {c \left (-\frac {4}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {2}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}+\frac {2}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}\right )}{2 f}+\frac {\frac {d x}{3 f}-\frac {d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{3 f^{2}}-\frac {d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 f^{2}}-\frac {d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{3 f^{2}}+\frac {d \ln \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )}{6 f^{2}}\right )}{a^{2}}\) \(169\)

Input:

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

Output:

-2/3*I*d/a^2/f*x-2/3*I*d/a^2/f^2*e-2/3*I*(I*d*f*x+3*d*f*x*exp(I*(f*x+e))+I 
*c*f+I*d*exp(I*(f*x+e))+3*c*f*exp(I*(f*x+e))+d*exp(2*I*(f*x+e)))/f^2/(exp( 
I*(f*x+e))+I)^3/a^2+2/3*d/a^2/f^2*ln(exp(I*(f*x+e))+I)
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1336 vs. \(2 (122) = 244\).

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

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

Output:

Piecewise((-6*c*f*tan(e/2 + f*x/2)**2/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9 
*a**2*f**2*tan(e/2 + f*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f** 
2) - 6*c*f*tan(e/2 + f*x/2)/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2 
*tan(e/2 + f*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2) - 4*c*f 
/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 + f*x/2)**2 + 9*a* 
*2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2) + 2*d*f*x*tan(e/2 + f*x/2)**3/(3*a 
**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 + f*x/2)**2 + 9*a**2*f* 
*2*tan(e/2 + f*x/2) + 3*a**2*f**2) - 2*d*f*x/(3*a**2*f**2*tan(e/2 + f*x/2) 
**3 + 9*a**2*f**2*tan(e/2 + f*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a 
**2*f**2) + 2*d*log(tan(e/2 + f*x/2) + 1)*tan(e/2 + f*x/2)**3/(3*a**2*f**2 
*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 + f*x/2)**2 + 9*a**2*f**2*tan(e 
/2 + f*x/2) + 3*a**2*f**2) + 6*d*log(tan(e/2 + f*x/2) + 1)*tan(e/2 + f*x/2 
)**2/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 + f*x/2)**2 + 
9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2) + 6*d*log(tan(e/2 + f*x/2) + 1 
)*tan(e/2 + f*x/2)/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 
+ f*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2) + 2*d*log(tan(e/ 
2 + f*x/2) + 1)/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a**2*f**2*tan(e/2 + f 
*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2) - d*log(tan(e/2 + f 
*x/2)**2 + 1)*tan(e/2 + f*x/2)**3/(3*a**2*f**2*tan(e/2 + f*x/2)**3 + 9*a** 
2*f**2*tan(e/2 + f*x/2)**2 + 9*a**2*f**2*tan(e/2 + f*x/2) + 3*a**2*f**2...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 910 vs. \(2 (110) = 220\).

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

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

Output:

1/3*(2*d*e*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x 
+ e) + 1)^2 + 2)/(a^2*f + 3*a^2*f*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2* 
f*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*f*sin(f*x + e)^3/(cos(f*x + e) 
 + 1)^3) + (2*(f*x + 3*(f*x + e)*sin(f*x + e) + e + cos(f*x + e) + sin(2*f 
*x + 2*e))*cos(3*f*x + 3*e) - 2*(9*(f*x + e)*cos(f*x + e) - 6*sin(f*x + e) 
 - 1)*cos(2*f*x + 2*e) - 6*cos(2*f*x + 2*e)^2 - 6*cos(f*x + e)^2 - (6*(cos 
(f*x + e) + sin(2*f*x + 2*e))*cos(3*f*x + 3*e) - cos(3*f*x + 3*e)^2 + 6*(3 
*sin(f*x + e) + 1)*cos(2*f*x + 2*e) - 9*cos(2*f*x + 2*e)^2 - 9*cos(f*x + e 
)^2 - 2*(3*cos(2*f*x + 2*e) - 3*sin(f*x + e) - 1)*sin(3*f*x + 3*e) - sin(3 
*f*x + 3*e)^2 - 18*cos(f*x + e)*sin(2*f*x + 2*e) - 9*sin(2*f*x + 2*e)^2 - 
9*sin(f*x + e)^2 - 6*sin(f*x + e) - 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 
 + 2*sin(f*x + e) + 1) - 2*(3*(f*x + e)*cos(f*x + e) + cos(2*f*x + 2*e) - 
sin(f*x + e))*sin(3*f*x + 3*e) - 6*(f*x + 3*(f*x + e)*sin(f*x + e) + e + 2 
*cos(f*x + e))*sin(2*f*x + 2*e) - 6*sin(2*f*x + 2*e)^2 - 6*sin(f*x + e)^2 
- 2*sin(f*x + e))*d/(a^2*f*cos(3*f*x + 3*e)^2 + 9*a^2*f*cos(2*f*x + 2*e)^2 
 + 9*a^2*f*cos(f*x + e)^2 + a^2*f*sin(3*f*x + 3*e)^2 + 18*a^2*f*cos(f*x + 
e)*sin(2*f*x + 2*e) + 9*a^2*f*sin(2*f*x + 2*e)^2 + 9*a^2*f*sin(f*x + e)^2 
+ 6*a^2*f*sin(f*x + e) + a^2*f - 6*(a^2*f*cos(f*x + e) + a^2*f*sin(2*f*x + 
 2*e))*cos(3*f*x + 3*e) - 6*(3*a^2*f*sin(f*x + e) + a^2*f)*cos(2*f*x + 2*e 
) + 2*(3*a^2*f*cos(2*f*x + 2*e) - 3*a^2*f*sin(f*x + e) - a^2*f)*sin(3*f...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2486 vs. \(2 (110) = 220\).

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

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

Output:

-1/3*(2*d*f*x*tan(1/2*f*x)^3*tan(1/2*e)^3 + 2*c*f*tan(1/2*f*x)^3*tan(1/2*e 
)^3 - d*log(2*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^2*tan(1/2*e) - 
 2*tan(1/2*f*x)*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 2*tan(1/2*f 
*x) + 2*tan(1/2*e) + 1)/(tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 + ta 
n(1/2*e)^2 + 1))*tan(1/2*f*x)^3*tan(1/2*e)^3 - 6*d*f*x*tan(1/2*f*x)^2*tan( 
1/2*e)^2 + 3*d*log(2*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^2*tan(1 
/2*e) - 2*tan(1/2*f*x)*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 2*ta 
n(1/2*f*x) + 2*tan(1/2*e) + 1)/(tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x) 
^2 + tan(1/2*e)^2 + 1))*tan(1/2*f*x)^3*tan(1/2*e)^2 + 3*d*log(2*(tan(1/2*f 
*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^2*tan(1/2*e) - 2*tan(1/2*f*x)*tan(1/2* 
e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 2*tan(1/2*f*x) + 2*tan(1/2*e) + 1)/ 
(tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 1))*tan(1/2 
*f*x)^2*tan(1/2*e)^3 + d*tan(1/2*f*x)^3*tan(1/2*e)^3 + 2*d*f*x*tan(1/2*f*x 
)^3 + 6*d*f*x*tan(1/2*f*x)^2*tan(1/2*e) - 3*d*log(2*(tan(1/2*f*x)^2*tan(1/ 
2*e)^2 - 2*tan(1/2*f*x)^2*tan(1/2*e) - 2*tan(1/2*f*x)*tan(1/2*e)^2 + tan(1 
/2*f*x)^2 + tan(1/2*e)^2 + 2*tan(1/2*f*x) + 2*tan(1/2*e) + 1)/(tan(1/2*f*x 
)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 1))*tan(1/2*f*x)^3*tan( 
1/2*e) + 6*d*f*x*tan(1/2*f*x)*tan(1/2*e)^2 - 6*c*f*tan(1/2*f*x)^2*tan(1/2* 
e)^2 - 3*d*log(2*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^2*tan(1/2*e 
) - 2*tan(1/2*f*x)*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan(1/2*e)^2 + 2*tan...
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 295, normalized size of antiderivative = 1.99 \[ \int \frac {c+d x}{(a+a \sin (e+f x))^2} \, dx=\frac {-3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d -9 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -9 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d -3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) d +6 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d +18 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d +18 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d +6 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) d +6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c f +6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d f x -2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d -6 c f -6 d f x -2 d}{9 a^{2} f^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )} \] Input:

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

Output:

( - 3*log(tan((e + f*x)/2)**2 + 1)*tan((e + f*x)/2)**3*d - 9*log(tan((e + 
f*x)/2)**2 + 1)*tan((e + f*x)/2)**2*d - 9*log(tan((e + f*x)/2)**2 + 1)*tan 
((e + f*x)/2)*d - 3*log(tan((e + f*x)/2)**2 + 1)*d + 6*log(tan((e + f*x)/2 
) + 1)*tan((e + f*x)/2)**3*d + 18*log(tan((e + f*x)/2) + 1)*tan((e + f*x)/ 
2)**2*d + 18*log(tan((e + f*x)/2) + 1)*tan((e + f*x)/2)*d + 6*log(tan((e + 
 f*x)/2) + 1)*d + 6*tan((e + f*x)/2)**3*c*f + 6*tan((e + f*x)/2)**3*d*f*x 
- 2*tan((e + f*x)/2)**3*d - 6*c*f - 6*d*f*x - 2*d)/(9*a**2*f**2*(tan((e + 
f*x)/2)**3 + 3*tan((e + f*x)/2)**2 + 3*tan((e + f*x)/2) + 1))