Optimal. Leaf size=55 \[ \frac {a^2 \sin (c+d x)}{d}-\frac {2 a b \cos (c+d x)}{d}-\frac {b^2 \sin (c+d x)}{d}+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3090, 2637, 2638, 2592, 321, 206} \[ \frac {a^2 \sin (c+d x)}{d}-\frac {2 a b \cos (c+d x)}{d}-\frac {b^2 \sin (c+d x)}{d}+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 321
Rule 2592
Rule 2637
Rule 2638
Rule 3090
Rubi steps
\begin {align*} \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx &=\int \left (a^2 \cos (c+d x)+2 a b \sin (c+d x)+b^2 \sin (c+d x) \tan (c+d x)\right ) \, dx\\ &=a^2 \int \cos (c+d x) \, dx+(2 a b) \int \sin (c+d x) \, dx+b^2 \int \sin (c+d x) \tan (c+d x) \, dx\\ &=-\frac {2 a b \cos (c+d x)}{d}+\frac {a^2 \sin (c+d x)}{d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {2 a b \cos (c+d x)}{d}+\frac {a^2 \sin (c+d x)}{d}-\frac {b^2 \sin (c+d x)}{d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 a b \cos (c+d x)}{d}+\frac {a^2 \sin (c+d x)}{d}-\frac {b^2 \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.16, size = 84, normalized size = 1.53 \[ \frac {\left (a^2-b^2\right ) \sin (c+d x)-2 a b \cos (c+d x)+b^2 \left (\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 62, normalized size = 1.13 \[ -\frac {4 \, a b \cos \left (d x + c\right ) - b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 4.94, size = 89, normalized size = 1.62 \[ \frac {b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.86, size = 63, normalized size = 1.15 \[ -\frac {2 a b \cos \left (d x +c \right )}{d}+\frac {a^{2} \sin \left (d x +c \right )}{d}-\frac {b^{2} \sin \left (d x +c \right )}{d}+\frac {b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 60, normalized size = 1.09 \[ \frac {b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - 4 \, a b \cos \left (d x + c\right ) + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.49, size = 66, normalized size = 1.20 \[ \frac {2\,b^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {4\,a\,b-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-2\,b^2\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{2} \sec {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________