\(\int \frac {(a+b \arctan (c x)) (d+e \log (f+g x^2))}{x^3} \, dx\) [1299]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F(-1)]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 24, antiderivative size = 528 \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\frac {b c e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}+\frac {a e g \log (x)}{f}-\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2}{1-i c x}\right )}{f}+\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{2 f}+\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{\left (c \sqrt {-f}+i \sqrt {g}\right ) (1-i c x)}\right )}{2 f}-\frac {a e g \log \left (f+g x^2\right )}{2 f}-\frac {b c \left (d+e \log \left (f+g x^2\right )\right )}{2 x}-\frac {1}{2} b c^2 \arctan (c x) \left (d+e \log \left (f+g x^2\right )\right )-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{2 x^2}+\frac {i b e g \operatorname {PolyLog}(2,-i c x)}{2 f}-\frac {i b e g \operatorname {PolyLog}(2,i c x)}{2 f}+\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{2 f}-\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{4 f}-\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{\left (c \sqrt {-f}+i \sqrt {g}\right ) (1-i c x)}\right )}{4 f} \] Output:

b*c*e*g^(1/2)*arctan(g^(1/2)*x/f^(1/2))/f^(1/2)+a*e*g*ln(x)/f-b*e*(c^2*f-g 
)*arctan(c*x)*ln(2/(1-I*c*x))/f+1/2*b*e*(c^2*f-g)*arctan(c*x)*ln(2*c*((-f) 
^(1/2)-g^(1/2)*x)/(c*(-f)^(1/2)-I*g^(1/2))/(1-I*c*x))/f+1/2*b*e*(c^2*f-g)* 
arctan(c*x)*ln(2*c*((-f)^(1/2)+g^(1/2)*x)/(c*(-f)^(1/2)+I*g^(1/2))/(1-I*c* 
x))/f-1/2*a*e*g*ln(g*x^2+f)/f-1/2*b*c*(d+e*ln(g*x^2+f))/x-1/2*b*c^2*arctan 
(c*x)*(d+e*ln(g*x^2+f))-1/2*(a+b*arctan(c*x))*(d+e*ln(g*x^2+f))/x^2+1/2*I* 
b*e*g*polylog(2,-I*c*x)/f-1/2*I*b*e*g*polylog(2,I*c*x)/f+1/2*I*b*e*(c^2*f- 
g)*polylog(2,1-2/(1-I*c*x))/f-1/4*I*b*e*(c^2*f-g)*polylog(2,1-2*c*((-f)^(1 
/2)-g^(1/2)*x)/(c*(-f)^(1/2)-I*g^(1/2))/(1-I*c*x))/f-1/4*I*b*e*(c^2*f-g)*p 
olylog(2,1-2*c*((-f)^(1/2)+g^(1/2)*x)/(c*(-f)^(1/2)+I*g^(1/2))/(1-I*c*x))/ 
f
 

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(1217\) vs. \(2(528)=1056\).

Time = 4.61 (sec) , antiderivative size = 1217, normalized size of antiderivative = 2.30 \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx =\text {Too large to display} \] Input:

Integrate[((a + b*ArcTan[c*x])*(d + e*Log[f + g*x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(c^2*f - g)] + 2*b*c^2*e*f*x^2*ArcSin[S 
qrt[(c^2*f)/(c^2*f - g)]]*Log[1 + (E^((2*I)*ArcTan[c*x])*(c^2*f + g + 2*Sq 
rt[c^2*f*g]))/(c^2*f - g)] - 2*b*e*g*x^2*ArcSin[Sqrt[(c^2*f)/(c^2*f - g)]] 
*Log[1 + (E^((2*I)*ArcTan[c*x])*(c^2*f + g + 2*Sqrt[c^2*f*g]))/(c^2*f - g) 
] - 2*b*c^2*e*f*x^2*ArcTan[c*x]*Log[1 + (E^((2*I)*ArcTan[c*x])*(c^2*f + g 
+ 2*Sqrt[c^2*f*g]))/(c^2*f - g)] + 2*b*e*g*x^2*ArcTan[c*x]*Log[1 + (E^(...
 

Rubi [A] (verified)

Time = 1.07 (sec) , antiderivative size = 544, normalized size of antiderivative = 1.03, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {5556, 2009}

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 \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx\)

\(\Big \downarrow \) 5556

\(\displaystyle -2 e g \int \left (-\frac {a+b c x}{2 x \left (g x^2+f\right )}-\frac {b \left (c^2 x^2+1\right ) \arctan (c x)}{2 x \left (g x^2+f\right )}\right )dx-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{2 x^2}-\frac {1}{2} b c^2 \arctan (c x) \left (d+e \log \left (f+g x^2\right )\right )-\frac {b c \left (d+e \log \left (f+g x^2\right )\right )}{2 x}\)

\(\Big \downarrow \) 2009

\(\displaystyle -2 e g \left (\frac {a \log \left (f+g x^2\right )}{4 f}-\frac {a \log (x)}{2 f}+\frac {b \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2}{1-i c x}\right )}{2 f g}-\frac {b \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{(1-i c x) \left (c \sqrt {-f}-i \sqrt {g}\right )}\right )}{4 f g}-\frac {b \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{(1-i c x) \left (c \sqrt {-f}+i \sqrt {g}\right )}\right )}{4 f g}-\frac {b c \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{2 \sqrt {f} \sqrt {g}}-\frac {i b \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{4 f g}+\frac {i b \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{8 f g}+\frac {i b \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {g} x+\sqrt {-f}\right )}{\left (\sqrt {-f} c+i \sqrt {g}\right ) (1-i c x)}\right )}{8 f g}-\frac {i b \operatorname {PolyLog}(2,-i c x)}{4 f}+\frac {i b \operatorname {PolyLog}(2,i c x)}{4 f}\right )-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{2 x^2}-\frac {1}{2} b c^2 \arctan (c x) \left (d+e \log \left (f+g x^2\right )\right )-\frac {b c \left (d+e \log \left (f+g x^2\right )\right )}{2 x}\)

Input:

Int[((a + b*ArcTan[c*x])*(d + e*Log[f + g*x^2]))/x^3,x]
 

Output:

-1/2*(b*c*(d + e*Log[f + g*x^2]))/x - (b*c^2*ArcTan[c*x]*(d + e*Log[f + g* 
x^2]))/2 - ((a + b*ArcTan[c*x])*(d + e*Log[f + g*x^2]))/(2*x^2) - 2*e*g*(- 
1/2*(b*c*ArcTan[(Sqrt[g]*x)/Sqrt[f]])/(Sqrt[f]*Sqrt[g]) - (a*Log[x])/(2*f) 
 + (b*(c^2*f - g)*ArcTan[c*x]*Log[2/(1 - I*c*x)])/(2*f*g) - (b*(c^2*f - g) 
*ArcTan[c*x]*Log[(2*c*(Sqrt[-f] - Sqrt[g]*x))/((c*Sqrt[-f] - I*Sqrt[g])*(1 
 - I*c*x))])/(4*f*g) - (b*(c^2*f - g)*ArcTan[c*x]*Log[(2*c*(Sqrt[-f] + Sqr 
t[g]*x))/((c*Sqrt[-f] + I*Sqrt[g])*(1 - I*c*x))])/(4*f*g) + (a*Log[f + g*x 
^2])/(4*f) - ((I/4)*b*PolyLog[2, (-I)*c*x])/f + ((I/4)*b*PolyLog[2, I*c*x] 
)/f - ((I/4)*b*(c^2*f - g)*PolyLog[2, 1 - 2/(1 - I*c*x)])/(f*g) + ((I/8)*b 
*(c^2*f - g)*PolyLog[2, 1 - (2*c*(Sqrt[-f] - Sqrt[g]*x))/((c*Sqrt[-f] - I* 
Sqrt[g])*(1 - I*c*x))])/(f*g) + ((I/8)*b*(c^2*f - g)*PolyLog[2, 1 - (2*c*( 
Sqrt[-f] + Sqrt[g]*x))/((c*Sqrt[-f] + I*Sqrt[g])*(1 - I*c*x))])/(f*g))
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5556
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*( 
e_.))*(x_)^(m_.), x_Symbol] :> With[{u = IntHide[x^m*(a + b*ArcTan[c*x]), x 
]}, Simp[(d + e*Log[f + g*x^2])   u, x] - Simp[2*e*g   Int[ExpandIntegrand[ 
x*(u/(f + g*x^2)), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && Intege 
rQ[m] && NeQ[m, -1]
 
Maple [F]

\[\int \frac {\left (a +b \arctan \left (c x \right )\right ) \left (d +e \ln \left (g \,x^{2}+f \right )\right )}{x^{3}}d x\]

Input:

int((a+b*arctan(c*x))*(d+e*ln(g*x^2+f))/x^3,x)
 

Output:

int((a+b*arctan(c*x))*(d+e*ln(g*x^2+f))/x^3,x)
 

Fricas [F]

\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )}}{x^{3}} \,d x } \] Input:

integrate((a+b*arctan(c*x))*(d+e*log(g*x^2+f))/x^3,x, algorithm="fricas")
 

Output:

integral((b*d*arctan(c*x) + a*d + (b*e*arctan(c*x) + a*e)*log(g*x^2 + f))/ 
x^3, x)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\text {Timed out} \] Input:

integrate((a+b*atan(c*x))*(d+e*ln(g*x**2+f))/x**3,x)
 

Output:

Timed out
 

Maxima [F]

\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )}}{x^{3}} \,d x } \] Input:

integrate((a+b*arctan(c*x))*(d+e*log(g*x^2+f))/x^3,x, algorithm="maxima")
 

Output:

-1/2*((c*arctan(c*x) + 1/x)*c + arctan(c*x)/x^2)*b*d - 1/2*(g*(log(g*x^2 + 
 f)/f - log(x^2)/f) + log(g*x^2 + f)/x^2)*a*e + 1/2*(2*c*g*x^2*arctan(g*x/ 
sqrt(f*g)) + (4*c^2*g*x^2*integrate(1/2*x*arctan(c*x)/(g*x^2 + f), x) + 4* 
g*x^2*integrate(1/2*arctan(c*x)/(g*x^3 + f*x), x) - (c*x + (c^2*x^2 + 1)*a 
rctan(c*x))*log(g*x^2 + f))*sqrt(f*g))*b*e/(sqrt(f*g)*x^2) - 1/2*a*d/x^2
 

Giac [F]

\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )}}{x^{3}} \,d x } \] Input:

integrate((a+b*arctan(c*x))*(d+e*log(g*x^2+f))/x^3,x, algorithm="giac")
 

Output:

integrate((b*arctan(c*x) + a)*(e*log(g*x^2 + f) + d)/x^3, x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx=\int \frac {\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )\,\left (d+e\,\ln \left (g\,x^2+f\right )\right )}{x^3} \,d x \] Input:

int(((a + b*atan(c*x))*(d + e*log(f + g*x^2)))/x^3,x)
 

Output:

int(((a + b*atan(c*x))*(d + e*log(f + g*x^2)))/x^3, x)
 

Reduce [F]

\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^3} \, dx =\text {Too large to display} \] Input:

int((a+b*atan(c*x))*(d+e*log(g*x^2+f))/x^3,x)
 

Output:

(2*sqrt(g)*sqrt(f)*atan((g*x)/(sqrt(g)*sqrt(f)))*b*c*e*g*x**2 - atan(c*x)* 
log(f + g*x**2)*b*c**2*e*f**2 - atan(c*x)*log(f + g*x**2)*b*e*f*g - atan(c 
*x)*b*c**4*d*f**2*x**2 - atan(c*x)*b*c**4*e*f**2*x**2 - atan(c*x)*b*c**2*d 
*f**2 - atan(c*x)*b*c**2*d*f*g*x**2 - atan(c*x)*b*c**2*e*f**2 - atan(c*x)* 
b*c**2*e*f*g*x**2 - atan(c*x)*b*d*f*g - atan(c*x)*b*e*f*g - 2*int(atan(c*x 
)/(c**4*f**2*x**5 + c**4*f*g*x**7 + c**2*f**2*x**3 + 2*c**2*f*g*x**5 + c** 
2*g**2*x**7 + f*g*x**3 + g**2*x**5),x)*b*c**4*e*f**4*x**2 - 4*int(atan(c*x 
)/(c**4*f**2*x**5 + c**4*f*g*x**7 + c**2*f**2*x**3 + 2*c**2*f*g*x**5 + c** 
2*g**2*x**7 + f*g*x**3 + g**2*x**5),x)*b*c**2*e*f**3*g*x**2 - 2*int(atan(c 
*x)/(c**4*f**2*x**5 + c**4*f*g*x**7 + c**2*f**2*x**3 + 2*c**2*f*g*x**5 + c 
**2*g**2*x**7 + f*g*x**3 + g**2*x**5),x)*b*e*f**2*g**2*x**2 - 2*int(atan(c 
*x)/(c**4*f**2*x**3 + c**4*f*g*x**5 + c**2*f**2*x + 2*c**2*f*g*x**3 + c**2 
*g**2*x**5 + f*g*x + g**2*x**3),x)*b*c**6*e*f**4*x**2 - 4*int(atan(c*x)/(c 
**4*f**2*x**3 + c**4*f*g*x**5 + c**2*f**2*x + 2*c**2*f*g*x**3 + c**2*g**2* 
x**5 + f*g*x + g**2*x**3),x)*b*c**4*e*f**3*g*x**2 - 2*int(atan(c*x)/(c**4* 
f**2*x**3 + c**4*f*g*x**5 + c**2*f**2*x + 2*c**2*f*g*x**3 + c**2*g**2*x**5 
 + f*g*x + g**2*x**3),x)*b*c**2*e*f**2*g**2*x**2 + int(log(f + g*x**2)/(c* 
*4*f**2*x**4 + c**4*f*g*x**6 + c**2*f**2*x**2 + 2*c**2*f*g*x**4 + c**2*g** 
2*x**6 + f*g*x**2 + g**2*x**4),x)*b*c**5*e*f**4*x**2 + int(log(f + g*x**2) 
/(c**4*f**2*x**4 + c**4*f*g*x**6 + c**2*f**2*x**2 + 2*c**2*f*g*x**4 + c...