3.26 \(\int \frac {1}{-2 \cos ^2(2+3 x)+\sin ^2(2+3 x)} \, dx\)
Optimal. Leaf size=61 \[ \frac {\log \left (\sqrt {2} \cos (3 x+2)-\sin (3 x+2)\right )}{6 \sqrt {2}}-\frac {\log \left (\sin (3 x+2)+\sqrt {2} \cos (3 x+2)\right )}{6 \sqrt {2}} \]
[Out]
1/12*ln(-sin(2+3*x)+cos(2+3*x)*2^(1/2))*2^(1/2)-1/12*ln(sin(2+3*x)+cos(2+3*x)*2^(1/2))*2^(1/2)
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 61, normalized size of antiderivative = 1.00,
number of steps used = 2, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used =
{207} \[ \frac {\log \left (\sqrt {2} \cos (3 x+2)-\sin (3 x+2)\right )}{6 \sqrt {2}}-\frac {\log \left (\sin (3 x+2)+\sqrt {2} \cos (3 x+2)\right )}{6 \sqrt {2}} \]
Antiderivative was successfully verified.
[In]
Int[(-2*Cos[2 + 3*x]^2 + Sin[2 + 3*x]^2)^(-1),x]
[Out]
Log[Sqrt[2]*Cos[2 + 3*x] - Sin[2 + 3*x]]/(6*Sqrt[2]) - Log[Sqrt[2]*Cos[2 + 3*x] + Sin[2 + 3*x]]/(6*Sqrt[2])
Rule 207
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])
Rubi steps
\begin {align*} \int \frac {1}{-2 \cos ^2(2+3 x)+\sin ^2(2+3 x)} \, dx &=\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{-2+x^2} \, dx,x,\tan (2+3 x)\right )\\ &=\frac {\log \left (\sqrt {2} \cos (2+3 x)-\sin (2+3 x)\right )}{6 \sqrt {2}}-\frac {\log \left (\sqrt {2} \cos (2+3 x)+\sin (2+3 x)\right )}{6 \sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 22, normalized size = 0.36 \[ -\frac {\tanh ^{-1}\left (\frac {\tan (3 x+2)}{\sqrt {2}}\right )}{3 \sqrt {2}} \]
Antiderivative was successfully verified.
[In]
Integrate[(-2*Cos[2 + 3*x]^2 + Sin[2 + 3*x]^2)^(-1),x]
[Out]
-1/3*ArcTanh[Tan[2 + 3*x]/Sqrt[2]]/Sqrt[2]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 85, normalized size = 1.39 \[ \frac {1}{24} \, \sqrt {2} \log \left (-\frac {7 \, \cos \left (3 \, x + 2\right )^{4} - 10 \, \cos \left (3 \, x + 2\right )^{2} + 4 \, {\left (\sqrt {2} \cos \left (3 \, x + 2\right )^{3} + \sqrt {2} \cos \left (3 \, x + 2\right )\right )} \sin \left (3 \, x + 2\right ) - 1}{9 \, \cos \left (3 \, x + 2\right )^{4} - 6 \, \cos \left (3 \, x + 2\right )^{2} + 1}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(1/(-2*cos(2+3*x)^2+sin(2+3*x)^2),x, algorithm="fricas")
[Out]
1/24*sqrt(2)*log(-(7*cos(3*x + 2)^4 - 10*cos(3*x + 2)^2 + 4*(sqrt(2)*cos(3*x + 2)^3 + sqrt(2)*cos(3*x + 2))*si
n(3*x + 2) - 1)/(9*cos(3*x + 2)^4 - 6*cos(3*x + 2)^2 + 1))
________________________________________________________________________________________
giac [A] time = 0.21, size = 39, normalized size = 0.64 \[ \frac {1}{12} \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 2 \, \tan \left (3 \, x + 2\right ) \right |}}{{\left | 2 \, \sqrt {2} + 2 \, \tan \left (3 \, x + 2\right ) \right |}}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(1/(-2*cos(2+3*x)^2+sin(2+3*x)^2),x, algorithm="giac")
[Out]
1/12*sqrt(2)*log(abs(-2*sqrt(2) + 2*tan(3*x + 2))/abs(2*sqrt(2) + 2*tan(3*x + 2)))
________________________________________________________________________________________
maple [A] time = 0.23, size = 18, normalized size = 0.30 \[ -\frac {\sqrt {2}\, \arctanh \left (\frac {\sqrt {2}\, \tan \left (2+3 x \right )}{2}\right )}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(1/(-2*cos(2+3*x)^2+sin(2+3*x)^2),x)
[Out]
-1/6*2^(1/2)*arctanh(1/2*2^(1/2)*tan(2+3*x))
________________________________________________________________________________________
maxima [A] time = 0.54, size = 32, normalized size = 0.52 \[ \frac {1}{12} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \tan \left (3 \, x + 2\right )}{\sqrt {2} + \tan \left (3 \, x + 2\right )}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(1/(-2*cos(2+3*x)^2+sin(2+3*x)^2),x, algorithm="maxima")
[Out]
1/12*sqrt(2)*log(-(sqrt(2) - tan(3*x + 2))/(sqrt(2) + tan(3*x + 2)))
________________________________________________________________________________________
mupad [B] time = 2.42, size = 17, normalized size = 0.28 \[ -\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (3\,x+2\right )}{2}\right )}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(1/(sin(3*x + 2)^2 - 2*cos(3*x + 2)^2),x)
[Out]
-(2^(1/2)*atanh((2^(1/2)*tan(3*x + 2))/2))/6
________________________________________________________________________________________
sympy [B] time = 16.48, size = 1481, normalized size = 24.28 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(1/(-2*cos(2+3*x)**2+sin(2+3*x)**2),x)
[Out]
-4988289*sqrt(3)*sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) - sqrt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(s
qrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) - 136929*sqrt(
2 - sqrt(3))*log(tan(3*x/2 + 1) - sqrt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*
sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 79056*sqrt(3)*sqrt(2 - sqrt(3))*lo
g(tan(3*x/2 + 1) - sqrt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 34705
83 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 8639970*sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) - sq
rt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)
*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) - 11281635*sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) + sqrt(2 - sqrt(3)))/(-3
9175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*s
qrt(sqrt(3) + 2)) - 487723*sqrt(3)*sqrt(2 - sqrt(3))*log(tan(3*x/2 + 1) + sqrt(2 - sqrt(3)))/(-39175383*sqrt(2
- sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) +
2)) + 844761*sqrt(2 - sqrt(3))*log(tan(3*x/2 + 1) + sqrt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(
3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 6513455*sqrt(3)*
sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) + sqrt(2 - sqrt(3)))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 200
3742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) - 1820207*sqrt(3)*sqrt(sqrt(3)
+ 2)*log(tan(3*x/2 + 1) - sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3)
+ 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) - 3022905*sqrt(2 - sqrt(3))*log(tan(3*x/2 +
1) - sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*
sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 1745275*sqrt(3)*sqrt(2 - sqrt(3))*log(tan(3*x/2 + 1) - sqrt(sqr
t(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(
2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 3152691*sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) - sqrt(sqrt(3) + 2))/(-39175383
*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqr
t(3) + 2)) - 1336608*sqrt(3)*sqrt(2 - sqrt(3))*log(tan(3*x/2 + 1) + sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqr
t(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) -
511026*sqrt(sqrt(3) + 2)*log(tan(3*x/2 + 1) + sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2
) - 2003742*sqrt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 295041*sqrt(3)*sqrt(sq
rt(3) + 2)*log(tan(3*x/2 + 1) + sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sq
rt(3) + 3470583 + 22617918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2)) + 2315073*sqrt(2 - sqrt(3))*log(tan(3*
x/2 + 1) + sqrt(sqrt(3) + 2))/(-39175383*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2) - 2003742*sqrt(3) + 3470583 + 226
17918*sqrt(3)*sqrt(2 - sqrt(3))*sqrt(sqrt(3) + 2))
________________________________________________________________________________________