3.1.87 \(\int \frac {\sec (2 t)}{1+\sec ^2(t)+3 \tan (t)} \, dt\) [87]

Optimal. Leaf size=45 \[ -\frac {1}{12} \log (\cos (t)-\sin (t))-\frac {1}{4} \log (\cos (t)+\sin (t))+\frac {1}{3} \log (2 \cos (t)+\sin (t))-\frac {1}{2 (1+\tan (t))} \]

[Out]

-1/12*ln(cos(t)-sin(t))-1/4*ln(cos(t)+sin(t))+1/3*ln(2*cos(t)+sin(t))-1/2/(1+tan(t))

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {723, 814} \begin {gather*} -\frac {1}{2 (\tan (t)+1)}-\frac {1}{12} \log (\cos (t)-\sin (t))-\frac {1}{4} \log (\sin (t)+\cos (t))+\frac {1}{3} \log (\sin (t)+2 \cos (t)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[2*t]/(1 + Sec[t]^2 + 3*Tan[t]),t]

[Out]

-1/12*Log[Cos[t] - Sin[t]] - Log[Cos[t] + Sin[t]]/4 + Log[2*Cos[t] + Sin[t]]/3 - 1/(2*(1 + Tan[t]))

Rule 723

Int[((d_.) + (e_.)*(x_))^(m_)/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[e*((d + e*x)^(m + 1)/((m
+ 1)*(c*d^2 - b*d*e + a*e^2))), x] + Dist[1/(c*d^2 - b*d*e + a*e^2), Int[(d + e*x)^(m + 1)*(Simp[c*d - b*e - c
*e*x, x]/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*
e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[m, -1]

Rule 814

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[(d + e*x)^m*((f + g*x)/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\sec (2 t)}{1+\sec ^2(t)+3 \tan (t)} \, dt &=\text {Subst}\left (\int \frac {1}{(1+t)^2 \left (2-t-t^2\right )} \, dt,t,\tan (t)\right )\\ &=-\frac {1}{2 (1+\tan (t))}+\frac {1}{2} \text {Subst}\left (\int \frac {t}{(1+t) \left (2-t-t^2\right )} \, dt,t,\tan (t)\right )\\ &=-\frac {1}{2 (1+\tan (t))}+\frac {1}{2} \text {Subst}\left (\int \left (-\frac {1}{6 (-1+t)}-\frac {1}{2 (1+t)}+\frac {2}{3 (2+t)}\right ) \, dt,t,\tan (t)\right )\\ &=-\frac {1}{12} \log (\cos (t)-\sin (t))-\frac {1}{4} \log (\cos (t)+\sin (t))+\frac {1}{3} \log (2 \cos (t)+\sin (t))-\frac {1}{2 (1+\tan (t))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 73, normalized size = 1.62 \begin {gather*} -\frac {\cos (t) (\log (\cos (t)-\sin (t))+3 \log (\cos (t)+\sin (t))-4 \log (2 \cos (t)+\sin (t)))+(-6+\log (\cos (t)-\sin (t))+3 \log (\cos (t)+\sin (t))-4 \log (2 \cos (t)+\sin (t))) \sin (t)}{12 (\cos (t)+\sin (t))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[2*t]/(1 + Sec[t]^2 + 3*Tan[t]),t]

[Out]

-1/12*(Cos[t]*(Log[Cos[t] - Sin[t]] + 3*Log[Cos[t] + Sin[t]] - 4*Log[2*Cos[t] + Sin[t]]) + (-6 + Log[Cos[t] -
Sin[t]] + 3*Log[Cos[t] + Sin[t]] - 4*Log[2*Cos[t] + Sin[t]])*Sin[t])/(Cos[t] + Sin[t])

________________________________________________________________________________________

Mathics [F(-1)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Sec[2*t]/(1 + Sec[t]^2 + 3*Tan[t]),t]')

[Out]

Timed out

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 31, normalized size = 0.69

method result size
default \(-\frac {1}{2 \left (1+\tan \left (t \right )\right )}-\frac {\ln \left (1+\tan \left (t \right )\right )}{4}+\frac {\ln \left (\tan \left (t \right )+2\right )}{3}-\frac {\ln \left (\tan \left (t \right )-1\right )}{12}\) \(31\)
risch \(-\frac {1}{2 \left ({\mathrm e}^{2 i t}+i\right )}+\frac {\ln \left ({\mathrm e}^{2 i t}+\frac {3}{5}+\frac {4 i}{5}\right )}{3}-\frac {\ln \left ({\mathrm e}^{2 i t}+i\right )}{4}-\frac {\ln \left ({\mathrm e}^{2 i t}-i\right )}{12}\) \(48\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(2*t)/(1+sec(t)^2+3*tan(t)),t,method=_RETURNVERBOSE)

[Out]

-1/2/(1+tan(t))-1/4*ln(1+tan(t))+1/3*ln(tan(t)+2)-1/12*ln(tan(t)-1)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 256 vs. \(2 (37) = 74\).
time = 0.42, size = 256, normalized size = 5.69 \begin {gather*} \frac {3 \, {\left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} + 2 \, \sin \left (2 \, t\right ) + 1\right )} \log \left (953674316406250 \, {\left (3 \, \cos \left (2 \, t\right ) + \sin \left (2 \, t\right ) + 4\right )} \cos \left (4 \, t\right ) + 2384185791015625 \, \cos \left (4 \, t\right )^{2} + 953674316406250 \, \cos \left (2 \, t\right )^{2} - 953674316406250 \, {\left (\cos \left (2 \, t\right ) - 3 \, \sin \left (2 \, t\right ) + 3\right )} \sin \left (4 \, t\right ) + 2384185791015625 \, \sin \left (4 \, t\right )^{2} + 953674316406250 \, \sin \left (2 \, t\right )^{2} + 2861022949218750 \, \cos \left (2 \, t\right ) - 953674316406250 \, \sin \left (2 \, t\right ) + 2384185791015625\right ) - 6 \, {\left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} + 2 \, \sin \left (2 \, t\right ) + 1\right )} \log \left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} + 2 \, \sin \left (2 \, t\right ) + 1\right ) + 5 \, {\left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} + 2 \, \sin \left (2 \, t\right ) + 1\right )} \log \left (\frac {5 \, \cos \left (2 \, t\right )^{2} + 5 \, \sin \left (2 \, t\right )^{2} + 6 \, \cos \left (2 \, t\right ) + 8 \, \sin \left (2 \, t\right ) + 5}{5 \, {\left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} - 2 \, \sin \left (2 \, t\right ) + 1\right )}}\right ) - 24 \, \cos \left (2 \, t\right )}{48 \, {\left (\cos \left (2 \, t\right )^{2} + \sin \left (2 \, t\right )^{2} + 2 \, \sin \left (2 \, t\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(2*t)/(1+sec(t)^2+3*tan(t)),t, algorithm="maxima")

[Out]

1/48*(3*(cos(2*t)^2 + sin(2*t)^2 + 2*sin(2*t) + 1)*log(953674316406250*(3*cos(2*t) + sin(2*t) + 4)*cos(4*t) +
2384185791015625*cos(4*t)^2 + 953674316406250*cos(2*t)^2 - 953674316406250*(cos(2*t) - 3*sin(2*t) + 3)*sin(4*t
) + 2384185791015625*sin(4*t)^2 + 953674316406250*sin(2*t)^2 + 2861022949218750*cos(2*t) - 953674316406250*sin
(2*t) + 2384185791015625) - 6*(cos(2*t)^2 + sin(2*t)^2 + 2*sin(2*t) + 1)*log(cos(2*t)^2 + sin(2*t)^2 + 2*sin(2
*t) + 1) + 5*(cos(2*t)^2 + sin(2*t)^2 + 2*sin(2*t) + 1)*log(1/5*(5*cos(2*t)^2 + 5*sin(2*t)^2 + 6*cos(2*t) + 8*
sin(2*t) + 5)/(cos(2*t)^2 + sin(2*t)^2 - 2*sin(2*t) + 1)) - 24*cos(2*t))/(cos(2*t)^2 + sin(2*t)^2 + 2*sin(2*t)
 + 1)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 71, normalized size = 1.58 \begin {gather*} \frac {4 \, {\left (\cos \left (t\right ) + \sin \left (t\right )\right )} \log \left (\frac {3}{4} \, \cos \left (t\right )^{2} + \cos \left (t\right ) \sin \left (t\right ) + \frac {1}{4}\right ) - 3 \, {\left (\cos \left (t\right ) + \sin \left (t\right )\right )} \log \left (2 \, \cos \left (t\right ) \sin \left (t\right ) + 1\right ) - {\left (\cos \left (t\right ) + \sin \left (t\right )\right )} \log \left (-2 \, \cos \left (t\right ) \sin \left (t\right ) + 1\right ) - 6 \, \cos \left (t\right ) + 6 \, \sin \left (t\right )}{24 \, {\left (\cos \left (t\right ) + \sin \left (t\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(2*t)/(1+sec(t)^2+3*tan(t)),t, algorithm="fricas")

[Out]

1/24*(4*(cos(t) + sin(t))*log(3/4*cos(t)^2 + cos(t)*sin(t) + 1/4) - 3*(cos(t) + sin(t))*log(2*cos(t)*sin(t) +
1) - (cos(t) + sin(t))*log(-2*cos(t)*sin(t) + 1) - 6*cos(t) + 6*sin(t))/(cos(t) + sin(t))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (2 t \right )}}{3 \tan {\left (t \right )} + \sec ^{2}{\left (t \right )} + 1}\, dt \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(2*t)/(1+sec(t)**2+3*tan(t)),t)

[Out]

Integral(sec(2*t)/(3*tan(t) + sec(t)**2 + 1), t)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 39, normalized size = 0.87 \begin {gather*} -\frac {\ln \left |\tan t-1\right |}{12}+\frac {\ln \left |\tan t+2\right |}{3}-\frac {\ln \left |\tan t+1\right |}{4}-\frac {1}{2 \left (\tan t+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(2*t)/(1+sec(t)^2+3*tan(t)),t)

[Out]

-1/2/(tan(t) + 1) + 1/3*log(abs(tan(t) + 2)) - 1/4*log(abs(tan(t) + 1)) - 1/12*log(abs(tan(t) - 1))

________________________________________________________________________________________

Mupad [B]
time = 0.72, size = 32, normalized size = 0.71 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (t\right )+2\right )}{3}-\frac {\ln \left (\mathrm {tan}\left (t\right )+1\right )}{4}-\frac {\ln \left (\mathrm {tan}\left (t\right )-1\right )}{12}-\frac {1}{2\,\left (\mathrm {tan}\left (t\right )+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(2*t)*(3*tan(t) + 1/cos(t)^2 + 1)),t)

[Out]

log(tan(t) + 2)/3 - log(tan(t) + 1)/4 - log(tan(t) - 1)/12 - 1/(2*(tan(t) + 1))

________________________________________________________________________________________