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

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 = 25, antiderivative size = 90 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}} \, dx=-\frac {(2 a+b) \arctan \left (\frac {2 a+b-2 (2 a+b) \tan (e+f x)}{(2 a+b) \sqrt {3+4 \tan (e+f x)}}\right )}{5 f}+\frac {(a-2 b) \text {arctanh}\left (\frac {2+\tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}}\right )}{5 f} \] Output:

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

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

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

Output:

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

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.21, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {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)}{\sqrt {4 \tan (e+f x)+3}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4019

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4018

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 220

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

Input:

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

Output:

-1/5*((2*a + b)*ArcTan[(2*a + b - 2*(2*a + b)*Tan[e + f*x])/((2*a + b)*Sqr 
t[3 + 4*Tan[e + f*x]])])/f + ((a - 2*b)*ArcTanh[(2*(a - 2*b) + (a - 2*b)*T 
an[e + f*x])/((a - 2*b)*Sqrt[3 + 4*Tan[e + f*x]])])/(5*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]
 
Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.29

method result size
derivativedivides \(\frac {\frac {\left (-a +2 b \right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a +b \right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\left (a -2 b \right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a +b \right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}}{f}\) \(116\)
default \(\frac {\frac {\left (-a +2 b \right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a +b \right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\left (a -2 b \right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {\left (2 a +b \right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}}{f}\) \(116\)
parts \(\frac {a \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 \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}\) \(190\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.19 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {2 \, {\left (2 \, a + b\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 2 \, {\left (2 \, a + b\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + {\left (a - 2 \, b\right )} \log \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + \tan \left (f x + e\right ) + 2\right ) - {\left (a - 2 \, b\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))/(3+4*tan(f*x+e))^(1/2),x, algorithm="fricas")
 

Output:

1/10*(2*(2*a + b)*arctan(sqrt(4*tan(f*x + e) + 3) + 2) + 2*(2*a + b)*arcta 
n(sqrt(4*tan(f*x + e) + 3) - 2) + (a - 2*b)*log(sqrt(4*tan(f*x + e) + 3) + 
 tan(f*x + e) + 2) - (a - 2*b)*log(-sqrt(4*tan(f*x + e) + 3) + tan(f*x + e 
) + 2))/f
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.26 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {2 \, {\left (2 \, a + b\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 2 \, {\left (2 \, a + b\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + {\left (a - 2 \, b\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 \, b\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))/(3+4*tan(f*x+e))^(1/2),x, algorithm="maxima")
 

Output:

1/10*(2*(2*a + b)*arctan(sqrt(4*tan(f*x + e) + 3) + 2) + 2*(2*a + b)*arcta 
n(sqrt(4*tan(f*x + e) + 3) - 2) + (a - 2*b)*log(4*sqrt(4*tan(f*x + e) + 3) 
 + 4*tan(f*x + e) + 8) - (a - 2*b)*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)}{\sqrt {3+4 \tan (e+f x)}} \, dx=\text {Exception raised: TypeError} \] Input:

integrate((a+b*tan(f*x+e))/(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 = 0.86 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.12 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {a\,\mathrm {atan}\left (\sqrt {4\,\mathrm {tan}\left (e+f\,x\right )+3}\,\left (\frac {1}{5}-\frac {2}{5}{}\mathrm {i}\right )\right )\,\left (\frac {2}{5}+\frac {1}{5}{}\mathrm {i}\right )}{f}+\frac {a\,\mathrm {atan}\left (\sqrt {4\,\mathrm {tan}\left (e+f\,x\right )+3}\,\left (\frac {1}{5}+\frac {2}{5}{}\mathrm {i}\right )\right )\,\left (\frac {2}{5}-\frac {1}{5}{}\mathrm {i}\right )}{f}+\frac {b\,\mathrm {atan}\left (\sqrt {4\,\mathrm {tan}\left (e+f\,x\right )+3}\,\left (\frac {1}{5}-\frac {2}{5}{}\mathrm {i}\right )\right )\,\left (\frac {1}{5}-\frac {2}{5}{}\mathrm {i}\right )}{f}+\frac {b\,\mathrm {atan}\left (\sqrt {4\,\mathrm {tan}\left (e+f\,x\right )+3}\,\left (\frac {1}{5}+\frac {2}{5}{}\mathrm {i}\right )\right )\,\left (\frac {1}{5}+\frac {2}{5}{}\mathrm {i}\right )}{f} \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {a+b \tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {\sqrt {4 \tan \left (f x +e \right )+3}\, a -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 f +2 \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 ) b f}{2 f} \] Input:

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

Output:

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