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

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

Optimal result

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

I*d*(a+b*arctan(d*x+c))^2/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+d*(-c*f+d*e)*(a+ 
b*arctan(d*x+c))^2/f/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)-(a+b*arctan(d*x+c))^2 
/f/(f*x+e)-2*b*d*(a+b*arctan(d*x+c))*ln(2/(1-I*(d*x+c)))/(d^2*e^2-2*c*d*e* 
f+(c^2+1)*f^2)+2*b*d*(a+b*arctan(d*x+c))*ln(2*d*(f*x+e)/(d*e+I*f-c*f)/(1-I 
*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+2*b*d*(a+b*arctan(d*x+c))*ln(2/ 
(1+I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+I*b^2*d*polylog(2,1-2/(1-I* 
(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)-I*b^2*d*polylog(2,1-2*d*(f*x+e)/ 
(d*e+I*f-c*f)/(1-I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+I*b^2*d*polyl 
og(2,1-2/(1+I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)
 

Mathematica [A] (warning: unable to verify)

Time = 4.54 (sec) , antiderivative size = 419, normalized size of antiderivative = 0.87 \[ \int \frac {(a+b \arctan (c+d x))^2}{(e+f x)^2} \, dx=\frac {-\frac {a^2}{f}+\frac {2 a b \left (-\left (\left (-c d e+f+c^2 f-d^2 e x+c d f x\right ) \arctan (c+d x)\right )+d (e+f x) \log \left (\frac {d (e+f x)}{\sqrt {1+(c+d x)^2}}\right )\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (e+f x) \left (-\frac {e^{i \arctan \left (\frac {d e-c f}{f}\right )} \arctan (c+d x)^2}{f \sqrt {1+\frac {(d e-c f)^2}{f^2}}}+\frac {(c+d x) \arctan (c+d x)^2}{d (e+f x)}-\frac {(d e-c f) \left (-i \left (\pi -2 \arctan \left (\frac {d e-c f}{f}\right )\right ) \arctan (c+d x)-\pi \log \left (1+e^{-2 i \arctan (c+d x)}\right )-2 \left (\arctan \left (\frac {d e-c f}{f}\right )+\arctan (c+d x)\right ) \log \left (1-e^{2 i \left (\arctan \left (\frac {d e-c f}{f}\right )+\arctan (c+d x)\right )}\right )+\pi \log \left (\frac {1}{\sqrt {1+(c+d x)^2}}\right )+2 \arctan \left (\frac {d e-c f}{f}\right ) \log \left (\sin \left (\arctan \left (\frac {d e-c f}{f}\right )+\arctan (c+d x)\right )\right )+i \operatorname {PolyLog}\left (2,e^{2 i \left (\arctan \left (\frac {d e-c f}{f}\right )+\arctan (c+d x)\right )}\right )\right )}{f^2 \left (1+\frac {(d e-c f)^2}{f^2}\right )}\right )}{d e-c f}}{e+f x} \] Input:

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

Output:

(-(a^2/f) + (2*a*b*(-((-(c*d*e) + f + c^2*f - d^2*e*x + c*d*f*x)*ArcTan[c 
+ d*x]) + d*(e + f*x)*Log[(d*(e + f*x))/Sqrt[1 + (c + d*x)^2]]))/(d^2*e^2 
- 2*c*d*e*f + (1 + c^2)*f^2) + (b^2*d*(e + f*x)*(-((E^(I*ArcTan[(d*e - c*f 
)/f])*ArcTan[c + d*x]^2)/(f*Sqrt[1 + (d*e - c*f)^2/f^2])) + ((c + d*x)*Arc 
Tan[c + d*x]^2)/(d*(e + f*x)) - ((d*e - c*f)*((-I)*(Pi - 2*ArcTan[(d*e - c 
*f)/f])*ArcTan[c + d*x] - Pi*Log[1 + E^((-2*I)*ArcTan[c + d*x])] - 2*(ArcT 
an[(d*e - c*f)/f] + ArcTan[c + d*x])*Log[1 - E^((2*I)*(ArcTan[(d*e - c*f)/ 
f] + ArcTan[c + d*x]))] + Pi*Log[1/Sqrt[1 + (c + d*x)^2]] + 2*ArcTan[(d*e 
- c*f)/f]*Log[Sin[ArcTan[(d*e - c*f)/f] + ArcTan[c + d*x]]] + I*PolyLog[2, 
 E^((2*I)*(ArcTan[(d*e - c*f)/f] + ArcTan[c + d*x]))]))/(f^2*(1 + (d*e - c 
*f)^2/f^2))))/(d*e - c*f))/(e + f*x)
 

Rubi [A] (verified)

Time = 1.57 (sec) , antiderivative size = 586, normalized size of antiderivative = 1.22, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {5568, 7292, 5580, 27, 7276, 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+d x))^2}{(e+f x)^2} \, dx\)

\(\Big \downarrow \) 5568

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

\(\Big \downarrow \) 7292

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

\(\Big \downarrow \) 5580

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 7276

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-((a + b*ArcTan[c + d*x])^2/(f*(e + f*x))) + (2*b*d*((a*(d*e - c*f)*ArcTan 
[c + d*x])/(f^2 + (d*e - c*f)^2) + ((I/2)*b*f*ArcTan[c + d*x]^2)/(d^2*e^2 
- 2*c*d*e*f + (1 + c^2)*f^2) + (b*(d*e - c*f)*ArcTan[c + d*x]^2)/(2*(d^2*e 
^2 - 2*c*d*e*f + (1 + c^2)*f^2)) - (b*f*ArcTan[c + d*x]*Log[2/(1 - I*(c + 
d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (b*f*ArcTan[c + d*x]*Log[2 
/(1 + I*(c + d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (a*f*Log[d*e 
- c*f + f*(c + d*x)])/(f^2 + (d*e - c*f)^2) + (b*f*ArcTan[c + d*x]*Log[(2* 
(d*e - c*f + f*(c + d*x)))/((d*e + I*f - c*f)*(1 - I*(c + d*x)))])/(d^2*e^ 
2 - 2*c*d*e*f + (1 + c^2)*f^2) - (a*f*Log[1 + (c + d*x)^2])/(2*(f^2 + (d*e 
 - c*f)^2)) + ((I/2)*b*f*PolyLog[2, 1 - 2/(1 - I*(c + d*x))])/(d^2*e^2 - 2 
*c*d*e*f + (1 + c^2)*f^2) + ((I/2)*b*f*PolyLog[2, 1 - 2/(1 + I*(c + d*x))] 
)/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) - ((I/2)*b*f*PolyLog[2, 1 - (2*(d* 
e - c*f + f*(c + d*x)))/((d*e + I*f - c*f)*(1 - I*(c + d*x)))])/(d^2*e^2 - 
 2*c*d*e*f + (1 + c^2)*f^2)))/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 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5568
Int[((a_.) + ArcTan[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m 
_), x_Symbol] :> Simp[(e + f*x)^(m + 1)*((a + b*ArcTan[c + d*x])^p/(f*(m + 
1))), x] - Simp[b*d*(p/(f*(m + 1)))   Int[(e + f*x)^(m + 1)*((a + b*ArcTan[ 
c + d*x])^(p - 1)/(1 + (c + d*x)^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x 
] && IGtQ[p, 0] && ILtQ[m, -1]
 

rule 5580
Int[((a_.) + ArcTan[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m 
_.)*((A_.) + (B_.)*(x_) + (C_.)*(x_)^2)^(q_.), x_Symbol] :> Simp[1/d   Subs 
t[Int[((d*e - c*f)/d + f*(x/d))^m*(C/d^2 + (C/d^2)*x^2)^q*(a + b*ArcTan[x]) 
^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m, p, q}, x] & 
& EqQ[B*(1 + c^2) - 2*A*c*d, 0] && EqQ[2*c*C - B*d, 0]
 

rule 7276
Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionE 
xpand[u/(a + b*x^n), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ 
[n, 0]
 

rule 7292
Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =! 
= u]
 
Maple [A] (verified)

Time = 1.44 (sec) , antiderivative size = 776, normalized size of antiderivative = 1.62

method result size
parts \(-\frac {a^{2}}{\left (f x +e \right ) f}+\frac {b^{2} \left (-\frac {d^{2} \arctan \left (d x +c \right )^{2}}{\left (f \left (d x +c \right )-c f +d e \right ) f}+\frac {2 d^{2} \left (-\frac {\arctan \left (d x +c \right ) f \ln \left (1+\left (d x +c \right )^{2}\right )}{2 \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}\right )}-\frac {\arctan \left (d x +c \right )^{2} c f}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\arctan \left (d x +c \right )^{2} d e}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\arctan \left (d x +c \right ) f \ln \left (f \left (d x +c \right )-c f +d e \right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {f^{2} \left (-\frac {i \ln \left (f \left (d x +c \right )-c f +d e \right ) \left (\ln \left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )-\ln \left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )\right )}{2 f}-\frac {i \left (\operatorname {dilog}\left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )-\operatorname {dilog}\left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )\right )}{2 f}\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\left (c f -d e \right ) \arctan \left (d x +c \right )^{2}}{2 c^{2} f^{2}-4 c d e f +2 d^{2} e^{2}+2 f^{2}}+\frac {f \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2 c^{2} f^{2}-4 c d e f +2 d^{2} e^{2}+2 f^{2}}\right )}{f}\right )}{d}+\frac {2 a b \left (-\frac {d^{2} \arctan \left (d x +c \right )}{\left (f \left (d x +c \right )-c f +d e \right ) f}+\frac {d^{2} \left (\frac {-\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+\left (-c f +d e \right ) \arctan \left (d x +c \right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {f \ln \left (f \left (d x +c \right )-c f +d e \right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}\right )}{f}\right )}{d}\) \(776\)
derivativedivides \(\frac {\frac {a^{2} d^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}+b^{2} d^{2} \left (\frac {\arctan \left (d x +c \right )^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {2 \left (-\frac {\arctan \left (d x +c \right ) f \ln \left (c f -d e -f \left (d x +c \right )\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\arctan \left (d x +c \right ) f \ln \left (1+\left (d x +c \right )^{2}\right )}{2 c^{2} f^{2}-4 c d e f +2 d^{2} e^{2}+2 f^{2}}+\frac {\arctan \left (d x +c \right )^{2} c f}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {\arctan \left (d x +c \right )^{2} d e}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {\left (c f -d e \right ) \arctan \left (d x +c \right )^{2}}{2 \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}\right )}-\frac {f^{2} \left (-\frac {i \ln \left (c f -d e -f \left (d x +c \right )\right ) \left (\ln \left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )-\ln \left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )\right )}{2 f}-\frac {i \left (\operatorname {dilog}\left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )-\operatorname {dilog}\left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )\right )}{2 f}\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {f \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2 \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}\right )}\right )}{f}\right )+2 a b \,d^{2} \left (\frac {\arctan \left (d x +c \right )}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {-\frac {f \ln \left (c f -d e -f \left (d x +c \right )\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+\left (c f -d e \right ) \arctan \left (d x +c \right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}}{f}\right )}{d}\) \(787\)
default \(\frac {\frac {a^{2} d^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}+b^{2} d^{2} \left (\frac {\arctan \left (d x +c \right )^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {2 \left (-\frac {\arctan \left (d x +c \right ) f \ln \left (c f -d e -f \left (d x +c \right )\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\arctan \left (d x +c \right ) f \ln \left (1+\left (d x +c \right )^{2}\right )}{2 c^{2} f^{2}-4 c d e f +2 d^{2} e^{2}+2 f^{2}}+\frac {\arctan \left (d x +c \right )^{2} c f}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {\arctan \left (d x +c \right )^{2} d e}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {\left (c f -d e \right ) \arctan \left (d x +c \right )^{2}}{2 \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}\right )}-\frac {f^{2} \left (-\frac {i \ln \left (c f -d e -f \left (d x +c \right )\right ) \left (\ln \left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )-\ln \left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )\right )}{2 f}-\frac {i \left (\operatorname {dilog}\left (\frac {i f +f \left (d x +c \right )}{c f -d e +i f}\right )-\operatorname {dilog}\left (\frac {i f -f \left (d x +c \right )}{-c f +d e +i f}\right )\right )}{2 f}\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}-\frac {f \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2 \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}\right )}\right )}{f}\right )+2 a b \,d^{2} \left (\frac {\arctan \left (d x +c \right )}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {-\frac {f \ln \left (c f -d e -f \left (d x +c \right )\right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}+\frac {\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+\left (c f -d e \right ) \arctan \left (d x +c \right )}{c^{2} f^{2}-2 c d e f +d^{2} e^{2}+f^{2}}}{f}\right )}{d}\) \(787\)

Input:

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

Output:

-a^2/(f*x+e)/f+b^2/d*(-d^2/(f*(d*x+c)-c*f+d*e)/f*arctan(d*x+c)^2+2*d^2/f*( 
-1/2*arctan(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*f*ln(1+(d*x+c)^2)-1/(c^ 
2*f^2-2*c*d*e*f+d^2*e^2+f^2)*arctan(d*x+c)^2*c*f+1/(c^2*f^2-2*c*d*e*f+d^2* 
e^2+f^2)*arctan(d*x+c)^2*d*e+arctan(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2) 
*f*ln(f*(d*x+c)-c*f+d*e)-1/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*f^2*(-1/2*I*ln( 
f*(d*x+c)-c*f+d*e)*(ln((I*f-f*(d*x+c))/(d*e+I*f-c*f))-ln((I*f+f*(d*x+c))/( 
c*f-d*e+I*f)))/f-1/2*I*(dilog((I*f-f*(d*x+c))/(d*e+I*f-c*f))-dilog((I*f+f* 
(d*x+c))/(c*f-d*e+I*f)))/f)+1/2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*(c*f-d*e)* 
arctan(d*x+c)^2+1/2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*f*(-1/2*I*(ln(d*x+c-I) 
*ln(1+(d*x+c)^2)-1/2*ln(d*x+c-I)^2-dilog(-1/2*I*(d*x+c+I))-ln(d*x+c-I)*ln( 
-1/2*I*(d*x+c+I)))+1/2*I*(ln(d*x+c+I)*ln(1+(d*x+c)^2)-1/2*ln(d*x+c+I)^2-di 
log(1/2*I*(d*x+c-I))-ln(d*x+c+I)*ln(1/2*I*(d*x+c-I))))))+2*a*b/d*(-d^2/(f* 
(d*x+c)-c*f+d*e)/f*arctan(d*x+c)+d^2/f*(1/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)* 
(-1/2*f*ln(1+(d*x+c)^2)+(-c*f+d*e)*arctan(d*x+c))+1/(c^2*f^2-2*c*d*e*f+d^2 
*e^2+f^2)*f*ln(f*(d*x+c)-c*f+d*e)))
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

(d*(2*(d^2*e - c*d*f)*arctan((d^2*x + c*d)/d)/((d^2*e^2*f - 2*c*d*e*f^2 + 
(c^2 + 1)*f^3)*d) - log(d^2*x^2 + 2*c*d*x + c^2 + 1)/(d^2*e^2 - 2*c*d*e*f 
+ (c^2 + 1)*f^2) + 2*log(f*x + e)/(d^2*e^2 - 2*c*d*e*f + (c^2 + 1)*f^2)) - 
 2*arctan(d*x + c)/(f^2*x + e*f))*a*b - 1/16*(4*arctan(d*x + c)^2 - 16*(f^ 
2*x + e*f)*integrate(1/16*(12*(d^2*f*x^2 + 2*c*d*f*x + (c^2 + 1)*f)*arctan 
(d*x + c)^2 + (d^2*f*x^2 + 2*c*d*f*x + (c^2 + 1)*f)*log(d^2*x^2 + 2*c*d*x 
+ c^2 + 1)^2 + 8*(d*f*x + d*e)*arctan(d*x + c) - 4*(d^2*f*x^2 + c*d*e + (d 
^2*e + c*d*f)*x)*log(d^2*x^2 + 2*c*d*x + c^2 + 1))/(d^2*f^3*x^4 + (c^2 + 1 
)*e^2*f + 2*(d^2*e*f^2 + c*d*f^3)*x^3 + (d^2*e^2*f + 4*c*d*e*f^2 + (c^2 + 
1)*f^3)*x^2 + 2*(c*d*e^2*f + (c^2 + 1)*e*f^2)*x), x) - log(d^2*x^2 + 2*c*d 
*x + c^2 + 1)^2)*b^2/(f^2*x + e*f) - a^2/(f^2*x + e*f)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

( - atan(c + d*x)**2*b**2*c**4*e*f**3 + 2*atan(c + d*x)**2*b**2*c**3*d*e** 
2*f**2 - atan(c + d*x)**2*b**2*c**2*d**2*e**3*f - atan(c + d*x)**2*b**2*c* 
*2*d**2*e**2*f**2*x - 2*atan(c + d*x)**2*b**2*c**2*e*f**3 + 2*atan(c + d*x 
)**2*b**2*c*d**3*e**3*f*x + 2*atan(c + d*x)**2*b**2*c*d*e**2*f**2 - atan(c 
 + d*x)**2*b**2*d**4*e**4*x - atan(c + d*x)**2*b**2*d**2*e**3*f - atan(c + 
 d*x)**2*b**2*d**2*e**2*f**2*x - atan(c + d*x)**2*b**2*e*f**3 - 2*atan(c + 
 d*x)*a*b*c**4*e*f**3 + 2*atan(c + d*x)*a*b*c**3*d*e**2*f**2 - 2*atan(c + 
d*x)*a*b*c**3*d*e*f**3*x + 2*atan(c + d*x)*a*b*c**2*d**2*e**3*f + 2*atan(c 
 + d*x)*a*b*c**2*d**2*e**2*f**2*x - 4*atan(c + d*x)*a*b*c**2*e*f**3 - 2*at 
an(c + d*x)*a*b*c*d**3*e**4 + 2*atan(c + d*x)*a*b*c*d**3*e**3*f*x + 2*atan 
(c + d*x)*a*b*c*d*e**2*f**2 - 2*atan(c + d*x)*a*b*c*d*e*f**3*x - 2*atan(c 
+ d*x)*a*b*d**4*e**4*x + 2*atan(c + d*x)*a*b*d**2*e**3*f + 2*atan(c + d*x) 
*a*b*d**2*e**2*f**2*x - 2*atan(c + d*x)*a*b*e*f**3 - 2*atan(c + d*x)*b**2* 
c**2*d*e**2*f**2 + 2*atan(c + d*x)*b**2*c*d**2*e**3*f - 2*atan(c + d*x)*b* 
*2*c*d**2*e**2*f**2*x + 2*atan(c + d*x)*b**2*d**3*e**3*f*x - 2*atan(c + d* 
x)*b**2*d*e**2*f**2 + 2*int((atan(c + d*x)*x)/(c**4*e**2*f**2 + 2*c**4*e*f 
**3*x + c**4*f**4*x**2 + 2*c**3*d*e**2*f**2*x + 4*c**3*d*e*f**3*x**2 + 2*c 
**3*d*f**4*x**3 - c**2*d**2*e**4 - 2*c**2*d**2*e**3*f*x + 2*c**2*d**2*e*f* 
*3*x**3 + c**2*d**2*f**4*x**4 + 2*c**2*e**2*f**2 + 4*c**2*e*f**3*x + 2*c** 
2*f**4*x**2 - 2*c*d**3*e**4*x - 4*c*d**3*e**3*f*x**2 - 2*c*d**3*e**2*f*...