\(\int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx\) [846]

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

Optimal result

Integrand size = 15, antiderivative size = 74 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=-\frac {4}{9} \text {arctanh}(\sin (x))-\frac {1}{9} \sqrt {7} \log \left (\sqrt {7} \cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\frac {1}{9} \sqrt {7} \log \left (\sqrt {7} \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\frac {\tan (x)}{3} \] Output:

-4/9*arctanh(sin(x))-1/9*7^(1/2)*ln(7^(1/2)*cos(1/2*x)-sin(1/2*x))+1/9*7^( 
1/2)*ln(7^(1/2)*cos(1/2*x)+sin(1/2*x))+1/3*tan(x)
 

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.85 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=\frac {1}{9} \left (2 \sqrt {7} \text {arctanh}\left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {7}}\right )+4 \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-4 \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+3 \tan (x)\right ) \] Input:

Integrate[(Sec[x]*Tan[x]^2)/(4 + 3*Sec[x]),x]
 

Output:

(2*Sqrt[7]*ArcTanh[Tan[x/2]/Sqrt[7]] + 4*Log[Cos[x/2] - Sin[x/2]] - 4*Log[ 
Cos[x/2] + Sin[x/2]] + 3*Tan[x])/9
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.55, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.867, Rules used = {3042, 4897, 3042, 3202, 3042, 3535, 25, 3042, 3480, 3042, 3138, 219, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tan ^2(x) \sec (x)}{3 \sec (x)+4} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan (x)^2 \sec (x)}{3 \sec (x)+4}dx\)

\(\Big \downarrow \) 4897

\(\displaystyle \int \frac {\tan ^2(x)}{4 \cos (x)+3}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\left (3-4 \sin \left (x-\frac {\pi }{2}\right )\right ) \tan \left (x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 3202

\(\displaystyle \int \frac {\left (1-\cos ^2(x)\right ) \sec ^2(x)}{4 \cos (x)+3}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1-\sin \left (x+\frac {\pi }{2}\right )^2}{\sin \left (x+\frac {\pi }{2}\right )^2 \left (4 \sin \left (x+\frac {\pi }{2}\right )+3\right )}dx\)

\(\Big \downarrow \) 3535

\(\displaystyle \frac {1}{3} \int -\frac {(3 \cos (x)+4) \sec (x)}{4 \cos (x)+3}dx+\frac {\tan (x)}{3}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\tan (x)}{3}-\frac {1}{3} \int \frac {(3 \cos (x)+4) \sec (x)}{4 \cos (x)+3}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\tan (x)}{3}-\frac {1}{3} \int \frac {3 \sin \left (x+\frac {\pi }{2}\right )+4}{\sin \left (x+\frac {\pi }{2}\right ) \left (4 \sin \left (x+\frac {\pi }{2}\right )+3\right )}dx\)

\(\Big \downarrow \) 3480

\(\displaystyle \frac {1}{3} \left (\frac {7}{3} \int \frac {1}{4 \cos (x)+3}dx-\frac {4 \int \sec (x)dx}{3}\right )+\frac {\tan (x)}{3}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} \left (\frac {7}{3} \int \frac {1}{4 \sin \left (x+\frac {\pi }{2}\right )+3}dx-\frac {4}{3} \int \csc \left (x+\frac {\pi }{2}\right )dx\right )+\frac {\tan (x)}{3}\)

\(\Big \downarrow \) 3138

\(\displaystyle \frac {1}{3} \left (\frac {14}{3} \int \frac {1}{7-\tan ^2\left (\frac {x}{2}\right )}d\tan \left (\frac {x}{2}\right )-\frac {4}{3} \int \csc \left (x+\frac {\pi }{2}\right )dx\right )+\frac {\tan (x)}{3}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {1}{3} \left (\frac {2}{3} \sqrt {7} \text {arctanh}\left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {7}}\right )-\frac {4}{3} \int \csc \left (x+\frac {\pi }{2}\right )dx\right )+\frac {\tan (x)}{3}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{3} \left (\frac {2}{3} \sqrt {7} \text {arctanh}\left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {7}}\right )-\frac {4}{3} \text {arctanh}(\sin (x))\right )+\frac {\tan (x)}{3}\)

Input:

Int[(Sec[x]*Tan[x]^2)/(4 + 3*Sec[x]),x]
 

Output:

((-4*ArcTanh[Sin[x]])/3 + (2*Sqrt[7]*ArcTanh[Tan[x/2]/Sqrt[7]])/3)/3 + Tan 
[x]/3
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3138
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ 
e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + b + 
(a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] 
 && NeQ[a^2 - b^2, 0]
 

rule 3202
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)/tan[(e_.) + (f_.)*(x_)]^2, 
x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*((1 - Sin[e + f*x]^2)/Sin[e + f*x]^ 
2), x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b^2, 0]
 

rule 3480
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_ 
.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[(A*b 
- a*B)/(b*c - a*d)   Int[1/(a + b*Sin[e + f*x]), x], x] + Simp[(B*c - A*d)/ 
(b*c - a*d)   Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f 
, A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
 

rule 3535
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> 
Simp[(-(A*b^2 + a^2*C))*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1)*((c + d*S 
in[e + f*x])^(n + 1)/(f*(m + 1)*(b*c - a*d)*(a^2 - b^2))), x] + Simp[1/((m 
+ 1)*(b*c - a*d)*(a^2 - b^2))   Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin 
[e + f*x])^n*Simp[a*(m + 1)*(b*c - a*d)*(A + C) + d*(A*b^2 + a^2*C)*(m + n 
+ 2) - (c*(A*b^2 + a^2*C) + b*(m + 1)*(b*c - a*d)*(A + C))*Sin[e + f*x] - d 
*(A*b^2 + a^2*C)*(m + n + 3)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, 
d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 
- d^2, 0] && LtQ[m, -1] && ((EqQ[a, 0] && IntegerQ[m] &&  !IntegerQ[n]) || 
 !(IntegerQ[2*n] && LtQ[n, -1] && ((IntegerQ[n] &&  !IntegerQ[m]) || EqQ[a, 
 0])))
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4897
Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]
 
Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.74

method result size
default \(\frac {2 \sqrt {7}\, \operatorname {arctanh}\left (\frac {\tan \left (\frac {x}{2}\right ) \sqrt {7}}{7}\right )}{9}-\frac {1}{3 \left (1+\tan \left (\frac {x}{2}\right )\right )}-\frac {4 \ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{9}-\frac {1}{3 \left (\tan \left (\frac {x}{2}\right )-1\right )}+\frac {4 \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{9}\) \(55\)
risch \(\frac {2 i}{3 \left (1+{\mathrm e}^{2 i x}\right )}-\frac {4 \ln \left ({\mathrm e}^{i x}+i\right )}{9}+\frac {4 \ln \left ({\mathrm e}^{i x}-i\right )}{9}-\frac {\sqrt {7}\, \ln \left ({\mathrm e}^{i x}-\frac {i \sqrt {7}}{4}+\frac {3}{4}\right )}{9}+\frac {\sqrt {7}\, \ln \left ({\mathrm e}^{i x}+\frac {i \sqrt {7}}{4}+\frac {3}{4}\right )}{9}\) \(74\)

Input:

int(sec(x)*tan(x)^2/(4+3*sec(x)),x,method=_RETURNVERBOSE)
 

Output:

2/9*7^(1/2)*arctanh(1/7*tan(1/2*x)*7^(1/2))-1/3/(1+tan(1/2*x))-4/9*ln(1+ta 
n(1/2*x))-1/3/(tan(1/2*x)-1)+4/9*ln(tan(1/2*x)-1)
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.11 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=\frac {\sqrt {7} \cos \left (x\right ) \log \left (\frac {2 \, \cos \left (x\right )^{2} + 2 \, {\left (3 \, \sqrt {7} \cos \left (x\right ) + 4 \, \sqrt {7}\right )} \sin \left (x\right ) + 24 \, \cos \left (x\right ) + 23}{16 \, \cos \left (x\right )^{2} + 24 \, \cos \left (x\right ) + 9}\right ) - 4 \, \cos \left (x\right ) \log \left (\sin \left (x\right ) + 1\right ) + 4 \, \cos \left (x\right ) \log \left (-\sin \left (x\right ) + 1\right ) + 6 \, \sin \left (x\right )}{18 \, \cos \left (x\right )} \] Input:

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

Output:

1/18*(sqrt(7)*cos(x)*log((2*cos(x)^2 + 2*(3*sqrt(7)*cos(x) + 4*sqrt(7))*si 
n(x) + 24*cos(x) + 23)/(16*cos(x)^2 + 24*cos(x) + 9)) - 4*cos(x)*log(sin(x 
) + 1) + 4*cos(x)*log(-sin(x) + 1) + 6*sin(x))/cos(x)
 

Sympy [F]

\[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=\int \frac {\tan ^{2}{\left (x \right )} \sec {\left (x \right )}}{3 \sec {\left (x \right )} + 4}\, dx \] Input:

integrate(sec(x)*tan(x)**2/(4+3*sec(x)),x)
 

Output:

Integral(tan(x)**2*sec(x)/(3*sec(x) + 4), x)
 

Maxima [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.23 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=-\frac {1}{9} \, \sqrt {7} \log \left (-\frac {\sqrt {7} - \frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}}{\sqrt {7} + \frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}}\right ) - \frac {2 \, \sin \left (x\right )}{3 \, {\left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (x\right ) + 1\right )}} - \frac {4}{9} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) + \frac {4}{9} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \] Input:

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

Output:

-1/9*sqrt(7)*log(-(sqrt(7) - sin(x)/(cos(x) + 1))/(sqrt(7) + sin(x)/(cos(x 
) + 1))) - 2/3*sin(x)/((sin(x)^2/(cos(x) + 1)^2 - 1)*(cos(x) + 1)) - 4/9*l 
og(sin(x)/(cos(x) + 1) + 1) + 4/9*log(sin(x)/(cos(x) + 1) - 1)
 

Giac [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.97 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=-\frac {1}{9} \, \sqrt {7} \log \left (\frac {{\left | -2 \, \sqrt {7} + 2 \, \tan \left (\frac {1}{2} \, x\right ) \right |}}{{\left | 2 \, \sqrt {7} + 2 \, \tan \left (\frac {1}{2} \, x\right ) \right |}}\right ) - \frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{3 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}} - \frac {4}{9} \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) + \frac {4}{9} \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right ) \] Input:

integrate(sec(x)*tan(x)^2/(4+3*sec(x)),x, algorithm="giac")
 

Output:

-1/9*sqrt(7)*log(abs(-2*sqrt(7) + 2*tan(1/2*x))/abs(2*sqrt(7) + 2*tan(1/2* 
x))) - 2/3*tan(1/2*x)/(tan(1/2*x)^2 - 1) - 4/9*log(abs(tan(1/2*x) + 1)) + 
4/9*log(abs(tan(1/2*x) - 1))
 

Mupad [B] (verification not implemented)

Time = 16.44 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.55 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=\frac {2\,\sqrt {7}\,\mathrm {atanh}\left (\frac {\sqrt {7}\,\mathrm {tan}\left (\frac {x}{2}\right )}{7}\right )}{9}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3\,\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}-\frac {8\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{9} \] Input:

int(tan(x)^2/(cos(x)*(3/cos(x) + 4)),x)
 

Output:

(2*7^(1/2)*atanh((7^(1/2)*tan(x/2))/7))/9 - (2*tan(x/2))/(3*(tan(x/2)^2 - 
1)) - (8*atanh(tan(x/2)))/9
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.66 \[ \int \frac {\sec (x) \tan ^2(x)}{4+3 \sec (x)} \, dx=-\frac {\sqrt {7}\, \mathrm {log}\left (-\sqrt {7}+\tan \left (\frac {x}{2}\right )\right )}{9}+\frac {\sqrt {7}\, \mathrm {log}\left (\sqrt {7}+\tan \left (\frac {x}{2}\right )\right )}{9}+\frac {4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )-1\right )}{9}-\frac {4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )+1\right )}{9}+\frac {\tan \left (x \right )}{3} \] Input:

int(sec(x)*tan(x)^2/(4+3*sec(x)),x)
 

Output:

( - sqrt(7)*log( - sqrt(7) + tan(x/2)) + sqrt(7)*log(sqrt(7) + tan(x/2)) + 
 4*log(tan(x/2) - 1) - 4*log(tan(x/2) + 1) + 3*tan(x))/9