Integrand size = 21, antiderivative size = 172 \[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=-i c d (a+b \arctan (c x))^2+\frac {i e (a+b \arctan (c x))^2}{c}-\frac {d (a+b \arctan (c x))^2}{x}+e x (a+b \arctan (c x))^2+\frac {2 b e (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c}+2 b c d (a+b \arctan (c x)) \log \left (2-\frac {2}{1-i c x}\right )-i b^2 c d \operatorname {PolyLog}\left (2,-1+\frac {2}{1-i c x}\right )+\frac {i b^2 e \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{c} \] Output:
-I*c*d*(a+b*arctan(c*x))^2+I*e*(a+b*arctan(c*x))^2/c-d*(a+b*arctan(c*x))^2 /x+e*x*(a+b*arctan(c*x))^2+2*b*e*(a+b*arctan(c*x))*ln(2/(1+I*c*x))/c+2*b*c *d*(a+b*arctan(c*x))*ln(2-2/(1-I*c*x))-I*b^2*c*d*polylog(2,-1+2/(1-I*c*x)) +I*b^2*e*polylog(2,1-2/(1+I*c*x))/c
Time = 0.18 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.19 \[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\frac {-a^2 c d+a^2 c e x^2+a b c d \left (-2 \arctan (c x)+c x \left (2 \log (c x)-\log \left (1+c^2 x^2\right )\right )\right )+a b e x \left (2 c x \arctan (c x)-\log \left (1+c^2 x^2\right )\right )+b^2 e x \left (\arctan (c x) \left ((-i+c x) \arctan (c x)+2 \log \left (1+e^{2 i \arctan (c x)}\right )\right )-i \operatorname {PolyLog}\left (2,-e^{2 i \arctan (c x)}\right )\right )-b^2 c d \left (\arctan (c x)^2-2 c x \arctan (c x) \log \left (1-e^{2 i \arctan (c x)}\right )+i c x \left (\arctan (c x)^2+\operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )\right )\right )}{c x} \] Input:
Integrate[((d + e*x^2)*(a + b*ArcTan[c*x])^2)/x^2,x]
Output:
(-(a^2*c*d) + a^2*c*e*x^2 + a*b*c*d*(-2*ArcTan[c*x] + c*x*(2*Log[c*x] - Lo g[1 + c^2*x^2])) + a*b*e*x*(2*c*x*ArcTan[c*x] - Log[1 + c^2*x^2]) + b^2*e* x*(ArcTan[c*x]*((-I + c*x)*ArcTan[c*x] + 2*Log[1 + E^((2*I)*ArcTan[c*x])]) - I*PolyLog[2, -E^((2*I)*ArcTan[c*x])]) - b^2*c*d*(ArcTan[c*x]^2 - 2*c*x* ArcTan[c*x]*Log[1 - E^((2*I)*ArcTan[c*x])] + I*c*x*(ArcTan[c*x]^2 + PolyLo g[2, E^((2*I)*ArcTan[c*x])])))/(c*x)
Time = 0.54 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {5515, 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 {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx\) |
\(\Big \downarrow \) 5515 |
\(\displaystyle \int \left (\frac {d (a+b \arctan (c x))^2}{x^2}+e (a+b \arctan (c x))^2\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -i c d (a+b \arctan (c x))^2-\frac {d (a+b \arctan (c x))^2}{x}+2 b c d \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))+\frac {i e (a+b \arctan (c x))^2}{c}+e x (a+b \arctan (c x))^2+\frac {2 b e \log \left (\frac {2}{1+i c x}\right ) (a+b \arctan (c x))}{c}-i b^2 c d \operatorname {PolyLog}\left (2,\frac {2}{1-i c x}-1\right )+\frac {i b^2 e \operatorname {PolyLog}\left (2,1-\frac {2}{i c x+1}\right )}{c}\) |
Input:
Int[((d + e*x^2)*(a + b*ArcTan[c*x])^2)/x^2,x]
Output:
(-I)*c*d*(a + b*ArcTan[c*x])^2 + (I*e*(a + b*ArcTan[c*x])^2)/c - (d*(a + b *ArcTan[c*x])^2)/x + e*x*(a + b*ArcTan[c*x])^2 + (2*b*e*(a + b*ArcTan[c*x] )*Log[2/(1 + I*c*x)])/c + 2*b*c*d*(a + b*ArcTan[c*x])*Log[2 - 2/(1 - I*c*x )] - I*b^2*c*d*PolyLog[2, -1 + 2/(1 - I*c*x)] + (I*b^2*e*PolyLog[2, 1 - 2/ (1 + I*c*x)])/c
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_ .)*(x_)^2)^(q_.), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*ArcTan[c*x] )^p, (f*x)^m*(d + e*x^2)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d , e, f, m}, x] && IntegerQ[q] && IGtQ[p, 0] && ((EqQ[p, 1] && GtQ[q, 0]) || IntegerQ[m])
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 355 vs. \(2 (164 ) = 328\).
Time = 1.54 (sec) , antiderivative size = 356, normalized size of antiderivative = 2.07
method | result | size |
derivativedivides | \(c \left (\frac {a^{2} \left (e c x -\frac {d c}{x}\right )}{c^{2}}+\frac {b^{2} \left (\arctan \left (c x \right )^{2} c x e -\frac {\arctan \left (c x \right )^{2} d c}{x}+2 \arctan \left (c x \right ) d \,c^{2} \ln \left (c x \right )-\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) c^{2} d -\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) e +\left (c^{2} d +e \right ) \left (-\frac {i \left (\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )-\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )-\frac {\ln \left (c x -i\right )^{2}}{2}\right )}{2}+\frac {i \left (\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )-\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )-\frac {\ln \left (c x +i\right )^{2}}{2}\right )}{2}\right )-2 d \,c^{2} \left (-\frac {i \ln \left (c x \right ) \ln \left (i c x +1\right )}{2}+\frac {i \ln \left (c x \right ) \ln \left (-i c x +1\right )}{2}-\frac {i \operatorname {dilog}\left (i c x +1\right )}{2}+\frac {i \operatorname {dilog}\left (-i c x +1\right )}{2}\right )\right )}{c^{2}}+\frac {2 a b \left (\arctan \left (c x \right ) c x e -\frac {\arctan \left (c x \right ) d c}{x}+d \,c^{2} \ln \left (c x \right )-\frac {\left (c^{2} d +e \right ) \ln \left (c^{2} x^{2}+1\right )}{2}\right )}{c^{2}}\right )\) | \(356\) |
default | \(c \left (\frac {a^{2} \left (e c x -\frac {d c}{x}\right )}{c^{2}}+\frac {b^{2} \left (\arctan \left (c x \right )^{2} c x e -\frac {\arctan \left (c x \right )^{2} d c}{x}+2 \arctan \left (c x \right ) d \,c^{2} \ln \left (c x \right )-\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) c^{2} d -\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) e +\left (c^{2} d +e \right ) \left (-\frac {i \left (\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )-\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )-\frac {\ln \left (c x -i\right )^{2}}{2}\right )}{2}+\frac {i \left (\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )-\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )-\frac {\ln \left (c x +i\right )^{2}}{2}\right )}{2}\right )-2 d \,c^{2} \left (-\frac {i \ln \left (c x \right ) \ln \left (i c x +1\right )}{2}+\frac {i \ln \left (c x \right ) \ln \left (-i c x +1\right )}{2}-\frac {i \operatorname {dilog}\left (i c x +1\right )}{2}+\frac {i \operatorname {dilog}\left (-i c x +1\right )}{2}\right )\right )}{c^{2}}+\frac {2 a b \left (\arctan \left (c x \right ) c x e -\frac {\arctan \left (c x \right ) d c}{x}+d \,c^{2} \ln \left (c x \right )-\frac {\left (c^{2} d +e \right ) \ln \left (c^{2} x^{2}+1\right )}{2}\right )}{c^{2}}\right )\) | \(356\) |
parts | \(a^{2} \left (e x -\frac {d}{x}\right )+b^{2} c \left (\frac {\arctan \left (c x \right )^{2} x e}{c}-\frac {\arctan \left (c x \right )^{2} d}{c x}-\frac {2 \left (\frac {\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) c^{2} d}{2}+\frac {\arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right ) e}{2}-\arctan \left (c x \right ) d \,c^{2} \ln \left (c x \right )-\frac {\left (c^{2} d +e \right ) \left (-\frac {i \left (\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )-\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )-\frac {\ln \left (c x -i\right )^{2}}{2}\right )}{2}+\frac {i \left (\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )-\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )-\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )-\frac {\ln \left (c x +i\right )^{2}}{2}\right )}{2}\right )}{2}-\frac {i c^{2} d \ln \left (c x \right ) \ln \left (i c x +1\right )}{2}+\frac {i c^{2} d \ln \left (c x \right ) \ln \left (-i c x +1\right )}{2}-\frac {i c^{2} d \operatorname {dilog}\left (i c x +1\right )}{2}+\frac {i c^{2} d \operatorname {dilog}\left (-i c x +1\right )}{2}\right )}{c^{2}}\right )+2 a b c \left (\frac {\arctan \left (c x \right ) x e}{c}-\frac {\arctan \left (c x \right ) d}{c x}-\frac {\frac {\left (c^{2} d +e \right ) \ln \left (c^{2} x^{2}+1\right )}{2}-d \,c^{2} \ln \left (c x \right )}{c^{2}}\right )\) | \(376\) |
Input:
int((e*x^2+d)*(a+b*arctan(c*x))^2/x^2,x,method=_RETURNVERBOSE)
Output:
c*(a^2/c^2*(e*c*x-d*c/x)+b^2/c^2*(arctan(c*x)^2*c*x*e-arctan(c*x)^2*d*c/x+ 2*arctan(c*x)*d*c^2*ln(c*x)-arctan(c*x)*ln(c^2*x^2+1)*c^2*d-arctan(c*x)*ln (c^2*x^2+1)*e+(c^2*d+e)*(-1/2*I*(ln(c*x-I)*ln(c^2*x^2+1)-dilog(-1/2*I*(I+c *x))-ln(c*x-I)*ln(-1/2*I*(I+c*x))-1/2*ln(c*x-I)^2)+1/2*I*(ln(I+c*x)*ln(c^2 *x^2+1)-dilog(1/2*I*(c*x-I))-ln(I+c*x)*ln(1/2*I*(c*x-I))-1/2*ln(I+c*x)^2)) -2*d*c^2*(-1/2*I*ln(c*x)*ln(1+I*c*x)+1/2*I*ln(c*x)*ln(1-I*c*x)-1/2*I*dilog (1+I*c*x)+1/2*I*dilog(1-I*c*x)))+2*a*b/c^2*(arctan(c*x)*c*x*e-arctan(c*x)* d*c/x+d*c^2*ln(c*x)-1/2*(c^2*d+e)*ln(c^2*x^2+1)))
\[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\int { \frac {{\left (e x^{2} + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2}}{x^{2}} \,d x } \] Input:
integrate((e*x^2+d)*(a+b*arctan(c*x))^2/x^2,x, algorithm="fricas")
Output:
integral((a^2*e*x^2 + a^2*d + (b^2*e*x^2 + b^2*d)*arctan(c*x)^2 + 2*(a*b*e *x^2 + a*b*d)*arctan(c*x))/x^2, x)
\[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\int \frac {\left (a + b \operatorname {atan}{\left (c x \right )}\right )^{2} \left (d + e x^{2}\right )}{x^{2}}\, dx \] Input:
integrate((e*x**2+d)*(a+b*atan(c*x))**2/x**2,x)
Output:
Integral((a + b*atan(c*x))**2*(d + e*x**2)/x**2, x)
\[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\int { \frac {{\left (e x^{2} + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2}}{x^{2}} \,d x } \] Input:
integrate((e*x^2+d)*(a+b*arctan(c*x))^2/x^2,x, algorithm="maxima")
Output:
-(c*(log(c^2*x^2 + 1) - log(x^2)) + 2*arctan(c*x)/x)*a*b*d + a^2*e*x + (2* c*x*arctan(c*x) - log(c^2*x^2 + 1))*a*b*e/c - a^2*d/x + 1/16*(4*(b^2*e*x^2 - b^2*d)*arctan(c*x)^2 - (b^2*e*x^2 - b^2*d)*log(c^2*x^2 + 1)^2 + 4*(b^2* c*d*arctan(c*x)^3 + 48*b^2*c^2*e*integrate(1/16*x^4*arctan(c*x)^2/(c^2*x^4 + x^2), x) + 4*b^2*c^2*e*integrate(1/16*x^4*log(c^2*x^2 + 1)^2/(c^2*x^4 + x^2), x) + 16*b^2*c^2*e*integrate(1/16*x^4*log(c^2*x^2 + 1)/(c^2*x^4 + x^ 2), x) + 4*b^2*c^2*d*integrate(1/16*x^2*log(c^2*x^2 + 1)^2/(c^2*x^4 + x^2) , x) - 16*b^2*c^2*d*integrate(1/16*x^2*log(c^2*x^2 + 1)/(c^2*x^4 + x^2), x ) + b^2*e*arctan(c*x)^3/c - 32*b^2*c*e*integrate(1/16*x^3*arctan(c*x)/(c^2 *x^4 + x^2), x) + 32*b^2*c*d*integrate(1/16*x*arctan(c*x)/(c^2*x^4 + x^2), x) + 4*b^2*e*integrate(1/16*x^2*log(c^2*x^2 + 1)^2/(c^2*x^4 + x^2), x) + 48*b^2*d*integrate(1/16*arctan(c*x)^2/(c^2*x^4 + x^2), x) + 4*b^2*d*integr ate(1/16*log(c^2*x^2 + 1)^2/(c^2*x^4 + x^2), x))*x)/x
\[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\int { \frac {{\left (e x^{2} + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2}}{x^{2}} \,d x } \] Input:
integrate((e*x^2+d)*(a+b*arctan(c*x))^2/x^2,x, algorithm="giac")
Output:
integrate((e*x^2 + d)*(b*arctan(c*x) + a)^2/x^2, x)
Timed out. \[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2\,\left (e\,x^2+d\right )}{x^2} \,d x \] Input:
int(((a + b*atan(c*x))^2*(d + e*x^2))/x^2,x)
Output:
int(((a + b*atan(c*x))^2*(d + e*x^2))/x^2, x)
\[ \int \frac {\left (d+e x^2\right ) (a+b \arctan (c x))^2}{x^2} \, dx=\frac {-\mathit {atan} \left (c x \right )^{2} b^{2} c d -2 \mathit {atan} \left (c x \right ) a b c d +2 \mathit {atan} \left (c x \right ) a b c e \,x^{2}+\left (\int \mathit {atan} \left (c x \right )^{2}d x \right ) b^{2} c e x +2 \left (\int \frac {\mathit {atan} \left (c x \right )}{c^{2} x^{3}+x}d x \right ) b^{2} c^{2} d x -\mathrm {log}\left (c^{2} x^{2}+1\right ) a b \,c^{2} d x -\mathrm {log}\left (c^{2} x^{2}+1\right ) a b e x +2 \,\mathrm {log}\left (x \right ) a b \,c^{2} d x -a^{2} c d +a^{2} c e \,x^{2}}{c x} \] Input:
int((e*x^2+d)*(a+b*atan(c*x))^2/x^2,x)
Output:
( - atan(c*x)**2*b**2*c*d - 2*atan(c*x)*a*b*c*d + 2*atan(c*x)*a*b*c*e*x**2 + int(atan(c*x)**2,x)*b**2*c*e*x + 2*int(atan(c*x)/(c**2*x**3 + x),x)*b** 2*c**2*d*x - log(c**2*x**2 + 1)*a*b*c**2*d*x - log(c**2*x**2 + 1)*a*b*e*x + 2*log(x)*a*b*c**2*d*x - a**2*c*d + a**2*c*e*x**2)/(c*x)