\(\int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx\) [494]

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

Optimal result

Integrand size = 25, antiderivative size = 81 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=-\frac {(31+6 x) \sqrt {2+3 x+x^2}}{9 (4+3 x)}+\frac {31 \arctan \left (\frac {\sqrt {2} (1+x)}{\sqrt {2+3 x+x^2}}\right )}{27 \sqrt {2}}+\frac {44}{27} \text {arctanh}\left (\frac {1+x}{\sqrt {2+3 x+x^2}}\right ) \] Output:

-1/9*(31+6*x)*(x^2+3*x+2)^(1/2)/(4+3*x)+31/54*2^(1/2)*arctan(2^(1/2)*(1+x) 
/(x^2+3*x+2)^(1/2))+44/27*arctanh((1+x)/(x^2+3*x+2)^(1/2))
 

Mathematica [A] (verified)

Time = 0.33 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.05 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=\frac {(-31-6 x) \sqrt {2+3 x+x^2}}{9 (4+3 x)}-\frac {31 \arctan \left (\frac {\sqrt {2+3 x+x^2}}{\sqrt {2} (1+x)}\right )}{27 \sqrt {2}}+\frac {44}{27} \text {arctanh}\left (\frac {\sqrt {2+3 x+x^2}}{1+x}\right ) \] Input:

Integrate[((5 - 2*x)*Sqrt[2 + 3*x + x^2])/(4 + 3*x)^2,x]
 

Output:

((-31 - 6*x)*Sqrt[2 + 3*x + x^2])/(9*(4 + 3*x)) - (31*ArcTan[Sqrt[2 + 3*x 
+ x^2]/(Sqrt[2]*(1 + x))])/(27*Sqrt[2]) + (44*ArcTanh[Sqrt[2 + 3*x + x^2]/ 
(1 + x)])/27
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.14, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {1230, 25, 1269, 1092, 219, 1154, 217}

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 {(5-2 x) \sqrt {x^2+3 x+2}}{(3 x+4)^2} \, dx\)

\(\Big \downarrow \) 1230

\(\displaystyle -\frac {1}{18} \int -\frac {44 x+69}{(3 x+4) \sqrt {x^2+3 x+2}}dx-\frac {\sqrt {x^2+3 x+2} (6 x+31)}{9 (3 x+4)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{18} \int \frac {44 x+69}{(3 x+4) \sqrt {x^2+3 x+2}}dx-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

\(\Big \downarrow \) 1269

\(\displaystyle \frac {1}{18} \left (\frac {44}{3} \int \frac {1}{\sqrt {x^2+3 x+2}}dx+\frac {31}{3} \int \frac {1}{(3 x+4) \sqrt {x^2+3 x+2}}dx\right )-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

\(\Big \downarrow \) 1092

\(\displaystyle \frac {1}{18} \left (\frac {31}{3} \int \frac {1}{(3 x+4) \sqrt {x^2+3 x+2}}dx+\frac {88}{3} \int \frac {1}{4-\frac {(2 x+3)^2}{x^2+3 x+2}}d\frac {2 x+3}{\sqrt {x^2+3 x+2}}\right )-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {1}{18} \left (\frac {31}{3} \int \frac {1}{(3 x+4) \sqrt {x^2+3 x+2}}dx+\frac {44}{3} \text {arctanh}\left (\frac {2 x+3}{2 \sqrt {x^2+3 x+2}}\right )\right )-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

\(\Big \downarrow \) 1154

\(\displaystyle \frac {1}{18} \left (\frac {44}{3} \text {arctanh}\left (\frac {2 x+3}{2 \sqrt {x^2+3 x+2}}\right )-\frac {62}{3} \int \frac {1}{-\frac {x^2}{x^2+3 x+2}-8}d\frac {x}{\sqrt {x^2+3 x+2}}\right )-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

\(\Big \downarrow \) 217

\(\displaystyle \frac {1}{18} \left (\frac {31 \arctan \left (\frac {x}{2 \sqrt {2} \sqrt {x^2+3 x+2}}\right )}{3 \sqrt {2}}+\frac {44}{3} \text {arctanh}\left (\frac {2 x+3}{2 \sqrt {x^2+3 x+2}}\right )\right )-\frac {(6 x+31) \sqrt {x^2+3 x+2}}{9 (3 x+4)}\)

Input:

Int[((5 - 2*x)*Sqrt[2 + 3*x + x^2])/(4 + 3*x)^2,x]
 

Output:

-1/9*((31 + 6*x)*Sqrt[2 + 3*x + x^2])/(4 + 3*x) + ((31*ArcTan[x/(2*Sqrt[2] 
*Sqrt[2 + 3*x + x^2])])/(3*Sqrt[2]) + (44*ArcTanh[(3 + 2*x)/(2*Sqrt[2 + 3* 
x + x^2])])/3)/18
 

Defintions of rubi rules used

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

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

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 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 1154
Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Sym 
bol] :> Simp[-2   Subst[Int[1/(4*c*d^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, ( 
2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c 
, d, e}, x]
 

rule 1230
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(d + e*x)^(m + 1)*(e*f*(m + 2*p + 2) - 
 d*g*(2*p + 1) + e*g*(m + 1)*x)*((a + b*x + c*x^2)^p/(e^2*(m + 1)*(m + 2*p 
+ 2))), x] + Simp[p/(e^2*(m + 1)*(m + 2*p + 2))   Int[(d + e*x)^(m + 1)*(a 
+ b*x + c*x^2)^(p - 1)*Simp[g*(b*d + 2*a*e + 2*a*e*m + 2*b*d*p) - f*b*e*(m 
+ 2*p + 2) + (g*(2*c*d + b*e + b*e*m + 4*c*d*p) - 2*c*e*f*(m + 2*p + 2))*x, 
 x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && GtQ[p, 0] && (LtQ[m, - 
1] || EqQ[p, 1] || (IntegerQ[p] &&  !RationalQ[m])) && NeQ[m, -1] &&  !ILtQ 
[m + 2*p + 1, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
 

rule 1269
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g/e   Int[(d + e*x)^(m + 1)*(a + b*x + 
 c*x^2)^p, x], x] + Simp[(e*f - d*g)/e   Int[(d + e*x)^m*(a + b*x + c*x^2)^ 
p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] &&  !IGtQ[m, 0]
 
Maple [A] (verified)

Time = 1.71 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.96

method result size
risch \(-\frac {6 x^{3}+49 x^{2}+105 x +62}{9 \left (3 x +4\right ) \sqrt {x^{2}+3 x +2}}+\frac {22 \ln \left (x +\frac {3}{2}+\sqrt {x^{2}+3 x +2}\right )}{27}+\frac {31 \sqrt {2}\, \arctan \left (\frac {3 x \sqrt {2}}{4 \sqrt {9 \left (x +\frac {4}{3}\right )^{2}+3 x +2}}\right )}{108}\) \(78\)
trager \(-\frac {\left (31+6 x \right ) \sqrt {x^{2}+3 x +2}}{9 \left (3 x +4\right )}+\frac {31 \operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) \ln \left (\frac {2 \operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) \sqrt {x^{2}+3 x +2}+x}{3 x +4}\right )}{108}+\frac {22 \ln \left (3+2 x +2 \sqrt {x^{2}+3 x +2}\right )}{27}\) \(83\)
default \(\frac {23 \left (\left (x +\frac {4}{3}\right )^{2}+\frac {x}{3}+\frac {2}{9}\right )^{\frac {3}{2}}}{6 \left (x +\frac {4}{3}\right )}-\frac {31 \sqrt {9 \left (x +\frac {4}{3}\right )^{2}+3 x +2}}{108}+\frac {22 \ln \left (\frac {3}{2}+x +\sqrt {\left (x +\frac {4}{3}\right )^{2}+\frac {x}{3}+\frac {2}{9}}\right )}{27}+\frac {31 \sqrt {2}\, \arctan \left (\frac {3 x \sqrt {2}}{4 \sqrt {9 \left (x +\frac {4}{3}\right )^{2}+3 x +2}}\right )}{108}-\frac {23 \left (2 x +3\right ) \sqrt {\left (x +\frac {4}{3}\right )^{2}+\frac {x}{3}+\frac {2}{9}}}{12}\) \(100\)

Input:

int((5-2*x)*(x^2+3*x+2)^(1/2)/(3*x+4)^2,x,method=_RETURNVERBOSE)
 

Output:

-1/9*(6*x^3+49*x^2+105*x+62)/(3*x+4)/(x^2+3*x+2)^(1/2)+22/27*ln(x+3/2+(x^2 
+3*x+2)^(1/2))+31/108*2^(1/2)*arctan(3/4*x*2^(1/2)/(9*(x+4/3)^2+3*x+2)^(1/ 
2))
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.15 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=\frac {31 \, \sqrt {2} {\left (3 \, x + 4\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (3 \, x + 4\right )} + \frac {3}{2} \, \sqrt {2} \sqrt {x^{2} + 3 \, x + 2}\right ) - 44 \, {\left (3 \, x + 4\right )} \log \left (-2 \, x + 2 \, \sqrt {x^{2} + 3 \, x + 2} - 3\right ) - 6 \, \sqrt {x^{2} + 3 \, x + 2} {\left (6 \, x + 31\right )} - 165 \, x - 220}{54 \, {\left (3 \, x + 4\right )}} \] Input:

integrate((5-2*x)*(x^2+3*x+2)^(1/2)/(4+3*x)^2,x, algorithm="fricas")
 

Output:

1/54*(31*sqrt(2)*(3*x + 4)*arctan(-1/2*sqrt(2)*(3*x + 4) + 3/2*sqrt(2)*sqr 
t(x^2 + 3*x + 2)) - 44*(3*x + 4)*log(-2*x + 2*sqrt(x^2 + 3*x + 2) - 3) - 6 
*sqrt(x^2 + 3*x + 2)*(6*x + 31) - 165*x - 220)/(3*x + 4)
 

Sympy [F]

\[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=- \int \left (- \frac {5 \sqrt {x^{2} + 3 x + 2}}{9 x^{2} + 24 x + 16}\right )\, dx - \int \frac {2 x \sqrt {x^{2} + 3 x + 2}}{9 x^{2} + 24 x + 16}\, dx \] Input:

integrate((5-2*x)*(x**2+3*x+2)**(1/2)/(4+3*x)**2,x)
 

Output:

-Integral(-5*sqrt(x**2 + 3*x + 2)/(9*x**2 + 24*x + 16), x) - Integral(2*x* 
sqrt(x**2 + 3*x + 2)/(9*x**2 + 24*x + 16), x)
 

Maxima [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.84 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=\frac {31}{108} \, \sqrt {2} \arcsin \left (\frac {x}{{\left | 3 \, x + 4 \right |}}\right ) - \frac {2}{9} \, \sqrt {x^{2} + 3 \, x + 2} - \frac {23 \, \sqrt {x^{2} + 3 \, x + 2}}{9 \, {\left (3 \, x + 4\right )}} + \frac {22}{27} \, \log \left (\frac {2}{3} \, x + \frac {2}{3} \, \sqrt {x^{2} + 3 \, x + 2} + 1\right ) \] Input:

integrate((5-2*x)*(x^2+3*x+2)^(1/2)/(4+3*x)^2,x, algorithm="maxima")
 

Output:

31/108*sqrt(2)*arcsin(x/abs(3*x + 4)) - 2/9*sqrt(x^2 + 3*x + 2) - 23/9*sqr 
t(x^2 + 3*x + 2)/(3*x + 4) + 22/27*log(2/3*x + 2/3*sqrt(x^2 + 3*x + 2) + 1 
)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 327 vs. \(2 (65) = 130\).

Time = 0.42 (sec) , antiderivative size = 327, normalized size of antiderivative = 4.04 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=\frac {31}{108} \, \sqrt {2} \arcsin \left (-\frac {4}{3 \, {\left (3 \, x + 4\right )}} + \frac {1}{3}\right ) \mathrm {sgn}\left (\frac {1}{3 \, x + 4}\right ) - \frac {22}{27} \, \log \left (\frac {{\left | -4 \, \sqrt {2} - \frac {2 \, {\left (2 \, \sqrt {2} \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} - 3\right )}}{\frac {4}{3 \, x + 4} - 1} + 6 \right |}}{{\left | 4 \, \sqrt {2} - \frac {2 \, {\left (2 \, \sqrt {2} \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} - 3\right )}}{\frac {4}{3 \, x + 4} - 1} + 6 \right |}}\right ) \mathrm {sgn}\left (\frac {1}{3 \, x + 4}\right ) - \frac {23}{27} \, \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} \mathrm {sgn}\left (\frac {1}{3 \, x + 4}\right ) - \frac {4 \, {\left (\sqrt {2} \mathrm {sgn}\left (\frac {1}{3 \, x + 4}\right ) - \frac {3 \, \sqrt {2} {\left (2 \, \sqrt {2} \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} - 3\right )} \mathrm {sgn}\left (\frac {1}{3 \, x + 4}\right )}{\frac {4}{3 \, x + 4} - 1}\right )}}{9 \, {\left (\frac {{\left (2 \, \sqrt {2} \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} - 3\right )}^{2}}{{\left (\frac {4}{3 \, x + 4} - 1\right )}^{2}} - \frac {6 \, {\left (2 \, \sqrt {2} \sqrt {\frac {1}{3 \, x + 4} - \frac {2}{{\left (3 \, x + 4\right )}^{2}} + 1} - 3\right )}}{\frac {4}{3 \, x + 4} - 1} + 1\right )}} \] Input:

integrate((5-2*x)*(x^2+3*x+2)^(1/2)/(4+3*x)^2,x, algorithm="giac")
 

Output:

31/108*sqrt(2)*arcsin(-4/3/(3*x + 4) + 1/3)*sgn(1/(3*x + 4)) - 22/27*log(a 
bs(-4*sqrt(2) - 2*(2*sqrt(2)*sqrt(1/(3*x + 4) - 2/(3*x + 4)^2 + 1) - 3)/(4 
/(3*x + 4) - 1) + 6)/abs(4*sqrt(2) - 2*(2*sqrt(2)*sqrt(1/(3*x + 4) - 2/(3* 
x + 4)^2 + 1) - 3)/(4/(3*x + 4) - 1) + 6))*sgn(1/(3*x + 4)) - 23/27*sqrt(1 
/(3*x + 4) - 2/(3*x + 4)^2 + 1)*sgn(1/(3*x + 4)) - 4/9*(sqrt(2)*sgn(1/(3*x 
 + 4)) - 3*sqrt(2)*(2*sqrt(2)*sqrt(1/(3*x + 4) - 2/(3*x + 4)^2 + 1) - 3)*s 
gn(1/(3*x + 4))/(4/(3*x + 4) - 1))/((2*sqrt(2)*sqrt(1/(3*x + 4) - 2/(3*x + 
 4)^2 + 1) - 3)^2/(4/(3*x + 4) - 1)^2 - 6*(2*sqrt(2)*sqrt(1/(3*x + 4) - 2/ 
(3*x + 4)^2 + 1) - 3)/(4/(3*x + 4) - 1) + 1)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=-\int \frac {\left (2\,x-5\right )\,\sqrt {x^2+3\,x+2}}{{\left (3\,x+4\right )}^2} \,d x \] Input:

int(-((2*x - 5)*(3*x + x^2 + 2)^(1/2))/(3*x + 4)^2,x)
                                                                                    
                                                                                    
 

Output:

-int(((2*x - 5)*(3*x + x^2 + 2)^(1/2))/(3*x + 4)^2, x)
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.53 \[ \int \frac {(5-2 x) \sqrt {2+3 x+x^2}}{(4+3 x)^2} \, dx=\frac {93 \sqrt {2}\, \mathit {atan} \left (\frac {3 \sqrt {x^{2}+3 x +2}+3 x +4}{\sqrt {2}}\right ) x +124 \sqrt {2}\, \mathit {atan} \left (\frac {3 \sqrt {x^{2}+3 x +2}+3 x +4}{\sqrt {2}}\right )-36 \sqrt {x^{2}+3 x +2}\, x -186 \sqrt {x^{2}+3 x +2}+132 \,\mathrm {log}\left (2 \sqrt {x^{2}+3 x +2}+2 x +3\right ) x +176 \,\mathrm {log}\left (2 \sqrt {x^{2}+3 x +2}+2 x +3\right )}{162 x +216} \] Input:

int((5-2*x)*(x^2+3*x+2)^(1/2)/(4+3*x)^2,x)
 

Output:

(93*sqrt(2)*atan((3*sqrt(x**2 + 3*x + 2) + 3*x + 4)/sqrt(2))*x + 124*sqrt( 
2)*atan((3*sqrt(x**2 + 3*x + 2) + 3*x + 4)/sqrt(2)) - 36*sqrt(x**2 + 3*x + 
 2)*x - 186*sqrt(x**2 + 3*x + 2) + 132*log(2*sqrt(x**2 + 3*x + 2) + 2*x + 
3)*x + 176*log(2*sqrt(x**2 + 3*x + 2) + 2*x + 3))/(54*(3*x + 4))