Integrand size = 29, antiderivative size = 133 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=-\frac {(b e-a f)^2}{b (b c-a d)^2 (a+b x)}-\frac {(d e-c f)^2}{d (b c-a d)^2 (c+d x)}-\frac {2 (b e-a f) (d e-c f) \log (a+b x)}{(b c-a d)^3}+\frac {2 (b e-a f) (d e-c f) \log (c+d x)}{(b c-a d)^3} \] Output:
-(-a*f+b*e)^2/b/(-a*d+b*c)^2/(b*x+a)-(-c*f+d*e)^2/d/(-a*d+b*c)^2/(d*x+c)-2 *(-a*f+b*e)*(-c*f+d*e)*ln(b*x+a)/(-a*d+b*c)^3+2*(-a*f+b*e)*(-c*f+d*e)*ln(d *x+c)/(-a*d+b*c)^3
Time = 0.09 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.89 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=\frac {-\frac {(b c-a d) (b e-a f)^2}{b (a+b x)}+\frac {(-b c+a d) (d e-c f)^2}{d (c+d x)}+2 (b e-a f) (-d e+c f) \log (a+b x)+2 (b e-a f) (d e-c f) \log (c+d x)}{(b c-a d)^3} \] Input:
Integrate[(e + f*x)^2/(a*c + (b*c + a*d)*x + b*d*x^2)^2,x]
Output:
(-(((b*c - a*d)*(b*e - a*f)^2)/(b*(a + b*x))) + ((-(b*c) + a*d)*(d*e - c*f )^2)/(d*(c + d*x)) + 2*(b*e - a*f)*(-(d*e) + c*f)*Log[a + b*x] + 2*(b*e - a*f)*(d*e - c*f)*Log[c + d*x])/(b*c - a*d)^3
Time = 0.39 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.19, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {1141, 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 {(e+f x)^2}{\left (x (a d+b c)+a c+b d x^2\right )^2} \, dx\) |
\(\Big \downarrow \) 1141 |
\(\displaystyle b^2 d^2 \int \left (\frac {(b e-a f)^2}{b^2 d^2 (b c-a d)^2 (a+b x)^2}-\frac {2 (d e-c f) (b e-a f)}{b d^2 (b c-a d)^3 (a+b x)}+\frac {2 (d e-c f) (b e-a f)}{b^2 d (b c-a d)^3 (c+d x)}+\frac {(d e-c f)^2}{b^2 d^2 (b c-a d)^2 (c+d x)^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle b^2 d^2 \left (-\frac {(b e-a f)^2}{b^3 d^2 (a+b x) (b c-a d)^2}-\frac {(d e-c f)^2}{b^2 d^3 (c+d x) (b c-a d)^2}-\frac {2 (b e-a f) \log (a+b x) (d e-c f)}{b^2 d^2 (b c-a d)^3}+\frac {2 (b e-a f) (d e-c f) \log (c+d x)}{b^2 d^2 (b c-a d)^3}\right )\) |
Input:
Int[(e + f*x)^2/(a*c + (b*c + a*d)*x + b*d*x^2)^2,x]
Output:
b^2*d^2*(-((b*e - a*f)^2/(b^3*d^2*(b*c - a*d)^2*(a + b*x))) - (d*e - c*f)^ 2/(b^2*d^3*(b*c - a*d)^2*(c + d*x)) - (2*(b*e - a*f)*(d*e - c*f)*Log[a + b *x])/(b^2*d^2*(b*c - a*d)^3) + (2*(b*e - a*f)*(d*e - c*f)*Log[c + d*x])/(b ^2*d^2*(b*c - a*d)^3))
Int[((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_ Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[1/c^p Int[ExpandIntegrand[ (d + e*x)^m*(b/2 - q/2 + c*x)^p*(b/2 + q/2 + c*x)^p, x], x], x] /; EqQ[p, - 1] || !FractionalPowerFactorQ[q]] /; FreeQ[{a, b, c, d, e}, x] && ILtQ[p, 0] && IntegerQ[m] && NiceSqrtQ[b^2 - 4*a*c]
Time = 1.05 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.31
method | result | size |
default | \(-\frac {a^{2} f^{2}-2 a b e f +b^{2} e^{2}}{\left (a d -b c \right )^{2} b \left (b x +a \right )}+\frac {2 \left (a c \,f^{2}-a d e f -b c e f +b d \,e^{2}\right ) \ln \left (b x +a \right )}{\left (a d -b c \right )^{3}}-\frac {c^{2} f^{2}-2 c e f d +d^{2} e^{2}}{\left (a d -b c \right )^{2} d \left (d x +c \right )}-\frac {2 \left (a c \,f^{2}-a d e f -b c e f +b d \,e^{2}\right ) \ln \left (d x +c \right )}{\left (a d -b c \right )^{3}}\) | \(174\) |
norman | \(\frac {\frac {-a^{2} c d \,f^{2}-a b \,c^{2} f^{2}+4 a b c d e f -a b \,d^{2} e^{2}-d \,e^{2} b^{2} c}{d b \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right )}+\frac {\left (-a^{2} d^{2} f^{2}+2 a b \,d^{2} e f -b^{2} c^{2} f^{2}+2 b^{2} c d e f -2 d^{2} e^{2} b^{2}\right ) x}{d b \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right )}}{\left (b x +a \right ) \left (d x +c \right )}+\frac {2 \left (a c \,f^{2}-a d e f -b c e f +b d \,e^{2}\right ) \ln \left (b x +a \right )}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}-\frac {2 \left (a c \,f^{2}-a d e f -b c e f +b d \,e^{2}\right ) \ln \left (d x +c \right )}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}\) | \(322\) |
risch | \(\frac {-\frac {\left (a^{2} d^{2} f^{2}-2 a b \,d^{2} e f +b^{2} c^{2} f^{2}-2 b^{2} c d e f +2 d^{2} e^{2} b^{2}\right ) x}{b d \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right )}-\frac {a^{2} c d \,f^{2}+a b \,c^{2} f^{2}-4 a b c d e f +a b \,d^{2} e^{2}+d \,e^{2} b^{2} c}{d b \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right )}}{b d \,x^{2}+a d x +c b x +a c}-\frac {2 \ln \left (d x +c \right ) a c \,f^{2}}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}+\frac {2 \ln \left (d x +c \right ) a d e f}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}+\frac {2 \ln \left (d x +c \right ) b c e f}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}-\frac {2 \ln \left (d x +c \right ) b d \,e^{2}}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}+\frac {2 \ln \left (-b x -a \right ) a c \,f^{2}}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}-\frac {2 \ln \left (-b x -a \right ) a d e f}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}-\frac {2 \ln \left (-b x -a \right ) b c e f}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}+\frac {2 \ln \left (-b x -a \right ) b d \,e^{2}}{a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}\) | \(598\) |
parallelrisch | \(\frac {-2 \ln \left (d x +c \right ) x^{2} b^{3} d^{3} e^{2}-2 \ln \left (d x +c \right ) x^{2} a \,b^{2} c \,d^{2} f^{2}+4 \ln \left (d x +c \right ) x a \,b^{2} c \,d^{2} e f +2 x \,b^{3} c \,d^{2} e^{2}+2 \ln \left (b x +a \right ) x^{2} b^{3} d^{3} e^{2}+2 \ln \left (d x +c \right ) x^{2} a \,b^{2} d^{3} e f +2 \ln \left (d x +c \right ) x^{2} b^{3} c \,d^{2} e f +2 \ln \left (b x +a \right ) x \,a^{2} b c \,d^{2} f^{2}-2 \ln \left (b x +a \right ) x \,a^{2} b \,d^{3} e f +2 \ln \left (b x +a \right ) x a \,b^{2} c^{2} d \,f^{2}-2 \ln \left (b x +a \right ) x \,b^{3} c^{2} d e f -2 \ln \left (d x +c \right ) x \,a^{2} b c \,d^{2} f^{2}+2 \ln \left (d x +c \right ) x \,a^{2} b \,d^{3} e f -2 \ln \left (d x +c \right ) x a \,b^{2} c^{2} d \,f^{2}+2 \ln \left (d x +c \right ) x \,b^{3} c^{2} d e f -2 \ln \left (b x +a \right ) a^{2} b c \,d^{2} e f -2 \ln \left (b x +a \right ) a \,b^{2} c^{2} d e f +2 \ln \left (d x +c \right ) a^{2} b c \,d^{2} e f +2 \ln \left (d x +c \right ) a \,b^{2} c^{2} d e f +2 \ln \left (b x +a \right ) x^{2} a \,b^{2} c \,d^{2} f^{2}-2 \ln \left (b x +a \right ) x^{2} a \,b^{2} d^{3} e f -2 \ln \left (b x +a \right ) x^{2} b^{3} c \,d^{2} e f +4 a^{2} b c \,d^{2} e f -4 a \,b^{2} c^{2} d e f -4 \ln \left (b x +a \right ) x a \,b^{2} c \,d^{2} e f -x \,a^{3} d^{3} f^{2}+x \,b^{3} c^{3} f^{2}-a^{3} c \,d^{2} f^{2}-a^{2} b \,d^{3} e^{2}+a \,b^{2} c^{3} f^{2}+b^{3} c^{2} d \,e^{2}+2 \ln \left (b x +a \right ) x a \,b^{2} d^{3} e^{2}+2 \ln \left (b x +a \right ) x \,b^{3} c \,d^{2} e^{2}-2 \ln \left (d x +c \right ) x a \,b^{2} d^{3} e^{2}-2 \ln \left (d x +c \right ) x \,b^{3} c \,d^{2} e^{2}+2 \ln \left (b x +a \right ) a^{2} b \,c^{2} d \,f^{2}+2 \ln \left (b x +a \right ) a \,b^{2} c \,d^{2} e^{2}-2 \ln \left (d x +c \right ) a^{2} b \,c^{2} d \,f^{2}-2 \ln \left (d x +c \right ) a \,b^{2} c \,d^{2} e^{2}-2 x a \,b^{2} d^{3} e^{2}+x \,a^{2} b c \,d^{2} f^{2}-2 x \,b^{3} c^{2} d e f +2 x \,a^{2} b \,d^{3} e f -x a \,b^{2} c^{2} d \,f^{2}}{\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \left (b d \,x^{2}+a d x +c b x +a c \right ) b d}\) | \(815\) |
Input:
int((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2)^2,x,method=_RETURNVERBOSE)
Output:
-(a^2*f^2-2*a*b*e*f+b^2*e^2)/(a*d-b*c)^2/b/(b*x+a)+2*(a*c*f^2-a*d*e*f-b*c* e*f+b*d*e^2)/(a*d-b*c)^3*ln(b*x+a)-(c^2*f^2-2*c*d*e*f+d^2*e^2)/(a*d-b*c)^2 /d/(d*x+c)-2*(a*c*f^2-a*d*e*f-b*c*e*f+b*d*e^2)/(a*d-b*c)^3*ln(d*x+c)
Leaf count of result is larger than twice the leaf count of optimal. 666 vs. \(2 (133) = 266\).
Time = 0.08 (sec) , antiderivative size = 666, normalized size of antiderivative = 5.01 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=-\frac {{\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} e^{2} - 4 \, {\left (a b^{2} c^{2} d - a^{2} b c d^{2}\right )} e f + {\left (a b^{2} c^{3} - a^{3} c d^{2}\right )} f^{2} + {\left (2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} e^{2} - 2 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} e f + {\left (b^{3} c^{3} - a b^{2} c^{2} d + a^{2} b c d^{2} - a^{3} d^{3}\right )} f^{2}\right )} x + 2 \, {\left (a b^{2} c d^{2} e^{2} + a^{2} b c^{2} d f^{2} - {\left (a b^{2} c^{2} d + a^{2} b c d^{2}\right )} e f + {\left (b^{3} d^{3} e^{2} + a b^{2} c d^{2} f^{2} - {\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} e f\right )} x^{2} + {\left ({\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} e^{2} - {\left (b^{3} c^{2} d + 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} e f + {\left (a b^{2} c^{2} d + a^{2} b c d^{2}\right )} f^{2}\right )} x\right )} \log \left (b x + a\right ) - 2 \, {\left (a b^{2} c d^{2} e^{2} + a^{2} b c^{2} d f^{2} - {\left (a b^{2} c^{2} d + a^{2} b c d^{2}\right )} e f + {\left (b^{3} d^{3} e^{2} + a b^{2} c d^{2} f^{2} - {\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} e f\right )} x^{2} + {\left ({\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} e^{2} - {\left (b^{3} c^{2} d + 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} e f + {\left (a b^{2} c^{2} d + a^{2} b c d^{2}\right )} f^{2}\right )} x\right )} \log \left (d x + c\right )}{a b^{4} c^{4} d - 3 \, a^{2} b^{3} c^{3} d^{2} + 3 \, a^{3} b^{2} c^{2} d^{3} - a^{4} b c d^{4} + {\left (b^{5} c^{3} d^{2} - 3 \, a b^{4} c^{2} d^{3} + 3 \, a^{2} b^{3} c d^{4} - a^{3} b^{2} d^{5}\right )} x^{2} + {\left (b^{5} c^{4} d - 2 \, a b^{4} c^{3} d^{2} + 2 \, a^{3} b^{2} c d^{4} - a^{4} b d^{5}\right )} x} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2)^2,x, algorithm="fricas")
Output:
-((b^3*c^2*d - a^2*b*d^3)*e^2 - 4*(a*b^2*c^2*d - a^2*b*c*d^2)*e*f + (a*b^2 *c^3 - a^3*c*d^2)*f^2 + (2*(b^3*c*d^2 - a*b^2*d^3)*e^2 - 2*(b^3*c^2*d - a^ 2*b*d^3)*e*f + (b^3*c^3 - a*b^2*c^2*d + a^2*b*c*d^2 - a^3*d^3)*f^2)*x + 2* (a*b^2*c*d^2*e^2 + a^2*b*c^2*d*f^2 - (a*b^2*c^2*d + a^2*b*c*d^2)*e*f + (b^ 3*d^3*e^2 + a*b^2*c*d^2*f^2 - (b^3*c*d^2 + a*b^2*d^3)*e*f)*x^2 + ((b^3*c*d ^2 + a*b^2*d^3)*e^2 - (b^3*c^2*d + 2*a*b^2*c*d^2 + a^2*b*d^3)*e*f + (a*b^2 *c^2*d + a^2*b*c*d^2)*f^2)*x)*log(b*x + a) - 2*(a*b^2*c*d^2*e^2 + a^2*b*c^ 2*d*f^2 - (a*b^2*c^2*d + a^2*b*c*d^2)*e*f + (b^3*d^3*e^2 + a*b^2*c*d^2*f^2 - (b^3*c*d^2 + a*b^2*d^3)*e*f)*x^2 + ((b^3*c*d^2 + a*b^2*d^3)*e^2 - (b^3* c^2*d + 2*a*b^2*c*d^2 + a^2*b*d^3)*e*f + (a*b^2*c^2*d + a^2*b*c*d^2)*f^2)* x)*log(d*x + c))/(a*b^4*c^4*d - 3*a^2*b^3*c^3*d^2 + 3*a^3*b^2*c^2*d^3 - a^ 4*b*c*d^4 + (b^5*c^3*d^2 - 3*a*b^4*c^2*d^3 + 3*a^2*b^3*c*d^4 - a^3*b^2*d^5 )*x^2 + (b^5*c^4*d - 2*a*b^4*c^3*d^2 + 2*a^3*b^2*c*d^4 - a^4*b*d^5)*x)
Leaf count of result is larger than twice the leaf count of optimal. 872 vs. \(2 (110) = 220\).
Time = 1.97 (sec) , antiderivative size = 872, normalized size of antiderivative = 6.56 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx =\text {Too large to display} \] Input:
integrate((f*x+e)**2/(a*c+(a*d+b*c)*x+b*d*x**2)**2,x)
Output:
(-a**2*c*d*f**2 - a*b*c**2*f**2 + 4*a*b*c*d*e*f - a*b*d**2*e**2 - b**2*c*d *e**2 + x*(-a**2*d**2*f**2 + 2*a*b*d**2*e*f - b**2*c**2*f**2 + 2*b**2*c*d* e*f - 2*b**2*d**2*e**2))/(a**3*b*c*d**3 - 2*a**2*b**2*c**2*d**2 + a*b**3*c **3*d + x**2*(a**2*b**2*d**4 - 2*a*b**3*c*d**3 + b**4*c**2*d**2) + x*(a**3 *b*d**4 - a**2*b**2*c*d**3 - a*b**3*c**2*d**2 + b**4*c**3*d)) - 2*(a*f - b *e)*(c*f - d*e)*log(x + (-2*a**4*d**4*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)* *3 + 8*a**3*b*c*d**3*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 - 12*a**2*b**2 *c**2*d**2*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 + 2*a**2*c*d*f**2 - 2*a* *2*d**2*e*f + 8*a*b**3*c**3*d*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 + 2*a *b*c**2*f**2 - 4*a*b*c*d*e*f + 2*a*b*d**2*e**2 - 2*b**4*c**4*(a*f - b*e)*( c*f - d*e)/(a*d - b*c)**3 - 2*b**2*c**2*e*f + 2*b**2*c*d*e**2)/(4*a*b*c*d* f**2 - 4*a*b*d**2*e*f - 4*b**2*c*d*e*f + 4*b**2*d**2*e**2))/(a*d - b*c)**3 + 2*(a*f - b*e)*(c*f - d*e)*log(x + (2*a**4*d**4*(a*f - b*e)*(c*f - d*e)/ (a*d - b*c)**3 - 8*a**3*b*c*d**3*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 + 12*a**2*b**2*c**2*d**2*(a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 + 2*a**2*c*d *f**2 - 2*a**2*d**2*e*f - 8*a*b**3*c**3*d*(a*f - b*e)*(c*f - d*e)/(a*d - b *c)**3 + 2*a*b*c**2*f**2 - 4*a*b*c*d*e*f + 2*a*b*d**2*e**2 + 2*b**4*c**4*( a*f - b*e)*(c*f - d*e)/(a*d - b*c)**3 - 2*b**2*c**2*e*f + 2*b**2*c*d*e**2) /(4*a*b*c*d*f**2 - 4*a*b*d**2*e*f - 4*b**2*c*d*e*f + 4*b**2*d**2*e**2))/(a *d - b*c)**3
Leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (133) = 266\).
Time = 0.05 (sec) , antiderivative size = 351, normalized size of antiderivative = 2.64 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=-\frac {2 \, {\left (b d e^{2} + a c f^{2} - {\left (b c + a d\right )} e f\right )} \log \left (b x + a\right )}{b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}} + \frac {2 \, {\left (b d e^{2} + a c f^{2} - {\left (b c + a d\right )} e f\right )} \log \left (d x + c\right )}{b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}} + \frac {4 \, a b c d e f - {\left (b^{2} c d + a b d^{2}\right )} e^{2} - {\left (a b c^{2} + a^{2} c d\right )} f^{2} - {\left (2 \, b^{2} d^{2} e^{2} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} e f + {\left (b^{2} c^{2} + a^{2} d^{2}\right )} f^{2}\right )} x}{a b^{3} c^{3} d - 2 \, a^{2} b^{2} c^{2} d^{2} + a^{3} b c d^{3} + {\left (b^{4} c^{2} d^{2} - 2 \, a b^{3} c d^{3} + a^{2} b^{2} d^{4}\right )} x^{2} + {\left (b^{4} c^{3} d - a b^{3} c^{2} d^{2} - a^{2} b^{2} c d^{3} + a^{3} b d^{4}\right )} x} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2)^2,x, algorithm="maxima")
Output:
-2*(b*d*e^2 + a*c*f^2 - (b*c + a*d)*e*f)*log(b*x + a)/(b^3*c^3 - 3*a*b^2*c ^2*d + 3*a^2*b*c*d^2 - a^3*d^3) + 2*(b*d*e^2 + a*c*f^2 - (b*c + a*d)*e*f)* log(d*x + c)/(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3) + (4*a*b* c*d*e*f - (b^2*c*d + a*b*d^2)*e^2 - (a*b*c^2 + a^2*c*d)*f^2 - (2*b^2*d^2*e ^2 - 2*(b^2*c*d + a*b*d^2)*e*f + (b^2*c^2 + a^2*d^2)*f^2)*x)/(a*b^3*c^3*d - 2*a^2*b^2*c^2*d^2 + a^3*b*c*d^3 + (b^4*c^2*d^2 - 2*a*b^3*c*d^3 + a^2*b^2 *d^4)*x^2 + (b^4*c^3*d - a*b^3*c^2*d^2 - a^2*b^2*c*d^3 + a^3*b*d^4)*x)
Leaf count of result is larger than twice the leaf count of optimal. 313 vs. \(2 (133) = 266\).
Time = 0.31 (sec) , antiderivative size = 313, normalized size of antiderivative = 2.35 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=-\frac {2 \, {\left (b^{2} d e^{2} - b^{2} c e f - a b d e f + a b c f^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{b^{4} c^{3} - 3 \, a b^{3} c^{2} d + 3 \, a^{2} b^{2} c d^{2} - a^{3} b d^{3}} + \frac {2 \, {\left (b d^{2} e^{2} - b c d e f - a d^{2} e f + a c d f^{2}\right )} \log \left ({\left | d x + c \right |}\right )}{b^{3} c^{3} d - 3 \, a b^{2} c^{2} d^{2} + 3 \, a^{2} b c d^{3} - a^{3} d^{4}} - \frac {2 \, b^{2} d^{2} e^{2} x - 2 \, b^{2} c d e f x - 2 \, a b d^{2} e f x + b^{2} c^{2} f^{2} x + a^{2} d^{2} f^{2} x + b^{2} c d e^{2} + a b d^{2} e^{2} - 4 \, a b c d e f + a b c^{2} f^{2} + a^{2} c d f^{2}}{{\left (b^{3} c^{2} d - 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} {\left (b d x^{2} + b c x + a d x + a c\right )}} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2)^2,x, algorithm="giac")
Output:
-2*(b^2*d*e^2 - b^2*c*e*f - a*b*d*e*f + a*b*c*f^2)*log(abs(b*x + a))/(b^4* c^3 - 3*a*b^3*c^2*d + 3*a^2*b^2*c*d^2 - a^3*b*d^3) + 2*(b*d^2*e^2 - b*c*d* e*f - a*d^2*e*f + a*c*d*f^2)*log(abs(d*x + c))/(b^3*c^3*d - 3*a*b^2*c^2*d^ 2 + 3*a^2*b*c*d^3 - a^3*d^4) - (2*b^2*d^2*e^2*x - 2*b^2*c*d*e*f*x - 2*a*b* d^2*e*f*x + b^2*c^2*f^2*x + a^2*d^2*f^2*x + b^2*c*d*e^2 + a*b*d^2*e^2 - 4* a*b*c*d*e*f + a*b*c^2*f^2 + a^2*c*d*f^2)/((b^3*c^2*d - 2*a*b^2*c*d^2 + a^2 *b*d^3)*(b*d*x^2 + b*c*x + a*d*x + a*c))
Time = 5.57 (sec) , antiderivative size = 353, normalized size of antiderivative = 2.65 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx=\frac {4\,\mathrm {atanh}\left (\frac {2\,\left (\frac {a^3\,d^3-a^2\,b\,c\,d^2-a\,b^2\,c^2\,d+b^3\,c^3}{a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}+2\,b\,d\,x\right )\,\left (a\,f-b\,e\right )\,\left (c\,f-d\,e\right )\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{{\left (a\,d-b\,c\right )}^3\,\left (2\,a\,c\,f^2+2\,b\,d\,e^2-2\,a\,d\,e\,f-2\,b\,c\,e\,f\right )}\right )\,\left (a\,f-b\,e\right )\,\left (c\,f-d\,e\right )}{{\left (a\,d-b\,c\right )}^3}-\frac {\frac {a^2\,c\,d\,f^2+a\,b\,c^2\,f^2-4\,a\,b\,c\,d\,e\,f+a\,b\,d^2\,e^2+b^2\,c\,d\,e^2}{b\,d\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}+\frac {x\,\left (a^2\,d^2\,f^2-2\,a\,b\,d^2\,e\,f+b^2\,c^2\,f^2-2\,b^2\,c\,d\,e\,f+2\,b^2\,d^2\,e^2\right )}{b\,d\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}}{b\,d\,x^2+\left (a\,d+b\,c\right )\,x+a\,c} \] Input:
int((e + f*x)^2/(a*c + x*(a*d + b*c) + b*d*x^2)^2,x)
Output:
(4*atanh((2*((a^3*d^3 + b^3*c^3 - a*b^2*c^2*d - a^2*b*c*d^2)/(a^2*d^2 + b^ 2*c^2 - 2*a*b*c*d) + 2*b*d*x)*(a*f - b*e)*(c*f - d*e)*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d))/((a*d - b*c)^3*(2*a*c*f^2 + 2*b*d*e^2 - 2*a*d*e*f - 2*b*c*e*f )))*(a*f - b*e)*(c*f - d*e))/(a*d - b*c)^3 - ((a*b*c^2*f^2 + a*b*d^2*e^2 + a^2*c*d*f^2 + b^2*c*d*e^2 - 4*a*b*c*d*e*f)/(b*d*(a^2*d^2 + b^2*c^2 - 2*a* b*c*d)) + (x*(a^2*d^2*f^2 + b^2*c^2*f^2 + 2*b^2*d^2*e^2 - 2*a*b*d^2*e*f - 2*b^2*c*d*e*f))/(b*d*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d)))/(a*c + x*(a*d + b*c ) + b*d*x^2)
Time = 0.30 (sec) , antiderivative size = 1297, normalized size of antiderivative = 9.75 \[ \int \frac {(e+f x)^2}{\left (a c+(b c+a d) x+b d x^2\right )^2} \, dx =\text {Too large to display} \] Input:
int((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2)^2,x)
Output:
(2*log(a + b*x)*a**3*c**2*d*f**2 - 2*log(a + b*x)*a**3*c*d**2*e*f + 2*log( a + b*x)*a**3*c*d**2*f**2*x - 2*log(a + b*x)*a**3*d**3*e*f*x + 2*log(a + b *x)*a**2*b*c**3*f**2 - 4*log(a + b*x)*a**2*b*c**2*d*e*f + 4*log(a + b*x)*a **2*b*c**2*d*f**2*x + 2*log(a + b*x)*a**2*b*c*d**2*e**2 - 6*log(a + b*x)*a **2*b*c*d**2*e*f*x + 2*log(a + b*x)*a**2*b*c*d**2*f**2*x**2 + 2*log(a + b* x)*a**2*b*d**3*e**2*x - 2*log(a + b*x)*a**2*b*d**3*e*f*x**2 - 2*log(a + b* x)*a*b**2*c**3*e*f + 2*log(a + b*x)*a*b**2*c**3*f**2*x + 2*log(a + b*x)*a* b**2*c**2*d*e**2 - 6*log(a + b*x)*a*b**2*c**2*d*e*f*x + 2*log(a + b*x)*a*b **2*c**2*d*f**2*x**2 + 4*log(a + b*x)*a*b**2*c*d**2*e**2*x - 4*log(a + b*x )*a*b**2*c*d**2*e*f*x**2 + 2*log(a + b*x)*a*b**2*d**3*e**2*x**2 - 2*log(a + b*x)*b**3*c**3*e*f*x + 2*log(a + b*x)*b**3*c**2*d*e**2*x - 2*log(a + b*x )*b**3*c**2*d*e*f*x**2 + 2*log(a + b*x)*b**3*c*d**2*e**2*x**2 - 2*log(c + d*x)*a**3*c**2*d*f**2 + 2*log(c + d*x)*a**3*c*d**2*e*f - 2*log(c + d*x)*a* *3*c*d**2*f**2*x + 2*log(c + d*x)*a**3*d**3*e*f*x - 2*log(c + d*x)*a**2*b* c**3*f**2 + 4*log(c + d*x)*a**2*b*c**2*d*e*f - 4*log(c + d*x)*a**2*b*c**2* d*f**2*x - 2*log(c + d*x)*a**2*b*c*d**2*e**2 + 6*log(c + d*x)*a**2*b*c*d** 2*e*f*x - 2*log(c + d*x)*a**2*b*c*d**2*f**2*x**2 - 2*log(c + d*x)*a**2*b*d **3*e**2*x + 2*log(c + d*x)*a**2*b*d**3*e*f*x**2 + 2*log(c + d*x)*a*b**2*c **3*e*f - 2*log(c + d*x)*a*b**2*c**3*f**2*x - 2*log(c + d*x)*a*b**2*c**2*d *e**2 + 6*log(c + d*x)*a*b**2*c**2*d*e*f*x - 2*log(c + d*x)*a*b**2*c**2...