Optimal. Leaf size=66 \[ -\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} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 6, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.546, Rules used = {2715, 8, 2634,
3384, 3380, 3383} \begin {gather*} \frac {\sin (2 a) \text {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) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2634
Rule 2715
Rule 3380
Rule 3383
Rule 3384
Rubi steps
\begin {align*} \int \log (x) \sin ^2(a+b x) \, dx &=\frac {1}{2} x \log (x)-\frac {\cos (a+b x) \log (x) \sin (a+b x)}{2 b}-\int \left (\frac {1}{2}-\frac {\sin (2 a+2 b x)}{4 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+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]
time = 0.06, size = 50, normalized size = 0.76 \begin {gather*} \frac {-2 b x+2 b x \log (x)+\text {Ci}(2 b x) \sin (2 a)-\log (x) \sin (2 (a+b x))+\cos (2 a) \text {Si}(2 b x)}{4 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.13, size = 132, normalized size = 2.00
method | result | size |
risch | \(\frac {x \ln \left (x \right )}{2}-\frac {\ln \left (x \right ) \sin \left (2 b x +2 a \right )}{4 b}-\frac {{\mathrm e}^{-2 i a} \pi \,\mathrm {csgn}\left (b x \right )}{8 b}+\frac {{\mathrm e}^{-2 i a} \sinIntegral \left (2 b x \right )}{4 b}-\frac {i {\mathrm e}^{-2 i a} \expIntegral \left (1, -2 i b x \right )}{8 b}+\frac {a \ln \left (i b x \right )}{2 b}-\frac {x}{2}-\frac {a}{2 b}-\frac {a \ln \left (a +i \left (i b x +i a \right )\right )}{2 b}+\frac {i {\mathrm e}^{2 i a} \expIntegral \left (1, -2 i b x \right )}{8 b}\) | \(132\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.36, size = 79, normalized size = 1.20 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 59, normalized size = 0.89 \begin {gather*} \frac {4 \, b x \log \left (x\right ) - 4 \, \cos \left (b x + a\right ) \log \left (x\right ) \sin \left (b x + a\right ) - 4 \, b x + {\left (\operatorname {Ci}\left (2 \, b x\right ) + \operatorname {Ci}\left (-2 \, b x\right )\right )} \sin \left (2 \, a\right ) + 2 \, \cos \left (2 \, a\right ) \operatorname {Si}\left (2 \, b x\right )}{8 \, b} \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 \log {\left (x \right )} \sin ^{2}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 4.58, size = 123, normalized size = 1.86 \begin {gather*} \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 )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int {\sin \left (a+b\,x\right )}^2\,\ln \left (x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________