3.2.12 \(\int x^2 \text {CosIntegral}(b x) \sin (b x) \, dx\) [112]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {6655, 12, 3391, 30, 6649, 2644, 6653, 3393, 3383} \begin {gather*} -\frac {\text {CosIntegral}(2 b x)}{b^3}+\frac {2 \text {CosIntegral}(b x) \cos (b x)}{b^3}-\frac {\log (x)}{b^3}-\frac {\sin ^2(b x)}{b^3}+\frac {\cos ^2(b x)}{4 b^3}+\frac {2 x \text {CosIntegral}(b x) \sin (b x)}{b^2}+\frac {x \sin (b x) \cos (b x)}{2 b^2}-\frac {x^2 \text {CosIntegral}(b x) \cos (b x)}{b}+\frac {x^2}{4 b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

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

Rule 30

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

Rule 2644

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

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 3391

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 3393

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 6649

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 6653

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]

Rule 6655

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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 72, normalized size = 0.65 \begin {gather*} \frac {2 b^2 x^2+5 \cos (2 b x)-8 \text {CosIntegral}(2 b x)-8 \log (x)-8 \text {CosIntegral}(b x) \left (\left (-2+b^2 x^2\right ) \cos (b x)-2 b x \sin (b x)\right )+2 b x \sin (2 b x)}{8 b^3} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(2*b^2*x^2 + 5*Cos[2*b*x] - 8*CosIntegral[2*b*x] - 8*Log[x] - 8*CosIntegral[b*x]*((-2 + b^2*x^2)*Cos[b*x] - 2*
b*x*Sin[b*x]) + 2*b*x*Sin[2*b*x])/(8*b^3)

________________________________________________________________________________________

Maple [A]
time = 0.32, size = 91, normalized size = 0.82

method result size
derivativedivides \(\frac {\cosineIntegral \left (b x \right ) \left (-b^{2} x^{2} \cos \left (b x \right )+2 \cos \left (b x \right )+2 b x \sin \left (b x \right )\right )+b x \left (\frac {\sin \left (b x \right ) \cos \left (b x \right )}{2}+\frac {b x}{2}\right )-\frac {b^{2} x^{2}}{4}-\frac {\left (\sin ^{2}\left (b x \right )\right )}{4}-\ln \left (b x \right )-\cosineIntegral \left (2 b x \right )+\cos ^{2}\left (b x \right )}{b^{3}}\) \(91\)
default \(\frac {\cosineIntegral \left (b x \right ) \left (-b^{2} x^{2} \cos \left (b x \right )+2 \cos \left (b x \right )+2 b x \sin \left (b x \right )\right )+b x \left (\frac {\sin \left (b x \right ) \cos \left (b x \right )}{2}+\frac {b x}{2}\right )-\frac {b^{2} x^{2}}{4}-\frac {\left (\sin ^{2}\left (b x \right )\right )}{4}-\ln \left (b x \right )-\cosineIntegral \left (2 b x \right )+\cos ^{2}\left (b x \right )}{b^{3}}\) \(91\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*Ci(b*x)*sin(b*x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*fresnel_cos(b*x)*sin(b*x),x, algorithm="maxima")

[Out]

integrate(x^2*fresnel_cos(b*x)*sin(b*x), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 296 vs. \(2 (105) = 210\).
time = 0.41, size = 296, normalized size = 2.67 \begin {gather*} -\frac {2 \, {\left (\pi ^{2} b^{3} x^{2} - 2 \, \pi ^{2} b\right )} \cos \left (b x\right ) \operatorname {C}\left (b x\right ) + \sqrt {b^{2}} {\left ({\left (2 \, \pi ^{2} - 1\right )} \cos \left (\frac {1}{2 \, \pi }\right ) + \pi \sin \left (\frac {1}{2 \, \pi }\right )\right )} \operatorname {C}\left (\frac {{\left (\pi b x + 1\right )} \sqrt {b^{2}}}{\pi b}\right ) + \sqrt {b^{2}} {\left ({\left (2 \, \pi ^{2} - 1\right )} \cos \left (\frac {1}{2 \, \pi }\right ) + \pi \sin \left (\frac {1}{2 \, \pi }\right )\right )} \operatorname {C}\left (\frac {{\left (\pi b x - 1\right )} \sqrt {b^{2}}}{\pi b}\right ) - \sqrt {b^{2}} {\left (\pi \cos \left (\frac {1}{2 \, \pi }\right ) - {\left (2 \, \pi ^{2} - 1\right )} \sin \left (\frac {1}{2 \, \pi }\right )\right )} \operatorname {S}\left (\frac {{\left (\pi b x + 1\right )} \sqrt {b^{2}}}{\pi b}\right ) - \sqrt {b^{2}} {\left (\pi \cos \left (\frac {1}{2 \, \pi }\right ) - {\left (2 \, \pi ^{2} - 1\right )} \sin \left (\frac {1}{2 \, \pi }\right )\right )} \operatorname {S}\left (\frac {{\left (\pi b x - 1\right )} \sqrt {b^{2}}}{\pi b}\right ) - 2 \, {\left (\pi b^{2} x \cos \left (b x\right ) - 2 \, \pi b \sin \left (b x\right )\right )} \sin \left (\frac {1}{2} \, \pi b^{2} x^{2}\right ) - 2 \, {\left (2 \, \pi ^{2} b^{2} x \operatorname {C}\left (b x\right ) - b \cos \left (\frac {1}{2} \, \pi b^{2} x^{2}\right )\right )} \sin \left (b x\right )}{2 \, \pi ^{2} b^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*fresnel_cos(b*x)*sin(b*x),x, algorithm="fricas")

[Out]

-1/2*(2*(pi^2*b^3*x^2 - 2*pi^2*b)*cos(b*x)*fresnel_cos(b*x) + sqrt(b^2)*((2*pi^2 - 1)*cos(1/2/pi) + pi*sin(1/2
/pi))*fresnel_cos((pi*b*x + 1)*sqrt(b^2)/(pi*b)) + sqrt(b^2)*((2*pi^2 - 1)*cos(1/2/pi) + pi*sin(1/2/pi))*fresn
el_cos((pi*b*x - 1)*sqrt(b^2)/(pi*b)) - sqrt(b^2)*(pi*cos(1/2/pi) - (2*pi^2 - 1)*sin(1/2/pi))*fresnel_sin((pi*
b*x + 1)*sqrt(b^2)/(pi*b)) - sqrt(b^2)*(pi*cos(1/2/pi) - (2*pi^2 - 1)*sin(1/2/pi))*fresnel_sin((pi*b*x - 1)*sq
rt(b^2)/(pi*b)) - 2*(pi*b^2*x*cos(b*x) - 2*pi*b*sin(b*x))*sin(1/2*pi*b^2*x^2) - 2*(2*pi^2*b^2*x*fresnel_cos(b*
x) - b*cos(1/2*pi*b^2*x^2))*sin(b*x))/(pi^2*b^4)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*fresnel_cos(b*x)*sin(b*x),x, algorithm="giac")

[Out]

integrate(x^2*fresnel_cos(b*x)*sin(b*x), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^2\,\mathrm {cosint}\left (b\,x\right )\,\sin \left (b\,x\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosint(b*x)*sin(b*x),x)

[Out]

int(x^2*cosint(b*x)*sin(b*x), x)

________________________________________________________________________________________