Optimal. Leaf size=92 \[ -\frac {a^2 \tan (d+e x)}{b e \left (a^2 \sec (d+e x)+a b\right )}-\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a+b}}\right )}{b^2 e}+\frac {a x}{b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4172, 3923, 3919, 3831, 2659, 205} \[ -\frac {a^2 \tan (d+e x)}{b e \left (a^2 \sec (d+e x)+a b\right )}-\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a+b}}\right )}{b^2 e}+\frac {a x}{b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 2659
Rule 3831
Rule 3919
Rule 3923
Rule 4172
Rubi steps
\begin {align*} \int \frac {a+b \sec (d+e x)}{b^2+2 a b \sec (d+e x)+a^2 \sec ^2(d+e x)} \, dx &=\left (4 a^2\right ) \int \frac {a+b \sec (d+e x)}{\left (2 a b+2 a^2 \sec (d+e x)\right )^2} \, dx\\ &=-\frac {a^2 \tan (d+e x)}{b e \left (a b+a^2 \sec (d+e x)\right )}+\frac {\int \frac {4 a^3 \left (a^2-b^2\right )+4 a^2 b \left (a^2-b^2\right ) \sec (d+e x)}{2 a b+2 a^2 \sec (d+e x)} \, dx}{2 a b \left (a^2-b^2\right )}\\ &=\frac {a x}{b^2}-\frac {a^2 \tan (d+e x)}{b e \left (a b+a^2 \sec (d+e x)\right )}-\frac {\left (2 a \left (a^2-b^2\right )\right ) \int \frac {\sec (d+e x)}{2 a b+2 a^2 \sec (d+e x)} \, dx}{b^2}\\ &=\frac {a x}{b^2}-\frac {a^2 \tan (d+e x)}{b e \left (a b+a^2 \sec (d+e x)\right )}-\frac {\left (a^2-b^2\right ) \int \frac {1}{1+\frac {b \cos (d+e x)}{a}} \, dx}{a b^2}\\ &=\frac {a x}{b^2}-\frac {a^2 \tan (d+e x)}{b e \left (a b+a^2 \sec (d+e x)\right )}-\frac {\left (2 \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+\frac {b}{a}+\left (1-\frac {b}{a}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (d+e x)\right )\right )}{a b^2 e}\\ &=\frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a+b}}\right )}{b^2 e}-\frac {a^2 \tan (d+e x)}{b e \left (a b+a^2 \sec (d+e x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.39, size = 97, normalized size = 1.05 \[ \frac {2 \sqrt {b^2-a^2} \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {b^2-a^2}}\right )+\frac {a (a d+a e x-b \sin (d+e x)+b (d+e x) \cos (d+e x))}{a+b \cos (d+e x)}}{b^2 e} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.85, size = 279, normalized size = 3.03 \[ \left [\frac {2 \, a b e x \cos \left (e x + d\right ) + 2 \, a^{2} e x - 2 \, a b \sin \left (e x + d\right ) + \sqrt {-a^{2} + b^{2}} {\left (b \cos \left (e x + d\right ) + a\right )} \log \left (\frac {2 \, a b \cos \left (e x + d\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (e x + d\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (e x + d\right ) + b\right )} \sin \left (e x + d\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (e x + d\right )^{2} + 2 \, a b \cos \left (e x + d\right ) + a^{2}}\right )}{2 \, {\left (b^{3} e \cos \left (e x + d\right ) + a b^{2} e\right )}}, \frac {a b e x \cos \left (e x + d\right ) + a^{2} e x - a b \sin \left (e x + d\right ) - \sqrt {a^{2} - b^{2}} {\left (b \cos \left (e x + d\right ) + a\right )} \arctan \left (-\frac {a \cos \left (e x + d\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (e x + d\right )}\right )}{b^{3} e \cos \left (e x + d\right ) + a b^{2} e}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 145, normalized size = 1.58 \[ {\left (\frac {{\left (x e + d\right )} a}{b^{2}} - \frac {2 \, a \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )}{{\left (a \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{2} - b \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )^{2} + a + b\right )} b} - \frac {2 \, {\left (\pi \left \lfloor \frac {x e + d}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right ) - b \tan \left (\frac {1}{2} \, x e + \frac {1}{2} \, d\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{b^{2}}\right )} e^{\left (-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.29, size = 163, normalized size = 1.77 \[ -\frac {2 \tan \left (\frac {d}{2}+\frac {e x}{2}\right ) a}{e b \left (a \left (\tan ^{2}\left (\frac {d}{2}+\frac {e x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d}{2}+\frac {e x}{2}\right )\right )+a +b \right )}-\frac {2 \arctan \left (\frac {\tan \left (\frac {d}{2}+\frac {e x}{2}\right ) \left (a -b \right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) a^{2}}{e \,b^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 \arctan \left (\frac {\tan \left (\frac {d}{2}+\frac {e x}{2}\right ) \left (a -b \right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{e \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 a \arctan \left (\tan \left (\frac {d}{2}+\frac {e x}{2}\right )\right )}{e \,b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.02, size = 444, normalized size = 4.83 \[ \frac {2\,\mathrm {atanh}\left (\frac {64\,a^3\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\sqrt {b^2-a^2}}{64\,a^4-128\,a^3\,b+128\,a\,b^3-64\,b^4}-\frac {192\,a^2\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b^2-128\,a^3-64\,b^3+\frac {64\,a^4}{b}}+\frac {192\,a\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}-\frac {64\,b\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )\,\sqrt {b^2-a^2}}{b^2\,e}-\frac {2\,a\,\mathrm {atan}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}{64\,a\,b^2-64\,a^2\,b-64\,a^3+\frac {64\,a^4}{b}}-\frac {64\,a^4\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}{64\,a^4-64\,a^3\,b-64\,a^2\,b^2+64\,a\,b^3}-\frac {64\,a\,b\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )}{b^2\,e}-\frac {2\,a\,\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}{b\,e\,\left (\left (a-b\right )\,{\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}^2+a+b\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 \frac {a + b \sec {\left (d + e x \right )}}{\left (a \sec {\left (d + e x \right )} + b\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________