Integrand size = 10, antiderivative size = 60 \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {1}{2} b x \cos \left (a+\frac {b}{x}\right )+\frac {1}{2} b^2 \operatorname {CosIntegral}\left (\frac {b}{x}\right ) \sin (a)+\frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )+\frac {1}{2} b^2 \cos (a) \text {Si}\left (\frac {b}{x}\right ) \] Output:
1/2*b*x*cos(a+b/x)+1/2*b^2*Ci(b/x)*sin(a)+1/2*x^2*sin(a+b/x)+1/2*b^2*cos(a )*Si(b/x)
Time = 0.07 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.87 \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {1}{2} \left (b^2 \operatorname {CosIntegral}\left (\frac {b}{x}\right ) \sin (a)+x \left (b \cos \left (a+\frac {b}{x}\right )+x \sin \left (a+\frac {b}{x}\right )\right )+b^2 \cos (a) \text {Si}\left (\frac {b}{x}\right )\right ) \] Input:
Integrate[x*Sin[a + b/x],x]
Output:
(b^2*CosIntegral[b/x]*Sin[a] + x*(b*Cos[a + b/x] + x*Sin[a + b/x]) + b^2*C os[a]*SinIntegral[b/x])/2
Time = 0.53 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.92, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.100, Rules used = {3860, 3042, 3778, 3042, 3778, 25, 3042, 3784, 3042, 3780, 3783}
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 x \sin \left (a+\frac {b}{x}\right ) \, dx\) |
\(\Big \downarrow \) 3860 |
\(\displaystyle -\int x^3 \sin \left (a+\frac {b}{x}\right )d\frac {1}{x}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\int x^3 \sin \left (a+\frac {b}{x}\right )d\frac {1}{x}\) |
\(\Big \downarrow \) 3778 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \int x^2 \cos \left (a+\frac {b}{x}\right )d\frac {1}{x}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \int x^2 \sin \left (a+\frac {b}{x}+\frac {\pi }{2}\right )d\frac {1}{x}\) |
\(\Big \downarrow \) 3778 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (b \int -x \sin \left (a+\frac {b}{x}\right )d\frac {1}{x}-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \int x \sin \left (a+\frac {b}{x}\right )d\frac {1}{x}-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \int x \sin \left (a+\frac {b}{x}\right )d\frac {1}{x}-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 3784 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \left (\sin (a) \int x \cos \left (\frac {b}{x}\right )d\frac {1}{x}+\cos (a) \int x \sin \left (\frac {b}{x}\right )d\frac {1}{x}\right )-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \left (\sin (a) \int x \sin \left (\frac {b}{x}+\frac {\pi }{2}\right )d\frac {1}{x}+\cos (a) \int x \sin \left (\frac {b}{x}\right )d\frac {1}{x}\right )-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 3780 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \left (\sin (a) \int x \sin \left (\frac {b}{x}+\frac {\pi }{2}\right )d\frac {1}{x}+\cos (a) \text {Si}\left (\frac {b}{x}\right )\right )-x \cos \left (a+\frac {b}{x}\right )\right )\) |
\(\Big \downarrow \) 3783 |
\(\displaystyle \frac {1}{2} x^2 \sin \left (a+\frac {b}{x}\right )-\frac {1}{2} b \left (-b \left (\sin (a) \operatorname {CosIntegral}\left (\frac {b}{x}\right )+\cos (a) \text {Si}\left (\frac {b}{x}\right )\right )-x \cos \left (a+\frac {b}{x}\right )\right )\) |
Input:
Int[x*Sin[a + b/x],x]
Output:
(x^2*Sin[a + b/x])/2 - (b*(-(x*Cos[a + b/x]) - b*(CosIntegral[b/x]*Sin[a] + Cos[a]*SinIntegral[b/x])))/2
Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(c + d*x)^(m + 1)*(Sin[e + f*x]/(d*(m + 1))), x] - Simp[f/(d*(m + 1)) Int[( c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[m, - 1]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinInte gral[e + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*e - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosInte gral[e - Pi/2 + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[Cos[(d* e - c*f)/d] Int[Sin[c*(f/d) + f*x]/(c + d*x), x], x] + Simp[Sin[(d*e - c* f)/d] Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f}, x] && NeQ[d*e - c*f, 0]
Int[(x_)^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol ] :> Simp[1/n Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sin[c + d*x])^ p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simplify[ (m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[ (m + 1)/n], 0]))
Time = 1.40 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(-b^{2} \left (-\frac {\sin \left (a +\frac {b}{x}\right ) x^{2}}{2 b^{2}}-\frac {\cos \left (a +\frac {b}{x}\right ) x}{2 b}-\frac {\cos \left (a \right ) \operatorname {Si}\left (\frac {b}{x}\right )}{2}-\frac {\operatorname {Ci}\left (\frac {b}{x}\right ) \sin \left (a \right )}{2}\right )\) | \(57\) |
default | \(-b^{2} \left (-\frac {\sin \left (a +\frac {b}{x}\right ) x^{2}}{2 b^{2}}-\frac {\cos \left (a +\frac {b}{x}\right ) x}{2 b}-\frac {\cos \left (a \right ) \operatorname {Si}\left (\frac {b}{x}\right )}{2}-\frac {\operatorname {Ci}\left (\frac {b}{x}\right ) \sin \left (a \right )}{2}\right )\) | \(57\) |
risch | \(-\frac {{\mathrm e}^{-i a} \pi \,\operatorname {csgn}\left (\frac {b}{x}\right ) b^{2}}{4}+\frac {{\mathrm e}^{-i a} \operatorname {Si}\left (\frac {b}{x}\right ) b^{2}}{2}-\frac {i \operatorname {expIntegral}_{1}\left (-\frac {i b}{x}\right ) {\mathrm e}^{-i a} b^{2}}{4}+\frac {i b^{2} \operatorname {expIntegral}_{1}\left (-\frac {i b}{x}\right ) {\mathrm e}^{i a}}{4}+\frac {b x \cos \left (\frac {a x +b}{x}\right )}{2}+\frac {x^{2} \sin \left (\frac {a x +b}{x}\right )}{2}\) | \(104\) |
parts | \(b x \,\operatorname {Si}\left (\frac {b}{x}\right ) \sin \left (a \right )-b x \,\operatorname {Ci}\left (\frac {b}{x}\right ) \cos \left (a \right )+x^{2} \sin \left (a +\frac {b}{x}\right )+b \left (-\cos \left (a \right ) b \left (-\frac {x \,\operatorname {Ci}\left (\frac {b}{x}\right )}{b}-\frac {\cos \left (\frac {b}{x}\right ) x}{b}-\operatorname {Si}\left (\frac {b}{x}\right )\right )+\sin \left (a \right ) b \left (-\frac {x \,\operatorname {Si}\left (\frac {b}{x}\right )}{b}-\frac {\sin \left (\frac {b}{x}\right ) x}{b}+\operatorname {Ci}\left (\frac {b}{x}\right )\right )+b \left (-\frac {\sin \left (a +\frac {b}{x}\right ) x^{2}}{2 b^{2}}-\frac {\cos \left (a +\frac {b}{x}\right ) x}{2 b}-\frac {\cos \left (a \right ) \operatorname {Si}\left (\frac {b}{x}\right )}{2}-\frac {\operatorname {Ci}\left (\frac {b}{x}\right ) \sin \left (a \right )}{2}\right )\right )\) | \(166\) |
meijerg | \(-\frac {b^{2} \sqrt {\pi }\, \cos \left (a \right ) \left (-\frac {4 x \cos \left (\frac {b}{x}\right )}{b \sqrt {\pi }}-\frac {4 x^{2} \sin \left (\frac {b}{x}\right )}{b^{2} \sqrt {\pi }}-\frac {4 \,\operatorname {Si}\left (\frac {b}{x}\right )}{\sqrt {\pi }}\right )}{8}-\frac {b^{2} \sqrt {\pi }\, \sin \left (a \right ) \left (-\frac {4 x^{2}}{\sqrt {\pi }\, b^{2}}-\frac {2 \left (2 \gamma -3-2 \ln \left (x \right )+\ln \left (b^{2}\right )\right )}{\sqrt {\pi }}+\frac {4 x^{2} \left (-\frac {9 b^{2}}{2 x^{2}}+3\right )}{3 \sqrt {\pi }\, b^{2}}+\frac {4 \gamma }{\sqrt {\pi }}+\frac {4 \ln \left (2\right )}{\sqrt {\pi }}+\frac {4 \ln \left (\frac {b}{2 x}\right )}{\sqrt {\pi }}-\frac {4 x^{2} \cos \left (\frac {b}{x}\right )}{\sqrt {\pi }\, b^{2}}+\frac {4 x \sin \left (\frac {b}{x}\right )}{\sqrt {\pi }\, b}-\frac {4 \,\operatorname {Ci}\left (\frac {b}{x}\right )}{\sqrt {\pi }}\right )}{8}\) | \(185\) |
Input:
int(x*sin(a+b/x),x,method=_RETURNVERBOSE)
Output:
-b^2*(-1/2*sin(a+b/x)/b^2*x^2-1/2*cos(a+b/x)/b*x-1/2*cos(a)*Si(b/x)-1/2*Ci (b/x)*sin(a))
Time = 0.08 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.93 \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {1}{2} \, b^{2} \operatorname {Ci}\left (\frac {b}{x}\right ) \sin \left (a\right ) + \frac {1}{2} \, b^{2} \cos \left (a\right ) \operatorname {Si}\left (\frac {b}{x}\right ) + \frac {1}{2} \, b x \cos \left (\frac {a x + b}{x}\right ) + \frac {1}{2} \, x^{2} \sin \left (\frac {a x + b}{x}\right ) \] Input:
integrate(x*sin(a+b/x),x, algorithm="fricas")
Output:
1/2*b^2*cos_integral(b/x)*sin(a) + 1/2*b^2*cos(a)*sin_integral(b/x) + 1/2* b*x*cos((a*x + b)/x) + 1/2*x^2*sin((a*x + b)/x)
\[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\int x \sin {\left (a + \frac {b}{x} \right )}\, dx \] Input:
integrate(x*sin(a+b/x),x)
Output:
Integral(x*sin(a + b/x), x)
Result contains complex when optimal does not.
Time = 0.08 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.27 \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {1}{4} \, {\left ({\left (-i \, {\rm Ei}\left (\frac {i \, b}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, b}{x}\right )\right )} \cos \left (a\right ) + {\left ({\rm Ei}\left (\frac {i \, b}{x}\right ) + {\rm Ei}\left (-\frac {i \, b}{x}\right )\right )} \sin \left (a\right )\right )} b^{2} + \frac {1}{2} \, b x \cos \left (\frac {a x + b}{x}\right ) + \frac {1}{2} \, x^{2} \sin \left (\frac {a x + b}{x}\right ) \] Input:
integrate(x*sin(a+b/x),x, algorithm="maxima")
Output:
1/4*((-I*Ei(I*b/x) + I*Ei(-I*b/x))*cos(a) + (Ei(I*b/x) + Ei(-I*b/x))*sin(a ))*b^2 + 1/2*b*x*cos((a*x + b)/x) + 1/2*x^2*sin((a*x + b)/x)
Leaf count of result is larger than twice the leaf count of optimal. 251 vs. \(2 (52) = 104\).
Time = 0.12 (sec) , antiderivative size = 251, normalized size of antiderivative = 4.18 \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {a^{2} b^{3} \operatorname {Ci}\left (-a + \frac {a x + b}{x}\right ) \sin \left (a\right ) - a^{2} b^{3} \cos \left (a\right ) \operatorname {Si}\left (a - \frac {a x + b}{x}\right ) - \frac {2 \, {\left (a x + b\right )} a b^{3} \operatorname {Ci}\left (-a + \frac {a x + b}{x}\right ) \sin \left (a\right )}{x} + \frac {2 \, {\left (a x + b\right )} a b^{3} \cos \left (a\right ) \operatorname {Si}\left (a - \frac {a x + b}{x}\right )}{x} - a b^{3} \cos \left (\frac {a x + b}{x}\right ) + \frac {{\left (a x + b\right )}^{2} b^{3} \operatorname {Ci}\left (-a + \frac {a x + b}{x}\right ) \sin \left (a\right )}{x^{2}} - \frac {{\left (a x + b\right )}^{2} b^{3} \cos \left (a\right ) \operatorname {Si}\left (a - \frac {a x + b}{x}\right )}{x^{2}} + \frac {{\left (a x + b\right )} b^{3} \cos \left (\frac {a x + b}{x}\right )}{x} + b^{3} \sin \left (\frac {a x + b}{x}\right )}{2 \, {\left (a^{2} - \frac {2 \, {\left (a x + b\right )} a}{x} + \frac {{\left (a x + b\right )}^{2}}{x^{2}}\right )} b} \] Input:
integrate(x*sin(a+b/x),x, algorithm="giac")
Output:
1/2*(a^2*b^3*cos_integral(-a + (a*x + b)/x)*sin(a) - a^2*b^3*cos(a)*sin_in tegral(a - (a*x + b)/x) - 2*(a*x + b)*a*b^3*cos_integral(-a + (a*x + b)/x) *sin(a)/x + 2*(a*x + b)*a*b^3*cos(a)*sin_integral(a - (a*x + b)/x)/x - a*b ^3*cos((a*x + b)/x) + (a*x + b)^2*b^3*cos_integral(-a + (a*x + b)/x)*sin(a )/x^2 - (a*x + b)^2*b^3*cos(a)*sin_integral(a - (a*x + b)/x)/x^2 + (a*x + b)*b^3*cos((a*x + b)/x)/x + b^3*sin((a*x + b)/x))/((a^2 - 2*(a*x + b)*a/x + (a*x + b)^2/x^2)*b)
Timed out. \[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\int x\,\sin \left (a+\frac {b}{x}\right ) \,d x \] Input:
int(x*sin(a + b/x),x)
Output:
int(x*sin(a + b/x), x)
\[ \int x \sin \left (a+\frac {b}{x}\right ) \, dx=\frac {\cos \left (\frac {a x +b}{x}\right ) b x}{2}-\frac {\left (\int \frac {\sin \left (\frac {a x +b}{x}\right )}{x}d x \right ) b^{2}}{2}+\frac {\sin \left (\frac {a x +b}{x}\right ) x^{2}}{2} \] Input:
int(x*sin(a+b/x),x)
Output:
(cos((a*x + b)/x)*b*x - int(sin((a*x + b)/x)/x,x)*b**2 + sin((a*x + b)/x)* x**2)/2