3.123 \(\int x^2 \text{CosIntegral}(a+b x) \sin (a+b x) \, dx\)

Optimal. Leaf size=220 \[ \frac{a^2 \text{CosIntegral}(2 a+2 b x)}{2 b^3}+\frac{a^2 \log (a+b x)}{2 b^3}-\frac{\text{CosIntegral}(2 a+2 b x)}{b^3}+\frac{2 x \text{CosIntegral}(a+b x) \sin (a+b x)}{b^2}+\frac{2 \text{CosIntegral}(a+b x) \cos (a+b x)}{b^3}+\frac{a \text{Si}(2 a+2 b x)}{b^3}-\frac{a x}{2 b^2}-\frac{\log (a+b x)}{b^3}+\frac{\cos ^2(a+b x)}{4 b^3}+\frac{\cos (2 a+2 b x)}{2 b^3}-\frac{a \sin (a+b x) \cos (a+b x)}{2 b^3}+\frac{x \sin (a+b x) \cos (a+b x)}{2 b^2}-\frac{x^2 \text{CosIntegral}(a+b x) \cos (a+b x)}{b}+\frac{x^2}{4 b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.719672, antiderivative size = 220, normalized size of antiderivative = 1., number of steps used = 21, number of rules used = 14, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.875, Rules used = {6520, 6742, 2635, 8, 3310, 30, 3312, 3302, 6514, 4573, 6741, 2638, 3299, 6518} \[ \frac{a^2 \text{CosIntegral}(2 a+2 b x)}{2 b^3}+\frac{a^2 \log (a+b x)}{2 b^3}-\frac{\text{CosIntegral}(2 a+2 b x)}{b^3}+\frac{2 x \text{CosIntegral}(a+b x) \sin (a+b x)}{b^2}+\frac{2 \text{CosIntegral}(a+b x) \cos (a+b x)}{b^3}+\frac{a \text{Si}(2 a+2 b x)}{b^3}-\frac{a x}{2 b^2}-\frac{\log (a+b x)}{b^3}+\frac{\cos ^2(a+b x)}{4 b^3}+\frac{\cos (2 a+2 b x)}{2 b^3}-\frac{a \sin (a+b x) \cos (a+b x)}{2 b^3}+\frac{x \sin (a+b x) \cos (a+b x)}{2 b^2}-\frac{x^2 \text{CosIntegral}(a+b x) \cos (a+b x)}{b}+\frac{x^2}{4 b} \]

Antiderivative was successfully verified.

[In]

Int[x^2*CosIntegral[a + b*x]*Sin[a + b*x],x]

[Out]

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

Rule 6520

Int[CosIntegral[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.)*Sin[(a_.) + (b_.)*(x_)], x_Symbol] :> -Simp[((e
 + f*x)^m*Cos[a + b*x]*CosIntegral[c + d*x])/b, x] + (Dist[d/b, Int[((e + f*x)^m*Cos[a + b*x]*Cos[c + d*x])/(c
 + d*x), x], x] + Dist[(f*m)/b, Int[(e + f*x)^(m - 1)*Cos[a + b*x]*CosIntegral[c + d*x], x], x]) /; FreeQ[{a,
b, c, d, e, f}, x] && IGtQ[m, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2635

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] && Integer
Q[2*n]

Rule 8

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

Rule 3310

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

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3312

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Int[ExpandTrigReduce[(c + d*x)^m, Sin
[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1])
)

Rule 3302

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 6514

Int[Cos[(a_.) + (b_.)*(x_)]*CosIntegral[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[((e
+ f*x)^m*Sin[a + b*x]*CosIntegral[c + d*x])/b, x] + (-Dist[d/b, Int[((e + f*x)^m*Sin[a + b*x]*Cos[c + d*x])/(c
 + d*x), x], x] - Dist[(f*m)/b, Int[(e + f*x)^(m - 1)*Sin[a + b*x]*CosIntegral[c + d*x], x], x]) /; FreeQ[{a,
b, c, d, e, f}, x] && IGtQ[m, 0]

Rule 4573

Int[Cos[w_]^(p_.)*(u_.)*Sin[v_]^(p_.), x_Symbol] :> Dist[1/2^p, Int[u*Sin[2*v]^p, x], x] /; EqQ[w, v] && Integ
erQ[p]

Rule 6741

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 2638

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

Rule 3299

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 6518

Int[CosIntegral[(c_.) + (d_.)*(x_)]*Sin[(a_.) + (b_.)*(x_)], x_Symbol] :> -Simp[(Cos[a + b*x]*CosIntegral[c +
d*x])/b, x] + Dist[d/b, Int[(Cos[a + b*x]*Cos[c + d*x])/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.321807, size = 134, normalized size = 0.61 \[ \frac{4 \left (a^2-2\right ) \text{CosIntegral}(2 (a+b x))+4 a^2 \log (a+b x)-8 \text{CosIntegral}(a+b x) \left (\left (b^2 x^2-2\right ) \cos (a+b x)-2 b x \sin (a+b x)\right )+8 a \text{Si}(2 (a+b x))-4 a b x-8 \log (a+b x)-2 a \sin (2 (a+b x))+2 b x \sin (2 (a+b x))+5 \cos (2 (a+b x))+2 b^2 x^2}{8 b^3} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*CosIntegral[a + b*x]*Sin[a + b*x],x]

[Out]

(-4*a*b*x + 2*b^2*x^2 + 5*Cos[2*(a + b*x)] + 4*(-2 + a^2)*CosIntegral[2*(a + b*x)] - 8*Log[a + b*x] + 4*a^2*Lo
g[a + b*x] - 8*CosIntegral[a + b*x]*((-2 + b^2*x^2)*Cos[a + b*x] - 2*b*x*Sin[a + b*x]) - 2*a*Sin[2*(a + b*x)]
+ 2*b*x*Sin[2*(a + b*x)] + 8*a*SinIntegral[2*(a + b*x)])/(8*b^3)

________________________________________________________________________________________

Maple [A]  time = 0.066, size = 211, normalized size = 1. \begin{align*} -{\frac{{x}^{2}{\it Ci} \left ( bx+a \right ) \cos \left ( bx+a \right ) }{b}}+2\,{\frac{x{\it Ci} \left ( bx+a \right ) \sin \left ( bx+a \right ) }{{b}^{2}}}+2\,{\frac{{\it Ci} \left ( bx+a \right ) \cos \left ( bx+a \right ) }{{b}^{3}}}+{\frac{x\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{2\,{b}^{2}}}-{\frac{a\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{2\,{b}^{3}}}+{\frac{{x}^{2}}{4\,b}}-{\frac{ax}{2\,{b}^{2}}}-{\frac{3\,{a}^{2}}{4\,{b}^{3}}}-{\frac{ \left ( \sin \left ( bx+a \right ) \right ) ^{2}}{4\,{b}^{3}}}+{\frac{{a}^{2}\ln \left ( bx+a \right ) }{2\,{b}^{3}}}+{\frac{{a}^{2}{\it Ci} \left ( 2\,bx+2\,a \right ) }{2\,{b}^{3}}}+{\frac{ \left ( \cos \left ( bx+a \right ) \right ) ^{2}}{{b}^{3}}}+{\frac{a{\it Si} \left ( 2\,bx+2\,a \right ) }{{b}^{3}}}-{\frac{\ln \left ( bx+a \right ) }{{b}^{3}}}-{\frac{{\it Ci} \left ( 2\,bx+2\,a \right ) }{{b}^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*Ci(b*x+a)*sin(b*x+a),x)

[Out]

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

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2}{\rm Ci}\left (b x + a\right ) \sin \left (b x + a\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*Ci(b*x+a)*sin(b*x+a),x, algorithm="maxima")

[Out]

integrate(x^2*Ci(b*x + a)*sin(b*x + a), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (x^{2} \operatorname{Ci}\left (b x + a\right ) \sin \left (b x + a\right ), x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*Ci(b*x+a)*sin(b*x+a),x, algorithm="fricas")

[Out]

integral(x^2*cos_integral(b*x + a)*sin(b*x + a), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \sin{\left (a + b x \right )} \operatorname{Ci}{\left (a + b x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*Ci(b*x+a)*sin(b*x+a),x)

[Out]

Integral(x**2*sin(a + b*x)*Ci(a + b*x), x)

________________________________________________________________________________________

Giac [C]  time = 1.31872, size = 230, normalized size = 1.05 \begin{align*}{\left (\frac{2 \, x \sin \left (b x + a\right )}{b^{2}} - \frac{{\left (b^{2} x^{2} - 2\right )} \cos \left (b x + a\right )}{b^{3}}\right )} \operatorname{Ci}\left (b x + a\right ) + \frac{b^{2} x^{2} - 2 \, a b x + 2 \, a^{2} \log \left ({\left | b x + a \right |}\right ) + a^{2} \Re \left ( \operatorname{Ci}\left (2 \, b x + 2 \, a\right ) \right ) + a^{2} \Re \left ( \operatorname{Ci}\left (-2 \, b x - 2 \, a\right ) \right ) + 2 \, a \Im \left ( \operatorname{Ci}\left (2 \, b x + 2 \, a\right ) \right ) - 2 \, a \Im \left ( \operatorname{Ci}\left (-2 \, b x - 2 \, a\right ) \right ) + 4 \, a \operatorname{Si}\left (2 \, b x + 2 \, a\right ) - 4 \, \log \left ({\left | b x + a \right |}\right ) - 2 \, \Re \left ( \operatorname{Ci}\left (2 \, b x + 2 \, a\right ) \right ) - 2 \, \Re \left ( \operatorname{Ci}\left (-2 \, b x - 2 \, a\right ) \right )}{4 \, b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*Ci(b*x+a)*sin(b*x+a),x, algorithm="giac")

[Out]

(2*x*sin(b*x + a)/b^2 - (b^2*x^2 - 2)*cos(b*x + a)/b^3)*cos_integral(b*x + a) + 1/4*(b^2*x^2 - 2*a*b*x + 2*a^2
*log(abs(b*x + a)) + a^2*real_part(cos_integral(2*b*x + 2*a)) + a^2*real_part(cos_integral(-2*b*x - 2*a)) + 2*
a*imag_part(cos_integral(2*b*x + 2*a)) - 2*a*imag_part(cos_integral(-2*b*x - 2*a)) + 4*a*sin_integral(2*b*x +
2*a) - 4*log(abs(b*x + a)) - 2*real_part(cos_integral(2*b*x + 2*a)) - 2*real_part(cos_integral(-2*b*x - 2*a)))
/b^3