\(\int \frac {x (a+b \arctan (c x))}{(d+e x^2)^2} \, dx\) [1158]

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

Optimal result

Integrand size = 19, antiderivative size = 91 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\frac {b c^2 \arctan (c x)}{2 \left (c^2 d-e\right ) e}-\frac {a+b \arctan (c x)}{2 e \left (d+e x^2\right )}-\frac {b c \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{2 \sqrt {d} \left (c^2 d-e\right ) \sqrt {e}} \] Output:

1/2*b*c^2*arctan(c*x)/(c^2*d-e)/e-1/2*(a+b*arctan(c*x))/e/(e*x^2+d)-1/2*b* 
c*arctan(e^(1/2)*x/d^(1/2))/d^(1/2)/(c^2*d-e)/e^(1/2)
 

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.08 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\frac {a \sqrt {d} \left (c^2 d-e\right )-b \sqrt {d} e \left (1+c^2 x^2\right ) \arctan (c x)+b c \sqrt {e} \left (d+e x^2\right ) \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{2 \sqrt {d} e \left (-c^2 d+e\right ) \left (d+e x^2\right )} \] Input:

Integrate[(x*(a + b*ArcTan[c*x]))/(d + e*x^2)^2,x]
 

Output:

(a*Sqrt[d]*(c^2*d - e) - b*Sqrt[d]*e*(1 + c^2*x^2)*ArcTan[c*x] + b*c*Sqrt[ 
e]*(d + e*x^2)*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/(2*Sqrt[d]*e*(-(c^2*d) + e)*(d 
 + e*x^2))
 

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.97, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {5509, 303, 216, 218}

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

\(\Big \downarrow \) 5509

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

\(\Big \downarrow \) 303

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 218

\(\displaystyle \frac {b c \left (\frac {c \arctan (c x)}{c^2 d-e}-\frac {\sqrt {e} \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d} \left (c^2 d-e\right )}\right )}{2 e}-\frac {a+b \arctan (c x)}{2 e \left (d+e x^2\right )}\)

Input:

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

Output:

-1/2*(a + b*ArcTan[c*x])/(e*(d + e*x^2)) + (b*c*((c*ArcTan[c*x])/(c^2*d - 
e) - (Sqrt[e]*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/(Sqrt[d]*(c^2*d - e))))/(2*e)
 

Defintions of rubi rules used

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 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 303
Int[1/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Simp[b/(b 
*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[d/(b*c - a*d)   Int[1/(c + d*x 
^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
 

rule 5509
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*(x_)*((d_.) + (e_.)*(x_)^2)^(q_.), x 
_Symbol] :> Simp[(d + e*x^2)^(q + 1)*((a + b*ArcTan[c*x])/(2*e*(q + 1))), x 
] - Simp[b*(c/(2*e*(q + 1)))   Int[(d + e*x^2)^(q + 1)/(1 + c^2*x^2), x], x 
] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[q, -1]
 
Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.09

method result size
parts \(-\frac {a}{2 e \left (e \,x^{2}+d \right )}-\frac {b \,c^{2} \arctan \left (c x \right )}{2 e \left (c^{2} e \,x^{2}+c^{2} d \right )}+\frac {b \,c^{2} \arctan \left (c x \right )}{2 \left (c^{2} d -e \right ) e}-\frac {b c \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{2 \left (c^{2} d -e \right ) \sqrt {d e}}\) \(99\)
derivativedivides \(\frac {-\frac {a \,c^{4}}{2 e \left (c^{2} e \,x^{2}+c^{2} d \right )}+b \,c^{4} \left (-\frac {\arctan \left (c x \right )}{2 e \left (c^{2} e \,x^{2}+c^{2} d \right )}+\frac {-\frac {e \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{\left (c^{2} d -e \right ) c \sqrt {d e}}+\frac {\arctan \left (c x \right )}{c^{2} d -e}}{2 e}\right )}{c^{2}}\) \(115\)
default \(\frac {-\frac {a \,c^{4}}{2 e \left (c^{2} e \,x^{2}+c^{2} d \right )}+b \,c^{4} \left (-\frac {\arctan \left (c x \right )}{2 e \left (c^{2} e \,x^{2}+c^{2} d \right )}+\frac {-\frac {e \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{\left (c^{2} d -e \right ) c \sqrt {d e}}+\frac {\arctan \left (c x \right )}{c^{2} d -e}}{2 e}\right )}{c^{2}}\) \(115\)
risch \(\frac {i b \ln \left (i c x +1\right )}{4 e \left (e \,x^{2}+d \right )}-\frac {i c^{2} b \ln \left (\left (-i c x +1\right )^{2} e -c^{2} d -2 \left (-i c x +1\right ) e +e \right )}{8 \left (c^{2} d -e \right ) e}-\frac {i c b \,\operatorname {arctanh}\left (\frac {2 \left (-i c x +1\right ) e -2 e}{2 c \sqrt {d e}}\right )}{4 \left (c^{2} d -e \right ) \sqrt {d e}}-\frac {i c^{4} b \ln \left (-i c x +1\right ) x^{2}}{4 \left (c^{2} d -e \right ) \left (-c^{2} e \,x^{2}-c^{2} d \right )}-\frac {i c^{2} b \ln \left (-i c x +1\right )}{4 \left (c^{2} d -e \right ) \left (-c^{2} e \,x^{2}-c^{2} d \right )}+\frac {c^{2} a}{2 e \left (-c^{2} e \,x^{2}-c^{2} d \right )}+\frac {i b \,c^{2} \ln \left (e \,x^{2}+d \right )}{8 e \left (c^{2} d -e \right )}-\frac {b c \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{4 \left (c^{2} d -e \right ) \sqrt {d e}}-\frac {i b \,c^{2} \ln \left (c^{2} x^{2}+1\right )}{8 e \left (c^{2} d -e \right )}+\frac {b \,c^{2} \arctan \left (c x \right )}{4 \left (c^{2} d -e \right ) e}\) \(354\)

Input:

int(x*(a+b*arctan(c*x))/(e*x^2+d)^2,x,method=_RETURNVERBOSE)
 

Output:

-1/2*a/e/(e*x^2+d)-1/2*b*c^2*arctan(c*x)/e/(c^2*e*x^2+c^2*d)+1/2*b*c^2*arc 
tan(c*x)/(c^2*d-e)/e-1/2*b*c/(c^2*d-e)/(d*e)^(1/2)*arctan(e*x/(d*e)^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 234, normalized size of antiderivative = 2.57 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\left [-\frac {2 \, a c^{2} d^{2} - 2 \, a d e - {\left (b c e x^{2} + b c d\right )} \sqrt {-d e} \log \left (\frac {e x^{2} - 2 \, \sqrt {-d e} x - d}{e x^{2} + d}\right ) - 2 \, {\left (b c^{2} d e x^{2} + b d e\right )} \arctan \left (c x\right )}{4 \, {\left (c^{2} d^{3} e - d^{2} e^{2} + {\left (c^{2} d^{2} e^{2} - d e^{3}\right )} x^{2}\right )}}, -\frac {a c^{2} d^{2} - a d e + {\left (b c e x^{2} + b c d\right )} \sqrt {d e} \arctan \left (\frac {\sqrt {d e} x}{d}\right ) - {\left (b c^{2} d e x^{2} + b d e\right )} \arctan \left (c x\right )}{2 \, {\left (c^{2} d^{3} e - d^{2} e^{2} + {\left (c^{2} d^{2} e^{2} - d e^{3}\right )} x^{2}\right )}}\right ] \] Input:

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

Output:

[-1/4*(2*a*c^2*d^2 - 2*a*d*e - (b*c*e*x^2 + b*c*d)*sqrt(-d*e)*log((e*x^2 - 
 2*sqrt(-d*e)*x - d)/(e*x^2 + d)) - 2*(b*c^2*d*e*x^2 + b*d*e)*arctan(c*x)) 
/(c^2*d^3*e - d^2*e^2 + (c^2*d^2*e^2 - d*e^3)*x^2), -1/2*(a*c^2*d^2 - a*d* 
e + (b*c*e*x^2 + b*c*d)*sqrt(d*e)*arctan(sqrt(d*e)*x/d) - (b*c^2*d*e*x^2 + 
 b*d*e)*arctan(c*x))/(c^2*d^3*e - d^2*e^2 + (c^2*d^2*e^2 - d*e^3)*x^2)]
 

Sympy [F(-1)]

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

integrate(x*(a+b*atan(c*x))/(e*x**2+d)**2,x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\text {Exception raised: ValueError} \] Input:

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(e>0)', see `assume?` for more de 
tails)Is e
 

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.21 (sec) , antiderivative size = 192, normalized size of antiderivative = 2.11 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=-\frac {b c \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{2 \, {\left (c^{2} d - e\right )} \sqrt {d e}} + \frac {-i \, b c^{2} e x^{2} \log \left (i \, c x + 1\right ) + i \, b c^{2} e x^{2} \log \left (-i \, c x + 1\right ) - 2 \, b c^{2} d \arctan \left (c x\right ) - i \, b c^{2} d \log \left (i \, c x + 1\right ) + i \, b c^{2} d \log \left (-i \, c x + 1\right ) - 2 \, a c^{2} d + 2 \, b e \arctan \left (c x\right ) + 2 \, a e}{4 \, {\left (c^{2} d e^{2} x^{2} + c^{2} d^{2} e - e^{3} x^{2} - d e^{2}\right )}} - \frac {a}{2 \, {\left (e^{2} x^{2} + d e\right )}} - \frac {a}{2 \, {\left (e x^{2} + d\right )} e} \] Input:

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

Output:

-1/2*b*c*arctan(e*x/sqrt(d*e))/((c^2*d - e)*sqrt(d*e)) + 1/4*(-I*b*c^2*e*x 
^2*log(I*c*x + 1) + I*b*c^2*e*x^2*log(-I*c*x + 1) - 2*b*c^2*d*arctan(c*x) 
- I*b*c^2*d*log(I*c*x + 1) + I*b*c^2*d*log(-I*c*x + 1) - 2*a*c^2*d + 2*b*e 
*arctan(c*x) + 2*a*e)/(c^2*d*e^2*x^2 + c^2*d^2*e - e^3*x^2 - d*e^2) - 1/2* 
a/(e^2*x^2 + d*e) - 1/2*a/((e*x^2 + d)*e)
 

Mupad [B] (verification not implemented)

Time = 1.22 (sec) , antiderivative size = 696, normalized size of antiderivative = 7.65 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\frac {b\,c\,\ln \left (e\,x+\sqrt {-d\,e}\right )\,\sqrt {-d\,e}}{4\,d\,e^2-4\,c^2\,d^2\,e}-\frac {2\,b\,c^2\,\mathrm {atan}\left (-\frac {\frac {c^2\,\left (c^8\,e\,x+\frac {c^2\,\left (2\,c^5\,e^3-4\,c^7\,d\,e^2+2\,c^9\,d^2\,e+\frac {c^2\,x\,\left (8\,c^{10}\,d^3\,e^2-8\,c^8\,d^2\,e^3-8\,c^6\,d\,e^4+8\,c^4\,e^5\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )}{4\,e^2-4\,c^2\,d\,e}-\frac {c^2\,\left (-c^8\,e\,x+\frac {c^2\,\left (2\,c^5\,e^3-4\,c^7\,d\,e^2+2\,c^9\,d^2\,e-\frac {c^2\,x\,\left (8\,c^{10}\,d^3\,e^2-8\,c^8\,d^2\,e^3-8\,c^6\,d\,e^4+8\,c^4\,e^5\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )}{4\,e^2-4\,c^2\,d\,e}}{\frac {c^2\,\left (c^8\,e\,x+\frac {c^2\,\left (2\,c^5\,e^3-4\,c^7\,d\,e^2+2\,c^9\,d^2\,e+\frac {c^2\,x\,\left (8\,c^{10}\,d^3\,e^2-8\,c^8\,d^2\,e^3-8\,c^6\,d\,e^4+8\,c^4\,e^5\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}+\frac {c^2\,\left (-c^8\,e\,x+\frac {c^2\,\left (2\,c^5\,e^3-4\,c^7\,d\,e^2+2\,c^9\,d^2\,e-\frac {c^2\,x\,\left (8\,c^{10}\,d^3\,e^2-8\,c^8\,d^2\,e^3-8\,c^6\,d\,e^4+8\,c^4\,e^5\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}\right )\,1{}\mathrm {i}}{4\,e^2-4\,c^2\,d\,e}}\right )}{4\,e^2-4\,c^2\,d\,e}-\frac {b\,\mathrm {atan}\left (c\,x\right )}{2\,e\,\left (e\,x^2+d\right )}-\frac {b\,c\,\ln \left (e\,x-\sqrt {-d\,e}\right )\,\sqrt {-d\,e}}{4\,\left (d\,e^2-c^2\,d^2\,e\right )}-\frac {a}{2\,e^2\,x^2+2\,d\,e} \] Input:

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

Output:

(b*c*log(e*x + (-d*e)^(1/2))*(-d*e)^(1/2))/(4*d*e^2 - 4*c^2*d^2*e) - (2*b* 
c^2*atan(-((c^2*((c^2*(2*c^5*e^3 - 4*c^7*d*e^2 + 2*c^9*d^2*e + (c^2*x*(8*c 
^4*e^5 - 8*c^6*d*e^4 - 8*c^8*d^2*e^3 + 8*c^10*d^3*e^2)*1i)/(4*e^2 - 4*c^2* 
d*e))*1i)/(4*e^2 - 4*c^2*d*e) + c^8*e*x))/(4*e^2 - 4*c^2*d*e) - (c^2*((c^2 
*(2*c^5*e^3 - 4*c^7*d*e^2 + 2*c^9*d^2*e - (c^2*x*(8*c^4*e^5 - 8*c^6*d*e^4 
- 8*c^8*d^2*e^3 + 8*c^10*d^3*e^2)*1i)/(4*e^2 - 4*c^2*d*e))*1i)/(4*e^2 - 4* 
c^2*d*e) - c^8*e*x))/(4*e^2 - 4*c^2*d*e))/((c^2*((c^2*(2*c^5*e^3 - 4*c^7*d 
*e^2 + 2*c^9*d^2*e + (c^2*x*(8*c^4*e^5 - 8*c^6*d*e^4 - 8*c^8*d^2*e^3 + 8*c 
^10*d^3*e^2)*1i)/(4*e^2 - 4*c^2*d*e))*1i)/(4*e^2 - 4*c^2*d*e) + c^8*e*x)*1 
i)/(4*e^2 - 4*c^2*d*e) + (c^2*((c^2*(2*c^5*e^3 - 4*c^7*d*e^2 + 2*c^9*d^2*e 
 - (c^2*x*(8*c^4*e^5 - 8*c^6*d*e^4 - 8*c^8*d^2*e^3 + 8*c^10*d^3*e^2)*1i)/( 
4*e^2 - 4*c^2*d*e))*1i)/(4*e^2 - 4*c^2*d*e) - c^8*e*x)*1i)/(4*e^2 - 4*c^2* 
d*e))))/(4*e^2 - 4*c^2*d*e) - (b*atan(c*x))/(2*e*(d + e*x^2)) - (b*c*log(e 
*x - (-d*e)^(1/2))*(-d*e)^(1/2))/(4*(d*e^2 - c^2*d^2*e)) - a/(2*d*e + 2*e^ 
2*x^2)
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.38 \[ \int \frac {x (a+b \arctan (c x))}{\left (d+e x^2\right )^2} \, dx=\frac {-\sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) b c d -\sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) b c e \,x^{2}+\mathit {atan} \left (c x \right ) b \,c^{2} d e \,x^{2}+\mathit {atan} \left (c x \right ) b d e +a \,c^{2} d e \,x^{2}-a \,e^{2} x^{2}}{2 d e \left (c^{2} d e \,x^{2}+c^{2} d^{2}-e^{2} x^{2}-d e \right )} \] Input:

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

Output:

( - sqrt(e)*sqrt(d)*atan((e*x)/(sqrt(e)*sqrt(d)))*b*c*d - sqrt(e)*sqrt(d)* 
atan((e*x)/(sqrt(e)*sqrt(d)))*b*c*e*x**2 + atan(c*x)*b*c**2*d*e*x**2 + ata 
n(c*x)*b*d*e + a*c**2*d*e*x**2 - a*e**2*x**2)/(2*d*e*(c**2*d**2 + c**2*d*e 
*x**2 - d*e - e**2*x**2))