Optimal. Leaf size=53 \[ \frac {(b c-a d)^2 \log (c+d \tan (x))}{d^3}-\frac {b \tan (x) (b c-a d)}{d^2}+\frac {(a+b \tan (x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4342, 43} \[ -\frac {b \tan (x) (b c-a d)}{d^2}+\frac {(b c-a d)^2 \log (c+d \tan (x))}{d^3}+\frac {(a+b \tan (x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 4342
Rubi steps
\begin {align*} \int \frac {\sec ^2(x) (a+b \tan (x))^2}{c+d \tan (x)} \, dx &=\operatorname {Subst}\left (\int \frac {(a+b x)^2}{c+d x} \, dx,x,\tan (x)\right )\\ &=\operatorname {Subst}\left (\int \left (-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}+\frac {(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx,x,\tan (x)\right )\\ &=\frac {(b c-a d)^2 \log (c+d \tan (x))}{d^3}-\frac {b (b c-a d) \tan (x)}{d^2}+\frac {(a+b \tan (x))^2}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.59, size = 62, normalized size = 1.17 \[ \frac {b^2 d^2 \sec ^2(x)-2 \left (b d \tan (x) (b c-2 a d)+(b c-a d)^2 (\log (\cos (x))-\log (c \cos (x)+d \sin (x)))\right )}{2 d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.63, size = 122, normalized size = 2.30 \[ \frac {b^{2} d^{2} + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \cos \relax (x)^{2} \log \left (2 \, c d \cos \relax (x) \sin \relax (x) + {\left (c^{2} - d^{2}\right )} \cos \relax (x)^{2} + d^{2}\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \cos \relax (x)^{2} \log \left (\cos \relax (x)^{2}\right ) - 2 \, {\left (b^{2} c d - 2 \, a b d^{2}\right )} \cos \relax (x) \sin \relax (x)}{2 \, d^{3} \cos \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 64, normalized size = 1.21 \[ \frac {b^{2} d \tan \relax (x)^{2} - 2 \, b^{2} c \tan \relax (x) + 4 \, a b d \tan \relax (x)}{2 \, d^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | d \tan \relax (x) + c \right |}\right )}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.13, size = 80, normalized size = 1.51 \[ \frac {b^{2} \left (\tan ^{2}\relax (x )\right )}{2 d}+\frac {2 b a \tan \relax (x )}{d}-\frac {b^{2} \tan \relax (x ) c}{d^{2}}+\frac {\ln \left (c +d \tan \relax (x )\right ) a^{2}}{d}-\frac {2 \ln \left (c +d \tan \relax (x )\right ) a b c}{d^{2}}+\frac {\ln \left (c +d \tan \relax (x )\right ) b^{2} c^{2}}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.35, size = 63, normalized size = 1.19 \[ \frac {b^{2} d \tan \relax (x)^{2} - 2 \, {\left (b^{2} c - 2 \, a b d\right )} \tan \relax (x)}{2 \, d^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (d \tan \relax (x) + c\right )}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.98, size = 65, normalized size = 1.23 \[ \frac {\ln \left (c+d\,\mathrm {tan}\relax (x)\right )\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{d^3}-\mathrm {tan}\relax (x)\,\left (\frac {b^2\,c}{d^2}-\frac {2\,a\,b}{d}\right )+\frac {b^2\,{\mathrm {tan}\relax (x)}^2}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 7.63, size = 56, normalized size = 1.06 \[ \frac {b^{2} \tan ^{2}{\relax (x )}}{2 d} + \frac {\left (a d - b c\right )^{2} \left (\begin {cases} \frac {\tan {\relax (x )}}{c} & \text {for}\: d = 0 \\\frac {\log {\left (c + d \tan {\relax (x )} \right )}}{d} & \text {otherwise} \end {cases}\right )}{d^{2}} + \frac {\left (2 a b d - b^{2} c\right ) \tan {\relax (x )}}{d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________