\[ \int x^2 \text {CosIntegral}(a+b x) \sin (a+b x) \, dx \]
Optimal antiderivative \[ -\frac {a x}{2 b^{2}}+\frac {x^{2}}{4 b}-\frac {\cosineIntegral \! \left (2 b x +2 a \right )}{b^{3}}+\frac {a^{2} \cosineIntegral \! \left (2 b x +2 a \right )}{2 b^{3}}+\frac {2 \cosineIntegral \! \left (b x +a \right ) \cos \! \left (b x +a \right )}{b^{3}}-\frac {x^{2} \cosineIntegral \! \left (b x +a \right ) \cos \! \left (b x +a \right )}{b}+\frac {\cos ^{2}\left (b x +a \right )}{4 b^{3}}+\frac {\cos \! \left (2 b x +2 a \right )}{2 b^{3}}-\frac {\ln \! \left (b x +a \right )}{b^{3}}+\frac {a^{2} \ln \! \left (b x +a \right )}{2 b^{3}}+\frac {a \sinIntegral \! \left (2 b x +2 a \right )}{b^{3}}+\frac {2 x \cosineIntegral \! \left (b x +a \right ) \sin \! \left (b x +a \right )}{b^{2}}-\frac {a \cos \! \left (b x +a \right ) \sin \! \left (b x +a \right )}{2 b^{3}}+\frac {x \cos \! \left (b x +a \right ) \sin \! \left (b x +a \right )}{2 b^{2}} \]
command
integrate(x^2*fresnel_cos(b*x+a)*sin(b*x+a),x, algorithm="giac")
Giac 1.9.0-11 via sagemath 9.6 output
\[ \text {could not integrate} \]
Giac 1.7.0 via sagemath 9.3 output
\[ {\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 {2 \, b^{2} x^{2} \tan \left (b x + a\right )^{2} - 4 \, a b x \tan \left (b x + a\right )^{2} + 4 \, a^{2} \log \left ({\left | b x + a \right |}\right ) \tan \left (b x + a\right )^{2} + 2 \, a^{2} \Re \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} + 2 \, a^{2} \Re \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} + 2 \, b^{2} x^{2} + 4 \, a \Im \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} - 4 \, a \Im \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} + 8 \, a \operatorname {Si}\left (2 \, b x + 2 \, a\right ) \tan \left (b x + a\right )^{2} - 4 \, a b x + 4 \, a^{2} \log \left ({\left | b x + a \right |}\right ) + 2 \, a^{2} \Re \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) + 2 \, a^{2} \Re \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) + 4 \, b x \tan \left (b x + a\right ) - 8 \, \log \left ({\left | b x + a \right |}\right ) \tan \left (b x + a\right )^{2} - 4 \, \Re \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} - 4 \, \Re \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) \tan \left (b x + a\right )^{2} + 4 \, a \Im \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) - 4 \, a \Im \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) + 8 \, a \operatorname {Si}\left (2 \, b x + 2 \, a\right ) - 4 \, a \tan \left (b x + a\right ) - 5 \, \tan \left (b x + a\right )^{2} - 8 \, \log \left ({\left | b x + a \right |}\right ) - 4 \, \Re \left ( \operatorname {Ci}\left (2 \, b x + 2 \, a\right ) \right ) - 4 \, \Re \left ( \operatorname {Ci}\left (-2 \, b x - 2 \, a\right ) \right ) + 5}{8 \, {\left (b^{3} \tan \left (b x + a\right )^{2} + b^{3}\right )}} \]