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

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

Optimal result

Integrand size = 18, antiderivative size = 88 \[ \int \frac {a+a \sin (e+f x)}{(c+d x)^2} \, dx=-\frac {a}{d (c+d x)}+\frac {a f \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d^2}-\frac {a \sin (e+f x)}{d (c+d x)}-\frac {a f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d^2} \] Output:

-a/d/(d*x+c)+a*f*cos(-e+c*f/d)*Ci(c*f/d+f*x)/d^2-a*sin(f*x+e)/d/(d*x+c)+a* 
f*sin(-e+c*f/d)*Si(c*f/d+f*x)/d^2
 

Mathematica [A] (verified)

Time = 0.64 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.25 \[ \int \frac {a+a \sin (e+f x)}{(c+d x)^2} \, dx=\frac {a (1+\sin (e+f x)) \left (f (c+d x) \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (f \left (\frac {c}{d}+x\right )\right )-d (1+\sin (e+f x))-f (c+d x) \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )\right )}{d^2 (c+d x) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \] Input:

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

Output:

(a*(1 + Sin[e + f*x])*(f*(c + d*x)*Cos[e - (c*f)/d]*CosIntegral[f*(c/d + x 
)] - d*(1 + Sin[e + f*x]) - f*(c + d*x)*Sin[e - (c*f)/d]*SinIntegral[f*(c/ 
d + x)]))/(d^2*(c + d*x)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2)
 

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 3798, 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 \frac {a \sin (e+f x)+a}{(c+d x)^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3798

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a f \operatorname {CosIntegral}\left (x f+\frac {c f}{d}\right ) \cos \left (e-\frac {c f}{d}\right )}{d^2}-\frac {a f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d^2}-\frac {a \sin (e+f x)}{d (c+d x)}-\frac {a}{d (c+d x)}\)

Input:

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

Output:

-(a/(d*(c + d*x))) + (a*f*Cos[e - (c*f)/d]*CosIntegral[(c*f)/d + f*x])/d^2 
 - (a*Sin[e + f*x])/(d*(c + d*x)) - (a*f*Sin[e - (c*f)/d]*SinIntegral[(c*f 
)/d + f*x])/d^2
 

Defintions of rubi rules used

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

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

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

Time = 1.00 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.39

method result size
parts \(-\frac {a}{d \left (d x +c \right )}+a f \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )\) \(122\)
derivativedivides \(\frac {a \,f^{2} \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )-\frac {a \,f^{2}}{\left (c f -d e +d \left (f x +e \right )\right ) d}}{f}\) \(141\)
default \(\frac {a \,f^{2} \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )-\frac {a \,f^{2}}{\left (c f -d e +d \left (f x +e \right )\right ) d}}{f}\) \(141\)
risch \(-\frac {a}{d \left (d x +c \right )}-\frac {f a \,{\mathrm e}^{\frac {i \left (c f -d e \right )}{d}} \operatorname {expIntegral}_{1}\left (i f x +i e +\frac {i \left (c f -d e \right )}{d}\right )}{2 d^{2}}-\frac {a f \,{\mathrm e}^{-\frac {i \left (c f -d e \right )}{d}} \operatorname {expIntegral}_{1}\left (-i f x -i e -\frac {i c f -i d e}{d}\right )}{2 d^{2}}-\frac {a \left (-2 d x f -2 c f \right ) \sin \left (f x +e \right )}{2 d \left (d x +c \right ) \left (-d x f -c f \right )}\) \(154\)

Input:

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

Output:

-a/d/(d*x+c)+a*f*(-sin(f*x+e)/(c*f-d*e+d*(f*x+e))/d+(Si(f*x+e+(c*f-d*e)/d) 
*sin((c*f-d*e)/d)/d+Ci(f*x+e+(c*f-d*e)/d)*cos((c*f-d*e)/d)/d)/d)
 

Fricas [A] (verification not implemented)

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

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

Output:

((a*d*f*x + a*c*f)*cos(-(d*e - c*f)/d)*cos_integral((d*f*x + c*f)/d) - a*d 
*sin(f*x + e) + (a*d*f*x + a*c*f)*sin(-(d*e - c*f)/d)*sin_integral((d*f*x 
+ c*f)/d) - a*d)/(d^3*x + c*d^2)
 

Sympy [F]

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

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

Output:

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

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.11 (sec) , antiderivative size = 196, normalized size of antiderivative = 2.23 \[ \int \frac {a+a \sin (e+f x)}{(c+d x)^2} \, dx=-\frac {\frac {2 \, a f^{2}}{{\left (f x + e\right )} d^{2} - d^{2} e + c d f} - \frac {{\left (f^{2} {\left (-i \, E_{2}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + i \, E_{2}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f^{2} {\left (E_{2}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{2}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} a}{{\left (f x + e\right )} d^{2} - d^{2} e + c d f}}{2 \, f} \] Input:

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

Output:

-1/2*(2*a*f^2/((f*x + e)*d^2 - d^2*e + c*d*f) - (f^2*(-I*exp_integral_e(2, 
 (I*(f*x + e)*d - I*d*e + I*c*f)/d) + I*exp_integral_e(2, -(I*(f*x + e)*d 
- I*d*e + I*c*f)/d))*cos(-(d*e - c*f)/d) + f^2*(exp_integral_e(2, (I*(f*x 
+ e)*d - I*d*e + I*c*f)/d) + exp_integral_e(2, -(I*(f*x + e)*d - I*d*e + I 
*c*f)/d))*sin(-(d*e - c*f)/d))*a/((f*x + e)*d^2 - d^2*e + c*d*f))/f
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 533 vs. \(2 (89) = 178\).

Time = 0.35 (sec) , antiderivative size = 533, normalized size of antiderivative = 6.06 \[ \int \frac {a+a \sin (e+f x)}{(c+d x)^2} \, dx=\frac {{\left ({\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} f^{2} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) - d e f^{2} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + c f^{3} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + {\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} f^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) - d e f^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + c f^{3} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + d f^{2} \sin \left (-\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )}}{d}\right )\right )} a d^{2}}{{\left ({\left (d x + c\right )} d^{4} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d^{5} e + c d^{4} f\right )} f} - \frac {a}{{\left (d x + c\right )} d} \] Input:

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

Output:

((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*cos(-(d*e - c*f)/d)*cos 
_integral(((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) - 
 d*e*f^2*cos(-(d*e - c*f)/d)*cos_integral(((d*x + c)*(d*e/(d*x + c) - c*f/ 
(d*x + c) + f) - d*e + c*f)/d) + c*f^3*cos(-(d*e - c*f)/d)*cos_integral((( 
d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) + (d*x + c)*( 
d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*sin(-(d*e - c*f)/d)*sin_integral((( 
d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) - d*e*f^2*sin 
(-(d*e - c*f)/d)*sin_integral(((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + 
f) - d*e + c*f)/d) + c*f^3*sin(-(d*e - c*f)/d)*sin_integral(((d*x + c)*(d* 
e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) + d*f^2*sin(-(d*x + c)*(d 
*e/(d*x + c) - c*f/(d*x + c) + f)/d))*a*d^2/(((d*x + c)*d^4*(d*e/(d*x + c) 
 - c*f/(d*x + c) + f) - d^5*e + c*d^4*f)*f) - a/((d*x + c)*d)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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