Integrand size = 26, antiderivative size = 51 \[ \int \frac {(e+f x) \cos ^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 {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*sin(d*x+c)/a/d^2
Time = 2.80 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {(c+d x) (-2 d e+c f-d f x)-2 d (e+f x) \cos (c+d x)+2 f \sin (c+d x)}{2 a d^2} \] Input:
Integrate[((e + f*x)*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
Output:
-1/2*((c + d*x)*(-2*d*e + c*f - d*f*x) - 2*d*(e + f*x)*Cos[c + d*x] + 2*f* Sin[c + d*x])/(a*d^2)
Time = 0.33 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {5034, 17, 3042, 3777, 3042, 3117}
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) \cos ^2(c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 5034 |
\(\displaystyle \frac {\int (e+f x)dx}{a}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 17 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3777 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\frac {f \int \cos (c+d x)dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\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}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\frac {f \sin (c+d x)}{d^2}-\frac {(e+f x) \cos (c+d x)}{d}}{a}\) |
Input:
Int[((e + f*x)*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
Output:
(e + f*x)^2/(2*a*f) - (-(((e + f*x)*Cos[c + d*x])/d) + (f*Sin[c + d*x])/d^ 2)/a
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]
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
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]
Int[(Cos[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.) *Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a Int[(e + f*x)^m*Cos[c + d*x]^(n - 2), x], x] - Simp[1/b Int[(e + f*x)^m*Cos[c + d*x]^(n - 2)*Sin[ c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^ 2 - b^2, 0]
Time = 0.72 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.86
method | result | size |
parallelrisch | \(\frac {\left (f x +e \right ) d \cos \left (d x +c \right )-f \sin \left (d x +c \right )+d \left (x \left (\frac {f x}{2}+e \right ) d +e \right )}{d^{2} a}\) | \(44\) |
risch | \(\frac {f \,x^{2}}{2 a}+\frac {e x}{a}+\frac {\left (f x +e \right ) \cos \left (d x +c \right )}{a d}-\frac {f \sin \left (d x +c \right )}{a \,d^{2}}\) | \(50\) |
derivativedivides | \(\frac {-\cos \left (d x +c \right ) c f +\cos \left (d x +c \right ) d e -f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
default | \(\frac {-\cos \left (d x +c \right ) c f +\cos \left (d x +c \right ) d e -f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
norman | \(\frac {\frac {2 e}{d 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 {\left (d e +f \right ) x}{a d}-\frac {2 f \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d^{2} a}+\frac {\left (2 d e -2 f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{2} a}+\frac {\left (d e -f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a d}+\frac {\left (d e -f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}+\frac {\left (d e +f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {f \,x^{2}}{2 a}+\frac {2 e x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {2 e x \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 )}{2 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 {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}}{\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 )}\) | \(364\) |
Input:
int((f*x+e)*cos(d*x+c)^2/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)
Output:
((f*x+e)*d*cos(d*x+c)-f*sin(d*x+c)+d*(x*(1/2*f*x+e)*d+e))/d^2/a
Time = 0.13 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.96 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{2} f x^{2} + 2 \, d^{2} e x + 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) - 2 \, f \sin \left (d x + c\right )}{2 \, a d^{2}} \] Input:
integrate((f*x+e)*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")
Output:
1/2*(d^2*f*x^2 + 2*d^2*e*x + 2*(d*f*x + d*e)*cos(d*x + c) - 2*f*sin(d*x + c))/(a*d^2)
Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (39) = 78\).
Time = 1.31 (sec) , antiderivative size = 326, normalized size of antiderivative = 6.39 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\begin {cases} \frac {2 d^{2} e x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d^{2} e x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {4 d e}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {2 d f x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d f x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {4 f \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} & \text {for}\: d \neq 0 \\\frac {\left (e x + \frac {f x^{2}}{2}\right ) \cos ^{2}{\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \] Input:
integrate((f*x+e)*cos(d*x+c)**2/(a+a*sin(d*x+c)),x)
Output:
Piecewise((2*d**2*e*x*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 2*d**2*e*x/(2*a*d**2*tan(c/2 + d*x/2)**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)**2 + 2*a*d**2) + d**2* f*x**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 4*d*e/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) - 2*d*f*x*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 2*d*f*x/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) - 4*f*tan(c/2 + d*x/2)/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2), Ne(d, 0 )), ((e*x + f*x**2/2)*cos(c)**2/(a*sin(c) + a), True))
Leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (49) = 98\).
Time = 0.12 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.96 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {4 \, c f {\left (\frac {1}{a d + \frac {a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} - 4 \, e {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} - \frac {{\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} f}{a d}}{2 \, d} \] Input:
integrate((f*x+e)*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")
Output:
-1/2*(4*c*f*(1/(a*d + a*d*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(si n(d*x + c)/(cos(d*x + c) + 1))/(a*d)) - 4*e*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)) - ((d*x + c) ^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))*f/(a*d))/d
Leaf count of result is larger than twice the leaf count of optimal. 322 vs. \(2 (49) = 98\).
Time = 0.13 (sec) , antiderivative size = 322, normalized size of antiderivative = 6.31 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{2} f x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{2} f x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} + d^{2} f x^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d f x \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, d x\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d e \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{2} f x^{2} - 2 \, d f x \tan \left (\frac {1}{2} \, d x\right )^{2} - 8 \, d f x \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, d f x \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x - 2 \, d e \tan \left (\frac {1}{2} \, d x\right )^{2} - 8 \, d e \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) + 4 \, f \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, d e \tan \left (\frac {1}{2} \, c\right )^{2} + 4 \, f \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d f x + 2 \, d e - 4 \, f \tan \left (\frac {1}{2} \, d x\right ) - 4 \, f \tan \left (\frac {1}{2} \, c\right )}{2 \, {\left (a d^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} + a d^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{2}\right )}} \] Input:
integrate((f*x+e)*cos(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)^2*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*tan(1/2*d*x)^2 + d^2*f*x^2*tan(1/2*c)^2 + 2*d*f*x*tan (1/2*d*x)^2*tan(1/2*c)^2 + 2*d^2*e*x*tan(1/2*d*x)^2 + 2*d^2*e*x*tan(1/2*c) ^2 + 2*d*e*tan(1/2*d*x)^2*tan(1/2*c)^2 + d^2*f*x^2 - 2*d*f*x*tan(1/2*d*x)^ 2 - 8*d*f*x*tan(1/2*d*x)*tan(1/2*c) - 2*d*f*x*tan(1/2*c)^2 + 2*d^2*e*x - 2 *d*e*tan(1/2*d*x)^2 - 8*d*e*tan(1/2*d*x)*tan(1/2*c) + 4*f*tan(1/2*d*x)^2*t an(1/2*c) - 2*d*e*tan(1/2*c)^2 + 4*f*tan(1/2*d*x)*tan(1/2*c)^2 + 2*d*f*x + 2*d*e - 4*f*tan(1/2*d*x) - 4*f*tan(1/2*c))/(a*d^2*tan(1/2*d*x)^2*tan(1/2* c)^2 + a*d^2*tan(1/2*d*x)^2 + a*d^2*tan(1/2*c)^2 + a*d^2)
Time = 37.88 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\frac {f\,x^2}{2}+e\,x}{a}-\frac {f\,\sin \left (c+d\,x\right )-d\,\left (e\,\cos \left (c+d\,x\right )+f\,x\,\cos \left (c+d\,x\right )\right )}{a\,d^2} \] Input:
int((cos(c + d*x)^2*(e + f*x))/(a + a*sin(c + d*x)),x)
Output:
(e*x + (f*x^2)/2)/a - (f*sin(c + d*x) - d*(e*cos(c + d*x) + f*x*cos(c + d* x)))/(a*d^2)
Time = 0.16 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.31 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 \cos \left (d x +c \right ) d e +2 \cos \left (d x +c \right ) d f x -2 \sin \left (d x +c \right ) f +2 c d e +2 c f +2 d^{2} e x +d^{2} f \,x^{2}-2 d e}{2 a \,d^{2}} \] Input:
int((f*x+e)*cos(d*x+c)^2/(a+a*sin(d*x+c)),x)
Output:
(2*cos(c + d*x)*d*e + 2*cos(c + d*x)*d*f*x - 2*sin(c + d*x)*f + 2*c*d*e + 2*c*f + 2*d**2*e*x + d**2*f*x**2 - 2*d*e)/(2*a*d**2)