\(\int \log (x) \sin (a+b x) \, dx\) [154]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [C] (verification not implemented)
   Giac [C] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 9, antiderivative size = 35 \[ \int \log (x) \sin (a+b x) \, dx=\frac {\cos (a) \operatorname {CosIntegral}(b x)}{b}-\frac {\cos (a+b x) \log (x)}{b}-\frac {\sin (a) \text {Si}(b x)}{b} \]

[Out]

Ci(b*x)*cos(a)/b-cos(b*x+a)*ln(x)/b-Si(b*x)*sin(a)/b

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {2718, 2634, 12, 3384, 3380, 3383} \[ \int \log (x) \sin (a+b x) \, dx=\frac {\cos (a) \operatorname {CosIntegral}(b x)}{b}-\frac {\sin (a) \text {Si}(b x)}{b}-\frac {\log (x) \cos (a+b x)}{b} \]

[In]

Int[Log[x]*Sin[a + b*x],x]

[Out]

(Cos[a]*CosIntegral[b*x])/b - (Cos[a + b*x]*Log[x])/b - (Sin[a]*SinIntegral[b*x])/b

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3380

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3384

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[c*(f/d) + f*x]
/(c + d*x), x], x] + Dist[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]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cos (a+b x) \log (x)}{b}+\int \frac {\cos (a+b x)}{b x} \, dx \\ & = -\frac {\cos (a+b x) \log (x)}{b}+\frac {\int \frac {\cos (a+b x)}{x} \, dx}{b} \\ & = -\frac {\cos (a+b x) \log (x)}{b}+\frac {\cos (a) \int \frac {\cos (b x)}{x} \, dx}{b}-\frac {\sin (a) \int \frac {\sin (b x)}{x} \, dx}{b} \\ & = \frac {\cos (a) \text {Ci}(b x)}{b}-\frac {\cos (a+b x) \log (x)}{b}-\frac {\sin (a) \text {Si}(b x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.86 \[ \int \log (x) \sin (a+b x) \, dx=\frac {\cos (a) \operatorname {CosIntegral}(b x)-\cos (a+b x) \log (x)-\sin (a) \text {Si}(b x)}{b} \]

[In]

Integrate[Log[x]*Sin[a + b*x],x]

[Out]

(Cos[a]*CosIntegral[b*x] - Cos[a + b*x]*Log[x] - Sin[a]*SinIntegral[b*x])/b

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 1.36 (sec) , antiderivative size = 80, normalized size of antiderivative = 2.29

method result size
risch \(-\frac {\cos \left (b x +a \right ) \ln \left (x \right )}{b}+\frac {i {\mathrm e}^{-i a} \pi \,\operatorname {csgn}\left (b x \right )}{2 b}-\frac {i {\mathrm e}^{-i a} \operatorname {Si}\left (b x \right )}{b}-\frac {{\mathrm e}^{-i a} \operatorname {Ei}_{1}\left (-i b x \right )}{2 b}-\frac {{\mathrm e}^{i a} \operatorname {Ei}_{1}\left (-i b x \right )}{2 b}\) \(80\)

[In]

int(ln(x)*sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

-cos(b*x+a)*ln(x)/b+1/2*I/b*exp(-I*a)*Pi*csgn(b*x)-I/b*exp(-I*a)*Si(b*x)-1/2/b*exp(-I*a)*Ei(1,-I*b*x)-1/2/b*ex
p(I*a)*Ei(1,-I*b*x)

Fricas [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.86 \[ \int \log (x) \sin (a+b x) \, dx=\frac {\cos \left (a\right ) \operatorname {Ci}\left (b x\right ) - \cos \left (b x + a\right ) \log \left (x\right ) - \sin \left (a\right ) \operatorname {Si}\left (b x\right )}{b} \]

[In]

integrate(log(x)*sin(b*x+a),x, algorithm="fricas")

[Out]

(cos(a)*cos_integral(b*x) - cos(b*x + a)*log(x) - sin(a)*sin_integral(b*x))/b

Sympy [F]

\[ \int \log (x) \sin (a+b x) \, dx=\int \log {\left (x \right )} \sin {\left (a + b x \right )}\, dx \]

[In]

integrate(ln(x)*sin(b*x+a),x)

[Out]

Integral(log(x)*sin(a + b*x), x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.25 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.63 \[ \int \log (x) \sin (a+b x) \, dx=-\frac {\cos \left (b x + a\right ) \log \left (x\right )}{b} - \frac {{\left (E_{1}\left (i \, b x\right ) + E_{1}\left (-i \, b x\right )\right )} \cos \left (a\right ) - {\left (i \, E_{1}\left (i \, b x\right ) - i \, E_{1}\left (-i \, b x\right )\right )} \sin \left (a\right )}{2 \, b} \]

[In]

integrate(log(x)*sin(b*x+a),x, algorithm="maxima")

[Out]

-cos(b*x + a)*log(x)/b - 1/2*((exp_integral_e(1, I*b*x) + exp_integral_e(1, -I*b*x))*cos(a) - (I*exp_integral_
e(1, I*b*x) - I*exp_integral_e(1, -I*b*x))*sin(a))/b

Giac [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.33 (sec) , antiderivative size = 102, normalized size of antiderivative = 2.91 \[ \int \log (x) \sin (a+b x) \, dx=-\frac {\cos \left (b x + a\right ) \log \left (x\right )}{b} - \frac {\Re \left ( \operatorname {Ci}\left (b x\right ) \right ) \tan \left (\frac {1}{2} \, a\right )^{2} + \Re \left ( \operatorname {Ci}\left (-b x\right ) \right ) \tan \left (\frac {1}{2} \, a\right )^{2} + 2 \, \Im \left ( \operatorname {Ci}\left (b x\right ) \right ) \tan \left (\frac {1}{2} \, a\right ) - 2 \, \Im \left ( \operatorname {Ci}\left (-b x\right ) \right ) \tan \left (\frac {1}{2} \, a\right ) + 4 \, \operatorname {Si}\left (b x\right ) \tan \left (\frac {1}{2} \, a\right ) - \Re \left ( \operatorname {Ci}\left (b x\right ) \right ) - \Re \left ( \operatorname {Ci}\left (-b x\right ) \right )}{2 \, {\left (b \tan \left (\frac {1}{2} \, a\right )^{2} + b\right )}} \]

[In]

integrate(log(x)*sin(b*x+a),x, algorithm="giac")

[Out]

-cos(b*x + a)*log(x)/b - 1/2*(real_part(cos_integral(b*x))*tan(1/2*a)^2 + real_part(cos_integral(-b*x))*tan(1/
2*a)^2 + 2*imag_part(cos_integral(b*x))*tan(1/2*a) - 2*imag_part(cos_integral(-b*x))*tan(1/2*a) + 4*sin_integr
al(b*x)*tan(1/2*a) - real_part(cos_integral(b*x)) - real_part(cos_integral(-b*x)))/(b*tan(1/2*a)^2 + b)

Mupad [F(-1)]

Timed out. \[ \int \log (x) \sin (a+b x) \, dx=\int \sin \left (a+b\,x\right )\,\ln \left (x\right ) \,d x \]

[In]

int(sin(a + b*x)*log(x),x)

[Out]

int(sin(a + b*x)*log(x), x)