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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.45 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3912, 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+b \sin \left (c+\frac {d}{x}\right )}{(e+f x)^2} \, dx\)

\(\Big \downarrow \) 3912

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3798

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

a/(e*(f + e/x)) - (b*d*Cos[c - (d*f)/e]*CosIntegral[(d*f)/e + d/x])/e^2 + 
(b*Sin[c + d/x])/(e*(f + e/x)) + (b*d*Sin[c - (d*f)/e]*SinIntegral[(d*f)/e 
 + d/x])/e^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])
 

rule 3912
Int[((g_.) + (h_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f 
_.)*(x_))^(n_)])^(p_.), x_Symbol] :> Simp[1/(n*f)   Subst[Int[ExpandIntegra 
nd[(a + b*Sin[c + d*x])^p, x^(1/n - 1)*(g - e*(h/f) + h*(x^(1/n)/f))^m, x], 
 x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f, g, h, m}, x] && IGtQ[p 
, 0] && IntegerQ[1/n]
 
Maple [A] (verified)

Time = 1.64 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.36

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

b*(integrate(1/2*sin((c*x + d)/x)/(f^2*x^2 + 2*e*f*x + e^2), x) + integrat 
e(1/2*sin((c*x + d)/x)/((f^2*x^2 + 2*e*f*x + e^2)*cos((c*x + d)/x)^2 + (f^ 
2*x^2 + 2*e*f*x + e^2)*sin((c*x + d)/x)^2), x)) - a/(f^2*x + e*f)
 

Giac [B] (verification not implemented)

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

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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