Optimal. Leaf size=147 \[ \frac {a^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }-\frac {a (a+b x) \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }+\frac {(a+b x)^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi }+\frac {a \text {FresnelC}(a+b x)}{b^3 \pi }+\frac {a^3 S(a+b x)}{3 b^3}+\frac {1}{3} x^3 S(a+b x)-\frac {2 \sin \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi ^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 9, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.900, Rules used = {6563, 3514,
3432, 3460, 2718, 3466, 3433, 3377, 2717} \begin {gather*} \frac {a^3 S(a+b x)}{3 b^3}+\frac {a^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{\pi b^3}+\frac {a \text {FresnelC}(a+b x)}{\pi b^3}-\frac {2 \sin \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 \pi ^2 b^3}-\frac {a (a+b x) \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{\pi b^3}+\frac {(a+b x)^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 \pi b^3}+\frac {1}{3} x^3 S(a+b x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 2718
Rule 3377
Rule 3432
Rule 3433
Rule 3460
Rule 3466
Rule 3514
Rule 6563
Rubi steps
\begin {align*} \int x^2 S(a+b x) \, dx &=\frac {1}{3} x^3 S(a+b x)-\frac {1}{3} b \int x^3 \sin \left (\frac {1}{2} \pi (a+b x)^2\right ) \, dx\\ &=\frac {1}{3} x^3 S(a+b x)-\frac {\text {Subst}\left (\int \left (-a^3 \sin \left (\frac {\pi x^2}{2}\right )+3 a^2 x \sin \left (\frac {\pi x^2}{2}\right )-3 a x^2 \sin \left (\frac {\pi x^2}{2}\right )+x^3 \sin \left (\frac {\pi x^2}{2}\right )\right ) \, dx,x,a+b x\right )}{3 b^3}\\ &=\frac {1}{3} x^3 S(a+b x)-\frac {\text {Subst}\left (\int x^3 \sin \left (\frac {\pi x^2}{2}\right ) \, dx,x,a+b x\right )}{3 b^3}+\frac {a \text {Subst}\left (\int x^2 \sin \left (\frac {\pi x^2}{2}\right ) \, dx,x,a+b x\right )}{b^3}-\frac {a^2 \text {Subst}\left (\int x \sin \left (\frac {\pi x^2}{2}\right ) \, dx,x,a+b x\right )}{b^3}+\frac {a^3 \text {Subst}\left (\int \sin \left (\frac {\pi x^2}{2}\right ) \, dx,x,a+b x\right )}{3 b^3}\\ &=-\frac {a (a+b x) \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }+\frac {a^3 S(a+b x)}{3 b^3}+\frac {1}{3} x^3 S(a+b x)-\frac {\text {Subst}\left (\int x \sin \left (\frac {\pi x}{2}\right ) \, dx,x,(a+b x)^2\right )}{6 b^3}-\frac {a^2 \text {Subst}\left (\int \sin \left (\frac {\pi x}{2}\right ) \, dx,x,(a+b x)^2\right )}{2 b^3}+\frac {a \text {Subst}\left (\int \cos \left (\frac {\pi x^2}{2}\right ) \, dx,x,a+b x\right )}{b^3 \pi }\\ &=\frac {a^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }-\frac {a (a+b x) \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }+\frac {(a+b x)^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi }+\frac {a C(a+b x)}{b^3 \pi }+\frac {a^3 S(a+b x)}{3 b^3}+\frac {1}{3} x^3 S(a+b x)-\frac {\text {Subst}\left (\int \cos \left (\frac {\pi x}{2}\right ) \, dx,x,(a+b x)^2\right )}{3 b^3 \pi }\\ &=\frac {a^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }-\frac {a (a+b x) \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{b^3 \pi }+\frac {(a+b x)^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi }+\frac {a C(a+b x)}{b^3 \pi }+\frac {a^3 S(a+b x)}{3 b^3}+\frac {1}{3} x^3 S(a+b x)-\frac {2 \sin \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi ^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 115, normalized size = 0.78 \begin {gather*} \frac {a^2 \pi \cos \left (\frac {1}{2} \pi (a+b x)^2\right )-a b \pi x \cos \left (\frac {1}{2} \pi (a+b x)^2\right )+b^2 \pi x^2 \cos \left (\frac {1}{2} \pi (a+b x)^2\right )+3 a \pi \text {FresnelC}(a+b x)+\pi ^2 \left (a^3+b^3 x^3\right ) S(a+b x)-2 \sin \left (\frac {1}{2} \pi (a+b x)^2\right )}{3 b^3 \pi ^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.40, size = 121, normalized size = 0.82
method | result | size |
derivativedivides | \(\frac {\frac {\mathrm {S}\left (b x +a \right ) b^{3} x^{3}}{3}+\frac {a^{3} \mathrm {S}\left (b x +a \right )}{3}+\frac {a^{2} \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{\pi }-\frac {a \left (b x +a \right ) \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{\pi }+\frac {a \FresnelC \left (b x +a \right )}{\pi }+\frac {\left (b x +a \right )^{2} \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{3 \pi }-\frac {2 \sin \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{3 \pi ^{2}}}{b^{3}}\) | \(121\) |
default | \(\frac {\frac {\mathrm {S}\left (b x +a \right ) b^{3} x^{3}}{3}+\frac {a^{3} \mathrm {S}\left (b x +a \right )}{3}+\frac {a^{2} \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{\pi }-\frac {a \left (b x +a \right ) \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{\pi }+\frac {a \FresnelC \left (b x +a \right )}{\pi }+\frac {\left (b x +a \right )^{2} \cos \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{3 \pi }-\frac {2 \sin \left (\frac {\pi \left (b x +a \right )^{2}}{2}\right )}{3 \pi ^{2}}}{b^{3}}\) | \(121\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.91, size = 424, normalized size = 2.88 \begin {gather*} \frac {1}{3} \, x^{3} \operatorname {S}\left (b x + a\right ) + \frac {{\left (12 \, {\left (\pi e^{\left (\frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}\right )} + \pi e^{\left (-\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}\right )}\right )} a^{3} + 4 \, {\left (3 \, {\left (\pi e^{\left (\frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}\right )} + \pi e^{\left (-\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}\right )}\right )} a^{2} - 2 i \, \Gamma \left (2, \frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}\right ) + 2 i \, \Gamma \left (2, -\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}\right )\right )} b x + 8 \, a {\left (-i \, \Gamma \left (2, \frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}\right ) + i \, \Gamma \left (2, -\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}\right )\right )} - \sqrt {2 \, \pi b^{2} x^{2} + 4 \, \pi a b x + 2 \, \pi a^{2}} {\left ({\left (-\left (i + 1\right ) \, \sqrt {2} \pi ^{\frac {3}{2}} {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}}\right ) - 1\right )} + \left (i - 1\right ) \, \sqrt {2} \pi ^{\frac {3}{2}} {\left (\operatorname {erf}\left (\sqrt {-\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}}\right ) - 1\right )}\right )} a^{3} - 6 \, {\left (\left (i - 1\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, \frac {1}{2} i \, \pi b^{2} x^{2} + i \, \pi a b x + \frac {1}{2} i \, \pi a^{2}\right ) - \left (i + 1\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, -\frac {1}{2} i \, \pi b^{2} x^{2} - i \, \pi a b x - \frac {1}{2} i \, \pi a^{2}\right )\right )} a\right )}\right )} b}{24 \, {\left (\pi ^{2} b^{5} x + \pi ^{2} a b^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 147, normalized size = 1.00 \begin {gather*} \frac {\pi ^{2} b^{4} x^{3} \operatorname {S}\left (b x + a\right ) + \pi ^{2} a^{3} \sqrt {b^{2}} \operatorname {S}\left (\frac {\sqrt {b^{2}} {\left (b x + a\right )}}{b}\right ) + 3 \, \pi a \sqrt {b^{2}} \operatorname {C}\left (\frac {\sqrt {b^{2}} {\left (b x + a\right )}}{b}\right ) + {\left (\pi b^{3} x^{2} - \pi a b^{2} x + \pi a^{2} b\right )} \cos \left (\frac {1}{2} \, \pi b^{2} x^{2} + \pi a b x + \frac {1}{2} \, \pi a^{2}\right ) - 2 \, b \sin \left (\frac {1}{2} \, \pi b^{2} x^{2} + \pi a b x + \frac {1}{2} \, \pi a^{2}\right )}{3 \, \pi ^{2} b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} S\left (a + b x\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^2\,\mathrm {FresnelS}\left (a+b\,x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________