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

Optimal result
Mathematica [B] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 26, antiderivative size = 110 \[ \int \frac {(e+f x) \sin ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {(e+f x)^2}{2 a f}-\frac {(e+f x) \cos (c+d x)}{a d}-\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {2 f \log \left (\sin \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {f \sin (c+d x)}{a d^2} \] Output:

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

Mathematica [B] (verified)

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

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

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

Output:

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

Rubi [A] (verified)

Time = 0.81 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.03, number of steps used = 14, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {5026, 3042, 3777, 3042, 3117, 5026, 17, 3042, 3799, 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 {(e+f x) \sin ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 5026

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3777

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {f \int \sin \left (c+d x+\frac {\pi }{2}\right )dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}}{a}-\int \frac {(e+f x) \sin (c+d x)}{\sin (c+d x) a+a}dx\)

\(\Big \downarrow \) 3117

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

\(\Big \downarrow \) 5026

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

\(\Big \downarrow \) 17

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3799

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4672

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3956

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 17
Int[(c_.)*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[c*((a + b*x)^(m + 1 
)/(b*(m + 1))), x] /; FreeQ[{a, b, c, m}, x] && NeQ[m, -1]
 

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 3117
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; 
 FreeQ[{c, d}, x]
 

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

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

Time = 1.54 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.15

method result size
parallelrisch \(\frac {-2 \cos \left (d x +c \right ) f \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+4 \cos \left (d x +c \right ) f \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-d \left (f x +e \right ) \cos \left (2 d x +2 c \right )+\sin \left (2 d x +2 c \right ) f -2 d \left (\left (x \left (\frac {f x}{2}+e \right ) d -2 e \right ) \cos \left (d x +c \right )-\left (f x +e \right ) \left (\sin \left (d x +c \right )-\frac {3}{2}\right )\right )}{2 d^{2} a \cos \left (d x +c \right )}\) \(127\)
risch \(-\frac {f \,x^{2}}{2 a}-\frac {e x}{a}-\frac {\left (d x f +d e +i f \right ) {\mathrm e}^{i \left (d x +c \right )}}{2 d^{2} a}-\frac {\left (d x f +d e -i f \right ) {\mathrm e}^{-i \left (d x +c \right )}}{2 d^{2} a}-\frac {2 i f x}{d a}-\frac {2 i f c}{d^{2} a}-\frac {2 \left (f x +e \right )}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}+\frac {2 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d^{2} a}\) \(147\)
default \(-\frac {\frac {4 e}{d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\frac {2 f x}{d}-\frac {2 f x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-\frac {4 f \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d^{2}}+\frac {2 f \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d^{2}}+\frac {2 e \left (\frac {2}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{d}+\frac {2 f \left (\frac {\left (d x +c \right )^{2}}{2}-\sin \left (d x +c \right )+\cos \left (d x +c \right ) \left (d x +c \right )-\left (d x +c \right ) c -\cos \left (d x +c \right ) c \right )}{d^{2}}}{2 a}\) \(191\)
norman \(\frac {\frac {-2 d e -2 f}{d^{2} a}+\frac {\left (2 d e -2 f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d^{2} a}-\frac {f \,x^{2}}{2 a}-\frac {e x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-\frac {e x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a}-\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}-\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a}-\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a}-\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 a}-\frac {\left (d e +2 f \right ) x}{a d}+\frac {2 \left (-d e -f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d^{2} a}+\frac {2 \left (d e -f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d^{2} a}-\frac {\left (d e -2 f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}-\frac {2 \left (d e -f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {2 \left (d e +f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 f \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d^{2} a}-\frac {f \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d^{2} a}\) \(406\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 196 vs. \(2 (96) = 192\).

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

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

Output:

-1/2*(d^2*f*x^2 + 2*(d*f*x + d*e + f)*cos(d*x + c)^2 + 2*d*e + 2*(d^2*e + 
d*f)*x + (d^2*f*x^2 + 4*d*e + 2*(d^2*e + 2*d*f)*x)*cos(d*x + c) - 2*(f*cos 
(d*x + c) + f*sin(d*x + c) + f)*log(sin(d*x + c) + 1) + (d^2*f*x^2 - 2*d*e 
 + 2*(d^2*e - d*f)*x + 2*(d*f*x + d*e - f)*cos(d*x + c) - 2*f)*sin(d*x + c 
) - 2*f)/(a*d^2*cos(d*x + c) + a*d^2*sin(d*x + c) + a*d^2)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1867 vs. \(2 (85) = 170\).

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

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

Output:

Piecewise((-2*d**2*e*x*tan(c/2 + d*x/2)**3/(2*a*d**2*tan(c/2 + d*x/2)**3 + 
 2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - 2* 
d**2*e*x*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*tan( 
c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - 2*d**2*e*x*tan(c 
/2 + d*x/2)/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 
 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - 2*d**2*e*x/(2*a*d**2*tan(c/2 + d* 
x/2)**3 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d 
**2) - d**2*f*x**2*tan(c/2 + d*x/2)**3/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a 
*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - d**2*f 
*x**2*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*tan(c/2 
 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - d**2*f*x**2*tan(c/2 
 + d*x/2)/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 2 
*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - d**2*f*x**2/(2*a*d**2*tan(c/2 + d*x 
/2)**3 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d* 
*2) - 4*d*e*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*t 
an(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - 4*d*e*tan(c/2 
 + d*x/2)/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 2 
*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) - 8*d*e/(2*a*d**2*tan(c/2 + d*x/2)**3 
 + 2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2*tan(c/2 + d*x/2) + 2*a*d**2) + 
4*d*f*x*tan(c/2 + d*x/2)**3/(2*a*d**2*tan(c/2 + d*x/2)**3 + 2*a*d**2*ta...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1762 vs. \(2 (96) = 192\).

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

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

Output:

1/2*(4*c*f*((sin(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^2/(cos(d*x + c 
) + 1)^2 + 2)/(a*d + a*d*sin(d*x + c)/(cos(d*x + c) + 1) + a*d*sin(d*x + c 
)^2/(cos(d*x + c) + 1)^2 + a*d*sin(d*x + c)^3/(cos(d*x + c) + 1)^3) + arct 
an(sin(d*x + c)/(cos(d*x + c) + 1))/(a*d)) - 4*e*((sin(d*x + c)/(cos(d*x + 
 c) + 1) + sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 2)/(a + a*sin(d*x + c)/(c 
os(d*x + c) + 1) + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^ 
3/(cos(d*x + c) + 1)^3) + arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a) - ((( 
d*x + c)^2 - 1)*cos(d*x + c)^4 + ((d*x + c)^2 - 1)*sin(d*x + c)^4 + ((d*x 
+ c)*cos(d*x + c) + sin(d*x + c) + 1)*cos(2*d*x + 2*c)^3 + 7*(d*x + c)*cos 
(d*x + c)^3 + (d*x + (d*x + c)*sin(d*x + c) + c - cos(d*x + c))*sin(2*d*x 
+ 2*c)^3 + (2*(d*x + c)^2 - 3)*sin(d*x + c)^3 + (((d*x + c)^2 - 1)*cos(d*x 
 + c)^2 + ((d*x + c)^2 - 3)*sin(d*x + c)^2 + (d*x + c)^2 + 6*(d*x + c)*cos 
(d*x + c) + 2*((d*x + c)^2 - (d*x + c)*cos(d*x + c) - 2)*sin(d*x + c) - 1) 
*cos(2*d*x + 2*c)^2 + ((d*x + c)^2 - 1)*cos(d*x + c)^2 + (((d*x + c)^2 - 3 
)*cos(d*x + c)^2 + ((d*x + c)^2 - 1)*sin(d*x + c)^2 + (d*x + c)^2 + ((d*x 
+ c)*cos(d*x + c) + sin(d*x + c) + 1)*cos(2*d*x + 2*c) + 8*(d*x + c)*cos(d 
*x + c) + 2*((d*x + c)^2 + (d*x + c)*cos(d*x + c) - 1)*sin(d*x + c) - 1)*s 
in(2*d*x + 2*c)^2 + (2*((d*x + c)^2 - 1)*cos(d*x + c)^2 + (d*x + c)^2 + 7* 
(d*x + c)*cos(d*x + c) - 3)*sin(d*x + c)^2 + ((d*x + c)*cos(d*x + c)^3 - ( 
2*(d*x + c)^2 - 3)*sin(d*x + c)^3 - (4*(d*x + c)^2 - (d*x + c)*cos(d*x ...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2952 vs. \(2 (96) = 192\).

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

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

Output:

-1/2*(d^2*f*x^2*tan(1/2*d*x)^3*tan(1/2*c)^3 - d^2*f*x^2*tan(1/2*d*x)^3*tan 
(1/2*c)^2 - d^2*f*x^2*tan(1/2*d*x)^2*tan(1/2*c)^3 + 2*d^2*e*x*tan(1/2*d*x) 
^3*tan(1/2*c)^3 + d^2*f*x^2*tan(1/2*d*x)^3*tan(1/2*c) - d^2*f*x^2*tan(1/2* 
d*x)^2*tan(1/2*c)^2 - 2*d^2*e*x*tan(1/2*d*x)^3*tan(1/2*c)^2 + d^2*f*x^2*ta 
n(1/2*d*x)*tan(1/2*c)^3 - 2*d^2*e*x*tan(1/2*d*x)^2*tan(1/2*c)^3 + 4*d*f*x* 
tan(1/2*d*x)^3*tan(1/2*c)^3 - d^2*f*x^2*tan(1/2*d*x)^3 - d^2*f*x^2*tan(1/2 
*d*x)^2*tan(1/2*c) + 2*d^2*e*x*tan(1/2*d*x)^3*tan(1/2*c) - d^2*f*x^2*tan(1 
/2*d*x)*tan(1/2*c)^2 - 2*d^2*e*x*tan(1/2*d*x)^2*tan(1/2*c)^2 - d^2*f*x^2*t 
an(1/2*c)^3 + 2*d^2*e*x*tan(1/2*d*x)*tan(1/2*c)^3 + 4*d*e*tan(1/2*d*x)^3*t 
an(1/2*c)^3 - 2*f*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*ta 
n(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)^3*tan(1/2*c)^3 - d^2*f*x^2*tan(1/2 
*d*x)^2 - 2*d^2*e*x*tan(1/2*d*x)^3 + d^2*f*x^2*tan(1/2*d*x)*tan(1/2*c) - 2 
*d^2*e*x*tan(1/2*d*x)^2*tan(1/2*c) - d^2*f*x^2*tan(1/2*c)^2 - 2*d^2*e*x*ta 
n(1/2*d*x)*tan(1/2*c)^2 - 12*d*f*x*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*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)^3*tan(1/2*c)^2 - 2*d^2*e*x*tan(1/2*c)^3 + 2*f*log(2*(t...
 

Mupad [B] (verification not implemented)

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

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

Output:

exp(- c*1i - d*x*1i)*((f*1i - d*e)/(2*a*d^2) - (f*x)/(2*a*d)) - exp(c*1i + 
 d*x*1i)*((f*1i + d*e)/(2*a*d^2) + (f*x)/(2*a*d)) - (f*x^2)/(2*a) + (2*f*l 
og(exp(c*1i)*exp(d*x*1i) + 1i))/(a*d^2) - (x*(f*2i + d*e))/(a*d) - ((e + f 
*x)*2i)/(a*d*(exp(c*1i + d*x*1i)*1i - 1))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 273, normalized size of antiderivative = 2.48 \[ \int \frac {(e+f x) \sin ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {-2 \cos \left (d x +c \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d e -2 \cos \left (d x +c \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d f x -2 \cos \left (d x +c \right ) d e -2 \cos \left (d x +c \right ) d f x -2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) f -2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) f +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) f +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) f +2 \sin \left (d x +c \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) f +2 \sin \left (d x +c \right ) f -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d^{2} e x -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d^{2} f \,x^{2}+4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d e +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d f x -2 d^{2} e x -d^{2} f \,x^{2}-2 d f x}{2 a \,d^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \] Input:

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

Output:

( - 2*cos(c + d*x)*tan((c + d*x)/2)*d*e - 2*cos(c + d*x)*tan((c + d*x)/2)* 
d*f*x - 2*cos(c + d*x)*d*e - 2*cos(c + d*x)*d*f*x - 2*log(tan((c + d*x)/2) 
**2 + 1)*tan((c + d*x)/2)*f - 2*log(tan((c + d*x)/2)**2 + 1)*f + 4*log(tan 
((c + d*x)/2) + 1)*tan((c + d*x)/2)*f + 4*log(tan((c + d*x)/2) + 1)*f + 2* 
sin(c + d*x)*tan((c + d*x)/2)*f + 2*sin(c + d*x)*f - 2*tan((c + d*x)/2)*d* 
*2*e*x - tan((c + d*x)/2)*d**2*f*x**2 + 4*tan((c + d*x)/2)*d*e + 2*tan((c 
+ d*x)/2)*d*f*x - 2*d**2*e*x - d**2*f*x**2 - 2*d*f*x)/(2*a*d**2*(tan((c + 
d*x)/2) + 1))