\(\int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx\) [1269]

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

Optimal result

Integrand size = 27, antiderivative size = 150 \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=-\frac {2 \left (a^2+a b-b^2\right ) \arctan \left (\frac {a^2+a b-b^2-2 \left (a^2+a b-b^2\right ) \tan (e+f x)}{\left (a^2+a b-b^2\right ) \sqrt {3+4 \tan (e+f x)}}\right )}{5 f}+\frac {\left (a^2-4 a b-b^2\right ) \text {arctanh}\left (\frac {2+\tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}}\right )}{5 f}+\frac {b^2 \sqrt {3+4 \tan (e+f x)}}{2 f} \] Output:

-2/5*(a^2+a*b-b^2)*arctan((a^2+a*b-b^2-2*(a^2+a*b-b^2)*tan(f*x+e))/(a^2+a* 
b-b^2)/(3+4*tan(f*x+e))^(1/2))/f+1/5*(a^2-4*a*b-b^2)*arctanh((2+tan(f*x+e) 
)/(3+4*tan(f*x+e))^(1/2))/f+1/2*b^2*(3+4*tan(f*x+e))^(1/2)/f
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.07 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.66 \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {(4-2 i) (a+i b)^2 \arctan \left (\left (\frac {1}{5}+\frac {2 i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )+(2-4 i) (a-i b)^2 \text {arctanh}\left (\left (\frac {2}{5}+\frac {i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )+5 b^2 \sqrt {3+4 \tan (e+f x)}}{10 f} \] Input:

Integrate[(a + b*Tan[e + f*x])^2/Sqrt[3 + 4*Tan[e + f*x]],x]
 

Output:

((4 - 2*I)*(a + I*b)^2*ArcTan[(1/5 + (2*I)/5)*Sqrt[3 + 4*Tan[e + f*x]]] + 
(2 - 4*I)*(a - I*b)^2*ArcTanh[(2/5 + I/5)*Sqrt[3 + 4*Tan[e + f*x]]] + 5*b^ 
2*Sqrt[3 + 4*Tan[e + f*x]])/(10*f)
 

Rubi [A] (verified)

Time = 0.67 (sec) , antiderivative size = 193, normalized size of antiderivative = 1.29, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4026, 3042, 4019, 27, 3042, 4018, 216, 220}

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 {(a+b \tan (e+f x))^2}{\sqrt {4 \tan (e+f x)+3}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \tan (e+f x))^2}{\sqrt {4 \tan (e+f x)+3}}dx\)

\(\Big \downarrow \) 4026

\(\displaystyle \int \frac {a^2+2 b \tan (e+f x) a-b^2}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a^2+2 b \tan (e+f x) a-b^2}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 4019

\(\displaystyle -\frac {1}{10} \int -\frac {2 \left (a^2-4 b a-b^2-2 \left (a^2-4 b a-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {1}{10} \int \frac {4 \left (\tan (e+f x) \left (a^2+b a-b^2\right )+2 \left (a^2+b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{5} \int \frac {a^2-4 b a-b^2-2 \left (a^2-4 b a-b^2\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {2}{5} \int \frac {\tan (e+f x) \left (a^2+b a-b^2\right )+2 \left (a^2+b a-b^2\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \int \frac {a^2-4 b a-b^2-2 \left (a^2-4 b a-b^2\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {2}{5} \int \frac {\tan (e+f x) \left (a^2+b a-b^2\right )+2 \left (a^2+b a-b^2\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 4018

\(\displaystyle -\frac {8 \left (a^2-4 a b-b^2\right )^2 \int \frac {1}{\frac {64 \left (\tan (e+f x) \left (a^2-4 b a-b^2\right )+2 \left (a^2-4 b a-b^2\right )\right )^2}{4 \tan (e+f x)+3}-64 \left (a^2-4 b a-b^2\right )^2}d\frac {8 \left (\tan (e+f x) \left (a^2-4 b a-b^2\right )+2 \left (a^2-4 b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}-\frac {4 \left (a^2+a b-b^2\right )^2 \int \frac {1}{4 \left (a^2+b a-b^2\right )^2+\frac {4 \left (a^2+b a-b^2-2 \left (a^2+b a-b^2\right ) \tan (e+f x)\right )^2}{4 \tan (e+f x)+3}}d\frac {2 \left (a^2+b a-b^2-2 \left (a^2+b a-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 216

\(\displaystyle -\frac {8 \left (a^2-4 a b-b^2\right )^2 \int \frac {1}{\frac {64 \left (\tan (e+f x) \left (a^2-4 b a-b^2\right )+2 \left (a^2-4 b a-b^2\right )\right )^2}{4 \tan (e+f x)+3}-64 \left (a^2-4 b a-b^2\right )^2}d\frac {8 \left (\tan (e+f x) \left (a^2-4 b a-b^2\right )+2 \left (a^2-4 b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}-\frac {2 \left (a^2+a b-b^2\right ) \arctan \left (\frac {-2 \left (a^2+a b-b^2\right ) \tan (e+f x)+a^2+a b-b^2}{\left (a^2+a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

\(\Big \downarrow \) 220

\(\displaystyle -\frac {2 \left (a^2+a b-b^2\right ) \arctan \left (\frac {-2 \left (a^2+a b-b^2\right ) \tan (e+f x)+a^2+a b-b^2}{\left (a^2+a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}+\frac {\left (a^2-4 a b-b^2\right ) \text {arctanh}\left (\frac {\left (a^2-4 a b-b^2\right ) \tan (e+f x)+2 \left (a^2-4 a b-b^2\right )}{\left (a^2-4 a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{2 f}\)

Input:

Int[(a + b*Tan[e + f*x])^2/Sqrt[3 + 4*Tan[e + f*x]],x]
 

Output:

(-2*(a^2 + a*b - b^2)*ArcTan[(a^2 + a*b - b^2 - 2*(a^2 + a*b - b^2)*Tan[e 
+ f*x])/((a^2 + a*b - b^2)*Sqrt[3 + 4*Tan[e + f*x]])])/(5*f) + ((a^2 - 4*a 
*b - b^2)*ArcTanh[(2*(a^2 - 4*a*b - b^2) + (a^2 - 4*a*b - b^2)*Tan[e + f*x 
])/((a^2 - 4*a*b - b^2)*Sqrt[3 + 4*Tan[e + f*x]])])/(5*f) + (b^2*Sqrt[3 + 
4*Tan[e + f*x]])/(2*f)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

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

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

rule 4018
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + ( 
f_.)*(x_)]], x_Symbol] :> Simp[-2*(d^2/f)   Subst[Int[1/(2*b*c*d - 4*a*d^2 
+ x^2), x], x, (b*c - 2*a*d - b*d*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]]], 
x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0 
] && NeQ[c^2 + d^2, 0] && EqQ[2*a*c*d - b*(c^2 - d^2), 0]
 

rule 4019
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + ( 
f_.)*(x_)]], x_Symbol] :> With[{q = Rt[a^2 + b^2, 2]}, Simp[1/(2*q)   Int[( 
a*c + b*d + c*q + (b*c - a*d + d*q)*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]], 
 x], x] - Simp[1/(2*q)   Int[(a*c + b*d - c*q + (b*c - a*d - d*q)*Tan[e + f 
*x])/Sqrt[a + b*Tan[e + f*x]], x], x]] /; FreeQ[{a, b, c, d, e, f}, x] && N 
eQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && NeQ[2*a*c*d - 
 b*(c^2 - d^2), 0] && NiceSqrtQ[a^2 + b^2]
 

rule 4026
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^2, x_Symbol] :> Simp[d^2*((a + b*Tan[e + f*x])^(m + 1)/(b*f*( 
m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e + f* 
x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ 
[m, -1] &&  !(EqQ[m, 2] && EqQ[a, 0])
 
Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {\frac {\sqrt {3+4 \tan \left (f x +e \right )}\, b^{2}}{2}+\frac {\left (-2 a^{2}+8 a b +2 b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{20}+\frac {\left (4 a^{2}+4 a b -4 b^{2}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a^{2}-8 a b -2 b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{20}+\frac {\left (4 a^{2}+4 a b -4 b^{2}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}}{f}\) \(171\)
default \(\frac {\frac {\sqrt {3+4 \tan \left (f x +e \right )}\, b^{2}}{2}+\frac {\left (-2 a^{2}+8 a b +2 b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{20}+\frac {\left (4 a^{2}+4 a b -4 b^{2}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a^{2}-8 a b -2 b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{20}+\frac {\left (4 a^{2}+4 a b -4 b^{2}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}}{f}\) \(171\)
parts \(\frac {a^{2} \left (-\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {b^{2} \left (\frac {\sqrt {3+4 \tan \left (f x +e \right )}}{2}+\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}-\frac {2 \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}-\frac {2 \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {2 a b \left (\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}\) \(304\)

Input:

int((a+b*tan(f*x+e))^2/(3+4*tan(f*x+e))^(1/2),x,method=_RETURNVERBOSE)
 

Output:

1/f*(1/2*(3+4*tan(f*x+e))^(1/2)*b^2+1/20*(-2*a^2+8*a*b+2*b^2)*ln(8+4*tan(f 
*x+e)-4*(3+4*tan(f*x+e))^(1/2))+1/10*(4*a^2+4*a*b-4*b^2)*arctan(-2+(3+4*ta 
n(f*x+e))^(1/2))+1/20*(2*a^2-8*a*b-2*b^2)*ln(8+4*tan(f*x+e)+4*(3+4*tan(f*x 
+e))^(1/2))+1/10*(4*a^2+4*a*b-4*b^2)*arctan(2+(3+4*tan(f*x+e))^(1/2)))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.03 \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {5 \, b^{2} \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, {\left (a^{2} + a b - b^{2}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 4 \, {\left (a^{2} + a b - b^{2}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + {\left (a^{2} - 4 \, a b - b^{2}\right )} \log \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + \tan \left (f x + e\right ) + 2\right ) - {\left (a^{2} - 4 \, a b - b^{2}\right )} \log \left (-\sqrt {4 \, \tan \left (f x + e\right ) + 3} + \tan \left (f x + e\right ) + 2\right )}{10 \, f} \] Input:

integrate((a+b*tan(f*x+e))^2/(3+4*tan(f*x+e))^(1/2),x, algorithm="fricas")
 

Output:

1/10*(5*b^2*sqrt(4*tan(f*x + e) + 3) + 4*(a^2 + a*b - b^2)*arctan(sqrt(4*t 
an(f*x + e) + 3) + 2) + 4*(a^2 + a*b - b^2)*arctan(sqrt(4*tan(f*x + e) + 3 
) - 2) + (a^2 - 4*a*b - b^2)*log(sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 
 2) - (a^2 - 4*a*b - b^2)*log(-sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 2 
))/f
 

Sympy [F]

\[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\int \frac {\left (a + b \tan {\left (e + f x \right )}\right )^{2}}{\sqrt {4 \tan {\left (e + f x \right )} + 3}}\, dx \] Input:

integrate((a+b*tan(f*x+e))**2/(3+4*tan(f*x+e))**(1/2),x)
 

Output:

Integral((a + b*tan(e + f*x))**2/sqrt(4*tan(e + f*x) + 3), x)
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.07 \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {5 \, b^{2} \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, {\left (a^{2} + a b - b^{2}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 4 \, {\left (a^{2} + a b - b^{2}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + {\left (a^{2} - 4 \, a b - b^{2}\right )} \log \left (4 \, \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, \tan \left (f x + e\right ) + 8\right ) - {\left (a^{2} - 4 \, a b - b^{2}\right )} \log \left (-4 \, \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, \tan \left (f x + e\right ) + 8\right )}{10 \, f} \] Input:

integrate((a+b*tan(f*x+e))^2/(3+4*tan(f*x+e))^(1/2),x, algorithm="maxima")
 

Output:

1/10*(5*b^2*sqrt(4*tan(f*x + e) + 3) + 4*(a^2 + a*b - b^2)*arctan(sqrt(4*t 
an(f*x + e) + 3) + 2) + 4*(a^2 + a*b - b^2)*arctan(sqrt(4*tan(f*x + e) + 3 
) - 2) + (a^2 - 4*a*b - b^2)*log(4*sqrt(4*tan(f*x + e) + 3) + 4*tan(f*x + 
e) + 8) - (a^2 - 4*a*b - b^2)*log(-4*sqrt(4*tan(f*x + e) + 3) + 4*tan(f*x 
+ e) + 8))/f
 

Giac [F(-2)]

Exception generated. \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\text {Exception raised: TypeError} \] Input:

integrate((a+b*tan(f*x+e))^2/(3+4*tan(f*x+e))^(1/2),x, algorithm="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
 

Mupad [B] (verification not implemented)

Time = 3.70 (sec) , antiderivative size = 1363, normalized size of antiderivative = 9.09 \[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\text {Too large to display} \] Input:

int((a + b*tan(e + f*x))^2/(4*tan(e + f*x) + 3)^(1/2),x)
 

Output:

(b^2*(4*tan(e + f*x) + 3)^(1/2))/(2*f) - (atan(((((256*(4*tan(e + f*x) + 3 
)^(1/2)*(a^4 + b^4 - 6*a^2*b^2))/f^2 - (((256*(8*b^2*f^2 - 8*a^2*f^2 + 12* 
a*b*f^2))/f^3 - (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b*(4 + 2i) - a^2*(1 - 
2i) + b^2*(1 - 2i)))/(5*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)))/ 
(10*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i))*1i)/(10*f) + (((256*( 
4*tan(e + f*x) + 3)^(1/2)*(a^4 + b^4 - 6*a^2*b^2))/f^2 + (((256*(8*b^2*f^2 
 - 8*a^2*f^2 + 12*a*b*f^2))/f^3 + (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b*(4 
 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)))/(5*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) 
 + b^2*(1 - 2i)))/(10*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i))*1i) 
/(10*f))/((512*(a*b^5 + a^5*b + 2*a^3*b^3))/f^3 + (((256*(4*tan(e + f*x) + 
 3)^(1/2)*(a^4 + b^4 - 6*a^2*b^2))/f^2 - (((256*(8*b^2*f^2 - 8*a^2*f^2 + 1 
2*a*b*f^2))/f^3 - (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b*(4 + 2i) - a^2*(1 
- 2i) + b^2*(1 - 2i)))/(5*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)) 
)/(10*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)))/(10*f) - (((256*(4 
*tan(e + f*x) + 3)^(1/2)*(a^4 + b^4 - 6*a^2*b^2))/f^2 + (((256*(8*b^2*f^2 
- 8*a^2*f^2 + 12*a*b*f^2))/f^3 + (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b*(4 
+ 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)))/(5*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) 
+ b^2*(1 - 2i)))/(10*f))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i)))/(10 
*f)))*(a*b*(4 + 2i) - a^2*(1 - 2i) + b^2*(1 - 2i))*1i)/(5*f) - (atan(((((2 
56*(4*tan(e + f*x) + 3)^(1/2)*(a^4 + b^4 - 6*a^2*b^2))/f^2 - (((256*(8*...
 

Reduce [F]

\[ \int \frac {(a+b \tan (e+f x))^2}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {\sqrt {4 \tan \left (f x +e \right )+3}\, a^{2}-2 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{2}}{4 \tan \left (f x +e \right )+3}d x \right ) a^{2} f +2 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{2}}{4 \tan \left (f x +e \right )+3}d x \right ) b^{2} f +4 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )}{4 \tan \left (f x +e \right )+3}d x \right ) a b f}{2 f} \] Input:

int((a+b*tan(f*x+e))^2/(3+4*tan(f*x+e))^(1/2),x)
 

Output:

(sqrt(4*tan(e + f*x) + 3)*a**2 - 2*int((sqrt(4*tan(e + f*x) + 3)*tan(e + f 
*x)**2)/(4*tan(e + f*x) + 3),x)*a**2*f + 2*int((sqrt(4*tan(e + f*x) + 3)*t 
an(e + f*x)**2)/(4*tan(e + f*x) + 3),x)*b**2*f + 4*int((sqrt(4*tan(e + f*x 
) + 3)*tan(e + f*x))/(4*tan(e + f*x) + 3),x)*a*b*f)/(2*f)