\(\int \cos ^2(a+b x) \log (x) \, dx\) [158]

   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 = 11, antiderivative size = 66 \[ \int \cos ^2(a+b x) \log (x) \, dx=-\frac {x}{2}+\frac {1}{2} x \log (x)-\frac {\operatorname {CosIntegral}(2 b x) \sin (2 a)}{4 b}+\frac {\cos (a+b x) \log (x) \sin (a+b x)}{2 b}-\frac {\cos (2 a) \text {Si}(2 b x)}{4 b} \]

[Out]

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

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.727, Rules used = {2715, 8, 2634, 12, 3408, 3384, 3380, 3383} \[ \int \cos ^2(a+b x) \log (x) \, dx=-\frac {\sin (2 a) \operatorname {CosIntegral}(2 b x)}{4 b}-\frac {\cos (2 a) \text {Si}(2 b x)}{4 b}+\frac {\log (x) \sin (a+b x) \cos (a+b x)}{2 b}-\frac {x}{2}+\frac {1}{2} x \log (x) \]

[In]

Int[Cos[a + b*x]^2*Log[x],x]

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

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 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

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]

Rule 3408

Int[(u_)^(m_.)*((a_.) + (b_.)*Sin[v_])^(n_.), x_Symbol] :> Int[ExpandToSum[u, x]^m*(a + b*Sin[ExpandToSum[v, x
]])^n, x] /; FreeQ[{a, b, m, n}, x] && LinearQ[{u, v}, x] &&  !LinearMatchQ[{u, v}, x]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.76 \[ \int \cos ^2(a+b x) \log (x) \, dx=-\frac {2 b x-2 b x \log (x)+\operatorname {CosIntegral}(2 b x) \sin (2 a)-\log (x) \sin (2 (a+b x))+\cos (2 a) \text {Si}(2 b x)}{4 b} \]

[In]

Integrate[Cos[a + b*x]^2*Log[x],x]

[Out]

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

Maple [C] (warning: unable to verify)

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

Time = 1.19 (sec) , antiderivative size = 132, normalized size of antiderivative = 2.00

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

[In]

int(cos(b*x+a)^2*ln(x),x,method=_RETURNVERBOSE)

[Out]

1/2*ln(x)*x+1/4/b*sin(2*b*x+2*a)*ln(x)+1/8/b*exp(-2*I*a)*Pi*csgn(b*x)-1/4/b*exp(-2*I*a)*Si(2*b*x)+1/8*I/b*exp(
-2*I*a)*Ei(1,-2*I*b*x)+1/2/b*a*ln(I*b*x)-1/2/b*ln(a+I*(I*b*x+I*a))*a-1/2*x-1/2*a/b-1/8*I/b*exp(2*I*a)*Ei(1,-2*
I*b*x)

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.82 \[ \int \cos ^2(a+b x) \log (x) \, dx=\frac {2 \, b x \log \left (x\right ) + 2 \, \cos \left (b x + a\right ) \log \left (x\right ) \sin \left (b x + a\right ) - 2 \, b x - \operatorname {Ci}\left (2 \, b x\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \operatorname {Si}\left (2 \, b x\right )}{4 \, b} \]

[In]

integrate(cos(b*x+a)^2*log(x),x, algorithm="fricas")

[Out]

1/4*(2*b*x*log(x) + 2*cos(b*x + a)*log(x)*sin(b*x + a) - 2*b*x - cos_integral(2*b*x)*sin(2*a) - cos(2*a)*sin_i
ntegral(2*b*x))/b

Sympy [F]

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

[In]

integrate(cos(b*x+a)**2*ln(x),x)

[Out]

Integral(log(x)*cos(a + b*x)**2, x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.28 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.15 \[ \int \cos ^2(a+b x) \log (x) \, dx=\frac {{\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (x\right )}{4 \, b} - \frac {4 \, b x + {\left (-i \, {\rm Ei}\left (2 i \, b x\right ) + i \, {\rm Ei}\left (-2 i \, b x\right )\right )} \cos \left (2 \, a\right ) + 4 \, a \log \left (x\right ) + {\left ({\rm Ei}\left (2 i \, b x\right ) + {\rm Ei}\left (-2 i \, b x\right )\right )} \sin \left (2 \, a\right )}{8 \, b} \]

[In]

integrate(cos(b*x+a)^2*log(x),x, algorithm="maxima")

[Out]

1/4*(2*b*x + 2*a + sin(2*b*x + 2*a))*log(x)/b - 1/8*(4*b*x + (-I*Ei(2*I*b*x) + I*Ei(-2*I*b*x))*cos(2*a) + 4*a*
log(x) + (Ei(2*I*b*x) + Ei(-2*I*b*x))*sin(2*a))/b

Giac [C] (verification not implemented)

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

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

[In]

integrate(cos(b*x+a)^2*log(x),x, algorithm="giac")

[Out]

1/4*(2*x + sin(2*b*x + 2*a)/b)*log(x) - 1/8*(4*b*x*tan(a)^2 - imag_part(cos_integral(2*b*x))*tan(a)^2 + imag_p
art(cos_integral(-2*b*x))*tan(a)^2 - 2*sin_integral(2*b*x)*tan(a)^2 + 4*b*x + 2*real_part(cos_integral(2*b*x))
*tan(a) + 2*real_part(cos_integral(-2*b*x))*tan(a) + imag_part(cos_integral(2*b*x)) - imag_part(cos_integral(-
2*b*x)) + 2*sin_integral(2*b*x))/(b*tan(a)^2 + b)

Mupad [F(-1)]

Timed out. \[ \int \cos ^2(a+b x) \log (x) \, dx=\int {\cos \left (a+b\,x\right )}^2\,\ln \left (x\right ) \,d x \]

[In]

int(cos(a + b*x)^2*log(x),x)

[Out]

int(cos(a + b*x)^2*log(x), x)