\(\int (1+2 x) \sec ^2(1+2 x) \, dx\) [930]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 27 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {1}{2} \log (\cos (1+2 x))+\frac {1}{2} (1+2 x) \tan (1+2 x) \]

[Out]

1/2*ln(cos(1+2*x))+1/2*(1+2*x)*tan(1+2*x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4269, 3556} \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {1}{2} (2 x+1) \tan (2 x+1)+\frac {1}{2} \log (\cos (2 x+1)) \]

[In]

Int[(1 + 2*x)*Sec[1 + 2*x]^2,x]

[Out]

Log[Cos[1 + 2*x]]/2 + ((1 + 2*x)*Tan[1 + 2*x])/2

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} (1+2 x) \tan (1+2 x)-\int \tan (1+2 x) \, dx \\ & = \frac {1}{2} \log (\cos (1+2 x))+\frac {1}{2} (1+2 x) \tan (1+2 x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.11 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {1}{2} \log (\cos (1+2 x))+\frac {1}{2} \tan (1+2 x)+x \tan (1+2 x) \]

[In]

Integrate[(1 + 2*x)*Sec[1 + 2*x]^2,x]

[Out]

Log[Cos[1 + 2*x]]/2 + Tan[1 + 2*x]/2 + x*Tan[1 + 2*x]

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {\ln \left (\cos \left (1+2 x \right )\right )}{2}+\frac {\left (1+2 x \right ) \tan \left (1+2 x \right )}{2}\) \(24\)
default \(\frac {\ln \left (\cos \left (1+2 x \right )\right )}{2}+\frac {\left (1+2 x \right ) \tan \left (1+2 x \right )}{2}\) \(24\)
risch \(-2 i x -i+\frac {i \left (1+2 x \right )}{{\mathrm e}^{2 i \left (1+2 x \right )}+1}+\frac {\ln \left ({\mathrm e}^{2 i \left (1+2 x \right )}+1\right )}{2}\) \(43\)
norman \(\frac {-2 x \tan \left (x +\frac {1}{2}\right )-\tan \left (x +\frac {1}{2}\right )}{\tan \left (x +\frac {1}{2}\right )^{2}-1}+\frac {\ln \left (\tan \left (x +\frac {1}{2}\right )-1\right )}{2}+\frac {\ln \left (\tan \left (x +\frac {1}{2}\right )+1\right )}{2}-\frac {\ln \left (1+\tan \left (x +\frac {1}{2}\right )^{2}\right )}{2}\) \(56\)
parallelrisch \(\frac {\ln \left (\tan \left (x +\frac {1}{2}\right )-1\right ) \cos \left (1+2 x \right )+\ln \left (\tan \left (x +\frac {1}{2}\right )+1\right ) \cos \left (1+2 x \right )-\ln \left (\sec \left (x +\frac {1}{2}\right )^{2}\right ) \cos \left (1+2 x \right )+2 x \sin \left (1+2 x \right )+\sin \left (1+2 x \right )}{2 \cos \left (1+2 x \right )}\) \(70\)

[In]

int((1+2*x)*sec(1+2*x)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*ln(cos(1+2*x))+1/2*(1+2*x)*tan(1+2*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.44 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {\cos \left (2 \, x + 1\right ) \log \left (-\cos \left (2 \, x + 1\right )\right ) + {\left (2 \, x + 1\right )} \sin \left (2 \, x + 1\right )}{2 \, \cos \left (2 \, x + 1\right )} \]

[In]

integrate((1+2*x)*sec(1+2*x)^2,x, algorithm="fricas")

[Out]

1/2*(cos(2*x + 1)*log(-cos(2*x + 1)) + (2*x + 1)*sin(2*x + 1))/cos(2*x + 1)

Sympy [A] (verification not implemented)

Time = 0.68 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.81 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {\left (2 x + 1\right ) \tan {\left (2 x + 1 \right )}}{2} + \frac {\log {\left (\cos {\left (2 x + 1 \right )} \right )}}{2} \]

[In]

integrate((1+2*x)*sec(1+2*x)**2,x)

[Out]

(2*x + 1)*tan(2*x + 1)/2 + log(cos(2*x + 1))/2

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 98 vs. \(2 (23) = 46\).

Time = 0.28 (sec) , antiderivative size = 98, normalized size of antiderivative = 3.63 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {{\left (\cos \left (4 \, x + 2\right )^{2} + \sin \left (4 \, x + 2\right )^{2} + 2 \, \cos \left (4 \, x + 2\right ) + 1\right )} \log \left (\cos \left (4 \, x + 2\right )^{2} + \sin \left (4 \, x + 2\right )^{2} + 2 \, \cos \left (4 \, x + 2\right ) + 1\right ) + 4 \, {\left (2 \, x + 1\right )} \sin \left (4 \, x + 2\right )}{4 \, {\left (\cos \left (4 \, x + 2\right )^{2} + \sin \left (4 \, x + 2\right )^{2} + 2 \, \cos \left (4 \, x + 2\right ) + 1\right )}} \]

[In]

integrate((1+2*x)*sec(1+2*x)^2,x, algorithm="maxima")

[Out]

1/4*((cos(4*x + 2)^2 + sin(4*x + 2)^2 + 2*cos(4*x + 2) + 1)*log(cos(4*x + 2)^2 + sin(4*x + 2)^2 + 2*cos(4*x +
2) + 1) + 4*(2*x + 1)*sin(4*x + 2))/(cos(4*x + 2)^2 + sin(4*x + 2)^2 + 2*cos(4*x + 2) + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 908 vs. \(2 (23) = 46\).

Time = 0.40 (sec) , antiderivative size = 908, normalized size of antiderivative = 33.63 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\text {Too large to display} \]

[In]

integrate((1+2*x)*sec(1+2*x)^2,x, algorithm="giac")

[Out]

1/4*(log(4*(tan(1/2)^4*tan(x)^4 - 2*tan(1/2)^4*tan(x)^2 - 8*tan(1/2)^3*tan(x)^3 - 2*tan(1/2)^2*tan(x)^4 + tan(
1/2)^4 + 8*tan(1/2)^3*tan(x) + 20*tan(1/2)^2*tan(x)^2 + 8*tan(1/2)*tan(x)^3 + tan(x)^4 - 2*tan(1/2)^2 - 8*tan(
1/2)*tan(x) - 2*tan(x)^2 + 1)/(tan(1/2)^4*tan(x)^4 + 2*tan(1/2)^4*tan(x)^2 + 2*tan(1/2)^2*tan(x)^4 + tan(1/2)^
4 + 4*tan(1/2)^2*tan(x)^2 + tan(x)^4 + 2*tan(1/2)^2 + 2*tan(x)^2 + 1))*tan(1/2)^2*tan(x)^2 - 8*x*tan(1/2)^2*ta
n(x) - 8*x*tan(1/2)*tan(x)^2 - log(4*(tan(1/2)^4*tan(x)^4 - 2*tan(1/2)^4*tan(x)^2 - 8*tan(1/2)^3*tan(x)^3 - 2*
tan(1/2)^2*tan(x)^4 + tan(1/2)^4 + 8*tan(1/2)^3*tan(x) + 20*tan(1/2)^2*tan(x)^2 + 8*tan(1/2)*tan(x)^3 + tan(x)
^4 - 2*tan(1/2)^2 - 8*tan(1/2)*tan(x) - 2*tan(x)^2 + 1)/(tan(1/2)^4*tan(x)^4 + 2*tan(1/2)^4*tan(x)^2 + 2*tan(1
/2)^2*tan(x)^4 + tan(1/2)^4 + 4*tan(1/2)^2*tan(x)^2 + tan(x)^4 + 2*tan(1/2)^2 + 2*tan(x)^2 + 1))*tan(1/2)^2 -
4*log(4*(tan(1/2)^4*tan(x)^4 - 2*tan(1/2)^4*tan(x)^2 - 8*tan(1/2)^3*tan(x)^3 - 2*tan(1/2)^2*tan(x)^4 + tan(1/2
)^4 + 8*tan(1/2)^3*tan(x) + 20*tan(1/2)^2*tan(x)^2 + 8*tan(1/2)*tan(x)^3 + tan(x)^4 - 2*tan(1/2)^2 - 8*tan(1/2
)*tan(x) - 2*tan(x)^2 + 1)/(tan(1/2)^4*tan(x)^4 + 2*tan(1/2)^4*tan(x)^2 + 2*tan(1/2)^2*tan(x)^4 + tan(1/2)^4 +
 4*tan(1/2)^2*tan(x)^2 + tan(x)^4 + 2*tan(1/2)^2 + 2*tan(x)^2 + 1))*tan(1/2)*tan(x) - 4*tan(1/2)^2*tan(x) - lo
g(4*(tan(1/2)^4*tan(x)^4 - 2*tan(1/2)^4*tan(x)^2 - 8*tan(1/2)^3*tan(x)^3 - 2*tan(1/2)^2*tan(x)^4 + tan(1/2)^4
+ 8*tan(1/2)^3*tan(x) + 20*tan(1/2)^2*tan(x)^2 + 8*tan(1/2)*tan(x)^3 + tan(x)^4 - 2*tan(1/2)^2 - 8*tan(1/2)*ta
n(x) - 2*tan(x)^2 + 1)/(tan(1/2)^4*tan(x)^4 + 2*tan(1/2)^4*tan(x)^2 + 2*tan(1/2)^2*tan(x)^4 + tan(1/2)^4 + 4*t
an(1/2)^2*tan(x)^2 + tan(x)^4 + 2*tan(1/2)^2 + 2*tan(x)^2 + 1))*tan(x)^2 - 4*tan(1/2)*tan(x)^2 + 8*x*tan(1/2)
+ 8*x*tan(x) + log(4*(tan(1/2)^4*tan(x)^4 - 2*tan(1/2)^4*tan(x)^2 - 8*tan(1/2)^3*tan(x)^3 - 2*tan(1/2)^2*tan(x
)^4 + tan(1/2)^4 + 8*tan(1/2)^3*tan(x) + 20*tan(1/2)^2*tan(x)^2 + 8*tan(1/2)*tan(x)^3 + tan(x)^4 - 2*tan(1/2)^
2 - 8*tan(1/2)*tan(x) - 2*tan(x)^2 + 1)/(tan(1/2)^4*tan(x)^4 + 2*tan(1/2)^4*tan(x)^2 + 2*tan(1/2)^2*tan(x)^4 +
 tan(1/2)^4 + 4*tan(1/2)^2*tan(x)^2 + tan(x)^4 + 2*tan(1/2)^2 + 2*tan(x)^2 + 1)) + 4*tan(1/2) + 4*tan(x))/(tan
(1/2)^2*tan(x)^2 - tan(1/2)^2 - 4*tan(1/2)*tan(x) - tan(x)^2 + 1)

Mupad [B] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85 \[ \int (1+2 x) \sec ^2(1+2 x) \, dx=\frac {\ln \left (\cos \left (2\,x+1\right )\right )}{2}+\frac {\mathrm {tan}\left (2\,x+1\right )\,\left (2\,x+1\right )}{2} \]

[In]

int((2*x + 1)/cos(2*x + 1)^2,x)

[Out]

log(cos(2*x + 1))/2 + (tan(2*x + 1)*(2*x + 1))/2