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

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

Optimal result

Integrand size = 20, antiderivative size = 99 \[ \int \frac {(d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx=-\frac {(d+e x) (b d-2 a e+(2 c d-b e) x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac {4 \left (c d^2-b d e+a e^2\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2}} \] Output:

-(e*x+d)*(b*d-2*a*e+(-b*e+2*c*d)*x)/(-4*a*c+b^2)/(c*x^2+b*x+a)+4*(a*e^2-b* 
d*e+c*d^2)*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(3/2)
 

Mathematica [A] (verified)

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

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

Output:

(a*b*e^2 + 2*c^2*d^2*x + b^2*e^2*x + b*c*d*(d - 2*e*x) - 2*a*c*e*(2*d + e* 
x))/(c*(-b^2 + 4*a*c)*(a + x*(b + c*x))) + (4*(c*d^2 + e*(-(b*d) + a*e))*A 
rcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/(-b^2 + 4*a*c)^(3/2)
 

Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {1153, 1083, 219}

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

\(\Big \downarrow \) 1153

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

\(\Big \downarrow \) 1083

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

\(\Big \downarrow \) 219

\(\displaystyle \frac {4 \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (a e^2-b d e+c d^2\right )}{\left (b^2-4 a c\right )^{3/2}}-\frac {(d+e x) (-2 a e+x (2 c d-b e)+b d)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}\)

Input:

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

Output:

-(((d + e*x)*(b*d - 2*a*e + (2*c*d - b*e)*x))/((b^2 - 4*a*c)*(a + b*x + c* 
x^2))) + (4*(c*d^2 - b*d*e + a*e^2)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]] 
)/(b^2 - 4*a*c)^(3/2)
 

Defintions of rubi rules used

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

rule 1153
Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_S 
ymbol] :> Simp[(d + e*x)^(m - 1)*(d*b - 2*a*e + (2*c*d - b*e)*x)*((a + b*x 
+ c*x^2)^(p + 1)/((p + 1)*(b^2 - 4*a*c))), x] - Simp[2*(2*p + 3)*((c*d^2 - 
b*d*e + a*e^2)/((p + 1)*(b^2 - 4*a*c)))   Int[(d + e*x)^(m - 2)*(a + b*x + 
c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[m + 2*p + 2, 0] 
&& LtQ[p, -1]
 
Maple [A] (verified)

Time = 0.92 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.51

method result size
default \(\frac {-\frac {\left (2 a c \,e^{2}-b^{2} e^{2}+2 b c d e -2 c^{2} d^{2}\right ) x}{\left (4 a c -b^{2}\right ) c}+\frac {a b \,e^{2}-4 a c d e +b c \,d^{2}}{c \left (4 a c -b^{2}\right )}}{c \,x^{2}+b x +a}+\frac {4 \left (a \,e^{2}-b d e +c \,d^{2}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (4 a c -b^{2}\right )^{\frac {3}{2}}}\) \(149\)
risch \(\frac {-\frac {\left (2 a c \,e^{2}-b^{2} e^{2}+2 b c d e -2 c^{2} d^{2}\right ) x}{\left (4 a c -b^{2}\right ) c}+\frac {a b \,e^{2}-4 a c d e +b c \,d^{2}}{c \left (4 a c -b^{2}\right )}}{c \,x^{2}+b x +a}+\frac {2 \ln \left (\left (-8 a \,c^{2}+2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}-4 a b c +b^{3}\right ) a \,e^{2}}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}-\frac {2 \ln \left (\left (-8 a \,c^{2}+2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}-4 a b c +b^{3}\right ) b d e}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}+\frac {2 \ln \left (\left (-8 a \,c^{2}+2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}-4 a b c +b^{3}\right ) c \,d^{2}}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}-\frac {2 \ln \left (\left (8 a \,c^{2}-2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}+4 a b c -b^{3}\right ) a \,e^{2}}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}+\frac {2 \ln \left (\left (8 a \,c^{2}-2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}+4 a b c -b^{3}\right ) b d e}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}-\frac {2 \ln \left (\left (8 a \,c^{2}-2 b^{2} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {3}{2}}+4 a b c -b^{3}\right ) c \,d^{2}}{\left (-4 a c +b^{2}\right )^{\frac {3}{2}}}\) \(409\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 324 vs. \(2 (95) = 190\).

Time = 0.09 (sec) , antiderivative size = 669, normalized size of antiderivative = 6.76 \[ \int \frac {(d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx=\left [-\frac {{\left (b^{3} c - 4 \, a b c^{2}\right )} d^{2} - 4 \, {\left (a b^{2} c - 4 \, a^{2} c^{2}\right )} d e + {\left (a b^{3} - 4 \, a^{2} b c\right )} e^{2} + 2 \, {\left (a c^{2} d^{2} - a b c d e + a^{2} c e^{2} + {\left (c^{3} d^{2} - b c^{2} d e + a c^{2} e^{2}\right )} x^{2} + {\left (b c^{2} d^{2} - b^{2} c d e + a b c e^{2}\right )} x\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + {\left (2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} - 2 \, {\left (b^{3} c - 4 \, a b c^{2}\right )} d e + {\left (b^{4} - 6 \, a b^{2} c + 8 \, a^{2} c^{2}\right )} e^{2}\right )} x}{a b^{4} c - 8 \, a^{2} b^{2} c^{2} + 16 \, a^{3} c^{3} + {\left (b^{4} c^{2} - 8 \, a b^{2} c^{3} + 16 \, a^{2} c^{4}\right )} x^{2} + {\left (b^{5} c - 8 \, a b^{3} c^{2} + 16 \, a^{2} b c^{3}\right )} x}, -\frac {{\left (b^{3} c - 4 \, a b c^{2}\right )} d^{2} - 4 \, {\left (a b^{2} c - 4 \, a^{2} c^{2}\right )} d e + {\left (a b^{3} - 4 \, a^{2} b c\right )} e^{2} - 4 \, {\left (a c^{2} d^{2} - a b c d e + a^{2} c e^{2} + {\left (c^{3} d^{2} - b c^{2} d e + a c^{2} e^{2}\right )} x^{2} + {\left (b c^{2} d^{2} - b^{2} c d e + a b c e^{2}\right )} x\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left (2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} - 2 \, {\left (b^{3} c - 4 \, a b c^{2}\right )} d e + {\left (b^{4} - 6 \, a b^{2} c + 8 \, a^{2} c^{2}\right )} e^{2}\right )} x}{a b^{4} c - 8 \, a^{2} b^{2} c^{2} + 16 \, a^{3} c^{3} + {\left (b^{4} c^{2} - 8 \, a b^{2} c^{3} + 16 \, a^{2} c^{4}\right )} x^{2} + {\left (b^{5} c - 8 \, a b^{3} c^{2} + 16 \, a^{2} b c^{3}\right )} x}\right ] \] Input:

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

Output:

[-((b^3*c - 4*a*b*c^2)*d^2 - 4*(a*b^2*c - 4*a^2*c^2)*d*e + (a*b^3 - 4*a^2* 
b*c)*e^2 + 2*(a*c^2*d^2 - a*b*c*d*e + a^2*c*e^2 + (c^3*d^2 - b*c^2*d*e + a 
*c^2*e^2)*x^2 + (b*c^2*d^2 - b^2*c*d*e + a*b*c*e^2)*x)*sqrt(b^2 - 4*a*c)*l 
og((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c - sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c* 
x^2 + b*x + a)) + (2*(b^2*c^2 - 4*a*c^3)*d^2 - 2*(b^3*c - 4*a*b*c^2)*d*e + 
 (b^4 - 6*a*b^2*c + 8*a^2*c^2)*e^2)*x)/(a*b^4*c - 8*a^2*b^2*c^2 + 16*a^3*c 
^3 + (b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*x^2 + (b^5*c - 8*a*b^3*c^2 + 16* 
a^2*b*c^3)*x), -((b^3*c - 4*a*b*c^2)*d^2 - 4*(a*b^2*c - 4*a^2*c^2)*d*e + ( 
a*b^3 - 4*a^2*b*c)*e^2 - 4*(a*c^2*d^2 - a*b*c*d*e + a^2*c*e^2 + (c^3*d^2 - 
 b*c^2*d*e + a*c^2*e^2)*x^2 + (b*c^2*d^2 - b^2*c*d*e + a*b*c*e^2)*x)*sqrt( 
-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + (2*( 
b^2*c^2 - 4*a*c^3)*d^2 - 2*(b^3*c - 4*a*b*c^2)*d*e + (b^4 - 6*a*b^2*c + 8* 
a^2*c^2)*e^2)*x)/(a*b^4*c - 8*a^2*b^2*c^2 + 16*a^3*c^3 + (b^4*c^2 - 8*a*b^ 
2*c^3 + 16*a^2*c^4)*x^2 + (b^5*c - 8*a*b^3*c^2 + 16*a^2*b*c^3)*x)]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 517 vs. \(2 (95) = 190\).

Time = 0.91 (sec) , antiderivative size = 517, normalized size of antiderivative = 5.22 \[ \int \frac {(d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx=- 2 \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) \log {\left (x + \frac {- 32 a^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) + 16 a b^{2} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) + 2 a b e^{2} - 2 b^{4} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) - 2 b^{2} d e + 2 b c d^{2}}{4 a c e^{2} - 4 b c d e + 4 c^{2} d^{2}} \right )} + 2 \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) \log {\left (x + \frac {32 a^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) - 16 a b^{2} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) + 2 a b e^{2} + 2 b^{4} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{3}}} \left (a e^{2} - b d e + c d^{2}\right ) - 2 b^{2} d e + 2 b c d^{2}}{4 a c e^{2} - 4 b c d e + 4 c^{2} d^{2}} \right )} + \frac {a b e^{2} - 4 a c d e + b c d^{2} + x \left (- 2 a c e^{2} + b^{2} e^{2} - 2 b c d e + 2 c^{2} d^{2}\right )}{4 a^{2} c^{2} - a b^{2} c + x^{2} \cdot \left (4 a c^{3} - b^{2} c^{2}\right ) + x \left (4 a b c^{2} - b^{3} c\right )} \] Input:

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

Output:

-2*sqrt(-1/(4*a*c - b**2)**3)*(a*e**2 - b*d*e + c*d**2)*log(x + (-32*a**2* 
c**2*sqrt(-1/(4*a*c - b**2)**3)*(a*e**2 - b*d*e + c*d**2) + 16*a*b**2*c*sq 
rt(-1/(4*a*c - b**2)**3)*(a*e**2 - b*d*e + c*d**2) + 2*a*b*e**2 - 2*b**4*s 
qrt(-1/(4*a*c - b**2)**3)*(a*e**2 - b*d*e + c*d**2) - 2*b**2*d*e + 2*b*c*d 
**2)/(4*a*c*e**2 - 4*b*c*d*e + 4*c**2*d**2)) + 2*sqrt(-1/(4*a*c - b**2)**3 
)*(a*e**2 - b*d*e + c*d**2)*log(x + (32*a**2*c**2*sqrt(-1/(4*a*c - b**2)** 
3)*(a*e**2 - b*d*e + c*d**2) - 16*a*b**2*c*sqrt(-1/(4*a*c - b**2)**3)*(a*e 
**2 - b*d*e + c*d**2) + 2*a*b*e**2 + 2*b**4*sqrt(-1/(4*a*c - b**2)**3)*(a* 
e**2 - b*d*e + c*d**2) - 2*b**2*d*e + 2*b*c*d**2)/(4*a*c*e**2 - 4*b*c*d*e 
+ 4*c**2*d**2)) + (a*b*e**2 - 4*a*c*d*e + b*c*d**2 + x*(-2*a*c*e**2 + b**2 
*e**2 - 2*b*c*d*e + 2*c**2*d**2))/(4*a**2*c**2 - a*b**2*c + x**2*(4*a*c**3 
 - b**2*c**2) + x*(4*a*b*c**2 - b**3*c))
 

Maxima [F(-2)]

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

integrate((e*x+d)^2/(c*x^2+b*x+a)^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(4*a*c-b^2>0)', see `assume?` for 
 more deta
 

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.32 \[ \int \frac {(d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx=\frac {\frac {b\,c\,d^2-4\,a\,c\,d\,e+a\,b\,e^2}{c\,\left (4\,a\,c-b^2\right )}+\frac {x\,\left (b^2\,e^2-2\,b\,c\,d\,e+2\,c^2\,d^2-2\,a\,c\,e^2\right )}{c\,\left (4\,a\,c-b^2\right )}}{c\,x^2+b\,x+a}-\frac {4\,\mathrm {atan}\left (\frac {\left (\frac {2\,\left (b^3-4\,a\,b\,c\right )\,\left (c\,d^2-b\,d\,e+a\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}}-\frac {4\,c\,x\,\left (c\,d^2-b\,d\,e+a\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{3/2}}\right )\,\left (4\,a\,c-b^2\right )}{2\,c\,d^2-2\,b\,d\,e+2\,a\,e^2}\right )\,\left (c\,d^2-b\,d\,e+a\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{3/2}} \] Input:

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

Output:

((a*b*e^2 + b*c*d^2 - 4*a*c*d*e)/(c*(4*a*c - b^2)) + (x*(b^2*e^2 + 2*c^2*d 
^2 - 2*a*c*e^2 - 2*b*c*d*e))/(c*(4*a*c - b^2)))/(a + b*x + c*x^2) - (4*ata 
n((((2*(b^3 - 4*a*b*c)*(a*e^2 + c*d^2 - b*d*e))/(4*a*c - b^2)^(5/2) - (4*c 
*x*(a*e^2 + c*d^2 - b*d*e))/(4*a*c - b^2)^(3/2))*(4*a*c - b^2))/(2*a*e^2 + 
 2*c*d^2 - 2*b*d*e))*(a*e^2 + c*d^2 - b*d*e))/(4*a*c - b^2)^(3/2)
 

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 611, normalized size of antiderivative = 6.17 \[ \int \frac {(d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx=\frac {4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a^{2} b \,e^{2}-4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a \,b^{2} d e +4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a \,b^{2} e^{2} x +4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a b c \,d^{2}+4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a b c \,e^{2} x^{2}-4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b^{3} d e x +4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b^{2} c \,d^{2} x -4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b^{2} c d e \,x^{2}+4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b \,c^{2} d^{2} x^{2}+8 a^{3} c \,e^{2}-2 a^{2} b^{2} e^{2}-8 a^{2} b c d e -8 a^{2} c^{2} d^{2}+8 a^{2} c^{2} e^{2} x^{2}+2 a \,b^{3} d e +6 a \,b^{2} c \,d^{2}-6 a \,b^{2} c \,e^{2} x^{2}+8 a b \,c^{2} d e \,x^{2}-8 a \,c^{3} d^{2} x^{2}-b^{4} d^{2}+b^{4} e^{2} x^{2}-2 b^{3} c d e \,x^{2}+2 b^{2} c^{2} d^{2} x^{2}}{b \left (16 a^{2} c^{3} x^{2}-8 a \,b^{2} c^{2} x^{2}+b^{4} c \,x^{2}+16 a^{2} b \,c^{2} x -8 a \,b^{3} c x +b^{5} x +16 a^{3} c^{2}-8 a^{2} b^{2} c +a \,b^{4}\right )} \] Input:

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

Output:

(4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**2*b*e**2 - 4 
*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b**2*d*e + 4*sq 
rt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b**2*e**2*x + 4*sq 
rt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b*c*d**2 + 4*sqrt( 
4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b*c*e**2*x**2 - 4*sqr 
t(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b**3*d*e*x + 4*sqrt(4 
*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b**2*c*d**2*x - 4*sqrt(4 
*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b**2*c*d*e*x**2 + 4*sqrt 
(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*c**2*d**2*x**2 + 8*a 
**3*c*e**2 - 2*a**2*b**2*e**2 - 8*a**2*b*c*d*e - 8*a**2*c**2*d**2 + 8*a**2 
*c**2*e**2*x**2 + 2*a*b**3*d*e + 6*a*b**2*c*d**2 - 6*a*b**2*c*e**2*x**2 + 
8*a*b*c**2*d*e*x**2 - 8*a*c**3*d**2*x**2 - b**4*d**2 + b**4*e**2*x**2 - 2* 
b**3*c*d*e*x**2 + 2*b**2*c**2*d**2*x**2)/(b*(16*a**3*c**2 - 8*a**2*b**2*c 
+ 16*a**2*b*c**2*x + 16*a**2*c**3*x**2 + a*b**4 - 8*a*b**3*c*x - 8*a*b**2* 
c**2*x**2 + b**5*x + b**4*c*x**2))