Integrand size = 29, antiderivative size = 73 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {f^2 x}{b d}+\frac {(b e-a f)^2 \log (a+b x)}{b^2 (b c-a d)}-\frac {(d e-c f)^2 \log (c+d x)}{d^2 (b c-a d)} \] Output:
f^2*x/b/d+(-a*f+b*e)^2*ln(b*x+a)/b^2/(-a*d+b*c)-(-c*f+d*e)^2*ln(d*x+c)/d^2 /(-a*d+b*c)
Time = 0.04 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.01 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {d^2 (b e-a f)^2 \log (a+b x)-b \left (d (-b c+a d) f^2 x+b (d e-c f)^2 \log (c+d x)\right )}{b^2 d^2 (b c-a d)} \] Input:
Integrate[(e + f*x)^2/(a*c + (b*c + a*d)*x + b*d*x^2),x]
Output:
(d^2*(b*e - a*f)^2*Log[a + b*x] - b*(d*(-(b*c) + a*d)*f^2*x + b*(d*e - c*f )^2*Log[c + d*x]))/(b^2*d^2*(b*c - a*d))
Time = 0.26 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.12, 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}{x (a d+b c)+a c+b d x^2} \, dx\) |
\(\Big \downarrow \) 1141 |
\(\displaystyle b d \int \left (\frac {f^2}{b^2 d^2}+\frac {(b e-a f)^2}{b^2 d (b c-a d) (a+b x)}-\frac {(d e-c f)^2}{b d^2 (b c-a d) (c+d x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle b d \left (\frac {(b e-a f)^2 \log (a+b x)}{b^3 d (b c-a d)}-\frac {(d e-c f)^2 \log (c+d x)}{b d^3 (b c-a d)}+\frac {f^2 x}{b^2 d^2}\right )\) |
Input:
Int[(e + f*x)^2/(a*c + (b*c + a*d)*x + b*d*x^2),x]
Output:
b*d*((f^2*x)/(b^2*d^2) + ((b*e - a*f)^2*Log[a + b*x])/(b^3*d*(b*c - a*d)) - ((d*e - c*f)^2*Log[c + d*x])/(b*d^3*(b*c - a*d)))
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 = 0.99 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.32
method | result | size |
norman | \(\frac {f^{2} x}{b d}+\frac {\left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}\right ) \ln \left (d x +c \right )}{d^{2} \left (a d -b c \right )}-\frac {\left (a^{2} f^{2}-2 a b e f +b^{2} e^{2}\right ) \ln \left (b x +a \right )}{\left (a d -b c \right ) b^{2}}\) | \(96\) |
default | \(\frac {f^{2} x}{b d}+\frac {\left (-a^{2} f^{2}+2 a b e f -b^{2} e^{2}\right ) \ln \left (b x +a \right )}{\left (a d -b c \right ) b^{2}}+\frac {\left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}\right ) \ln \left (d x +c \right )}{d^{2} \left (a d -b c \right )}\) | \(97\) |
parallelrisch | \(-\frac {\ln \left (b x +a \right ) a^{2} d^{2} f^{2}-2 \ln \left (b x +a \right ) a b \,d^{2} e f +\ln \left (b x +a \right ) b^{2} d^{2} e^{2}-\ln \left (d x +c \right ) b^{2} c^{2} f^{2}+2 \ln \left (d x +c \right ) b^{2} c d e f -\ln \left (d x +c \right ) b^{2} d^{2} e^{2}-x a b \,d^{2} f^{2}+x \,b^{2} c d \,f^{2}}{b^{2} d^{2} \left (a d -b c \right )}\) | \(137\) |
risch | \(\frac {f^{2} x}{b d}-\frac {\ln \left (b x +a \right ) a^{2} f^{2}}{\left (a d -b c \right ) b^{2}}+\frac {2 \ln \left (b x +a \right ) a e f}{\left (a d -b c \right ) b}-\frac {\ln \left (b x +a \right ) e^{2}}{a d -b c}+\frac {\ln \left (-d x -c \right ) c^{2} f^{2}}{d^{2} \left (a d -b c \right )}-\frac {2 \ln \left (-d x -c \right ) c e f}{d \left (a d -b c \right )}+\frac {\ln \left (-d x -c \right ) e^{2}}{a d -b c}\) | \(164\) |
Input:
int((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2),x,method=_RETURNVERBOSE)
Output:
f^2*x/b/d+1/d^2*(c^2*f^2-2*c*d*e*f+d^2*e^2)/(a*d-b*c)*ln(d*x+c)-(a^2*f^2-2 *a*b*e*f+b^2*e^2)/(a*d-b*c)/b^2*ln(b*x+a)
Time = 0.11 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.59 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {{\left (b^{2} c d - a b d^{2}\right )} f^{2} x + {\left (b^{2} d^{2} e^{2} - 2 \, a b d^{2} e f + a^{2} d^{2} f^{2}\right )} \log \left (b x + a\right ) - {\left (b^{2} d^{2} e^{2} - 2 \, b^{2} c d e f + b^{2} c^{2} f^{2}\right )} \log \left (d x + c\right )}{b^{3} c d^{2} - a b^{2} d^{3}} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2),x, algorithm="fricas")
Output:
((b^2*c*d - a*b*d^2)*f^2*x + (b^2*d^2*e^2 - 2*a*b*d^2*e*f + a^2*d^2*f^2)*l og(b*x + a) - (b^2*d^2*e^2 - 2*b^2*c*d*e*f + b^2*c^2*f^2)*log(d*x + c))/(b ^3*c*d^2 - a*b^2*d^3)
Leaf count of result is larger than twice the leaf count of optimal. 408 vs. \(2 (58) = 116\).
Time = 5.14 (sec) , antiderivative size = 408, normalized size of antiderivative = 5.59 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {\left (c f - d e\right )^{2} \log {\left (x + \frac {- \frac {a^{2} b d \left (c f - d e\right )^{2}}{a d - b c} + a^{2} c d f^{2} + \frac {2 a b^{2} c \left (c f - d e\right )^{2}}{a d - b c} + a b c^{2} f^{2} - 4 a b c d e f + a b d^{2} e^{2} - \frac {b^{3} c^{2} \left (c f - d e\right )^{2}}{d \left (a d - b c\right )} + b^{2} c d e^{2}}{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 )}}{d^{2} \left (a d - b c\right )} + \frac {f^{2} x}{b d} - \frac {\left (a f - b e\right )^{2} \log {\left (x + \frac {a^{2} c d f^{2} + \frac {a^{2} d^{3} \left (a f - b e\right )^{2}}{b \left (a d - b c\right )} + a b c^{2} f^{2} - 4 a b c d e f + a b d^{2} e^{2} - \frac {2 a c d^{2} \left (a f - b e\right )^{2}}{a d - b c} + b^{2} c d e^{2} + \frac {b c^{2} d \left (a f - b e\right )^{2}}{a d - b c}}{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^{2} \left (a d - b c\right )} \] Input:
integrate((f*x+e)**2/(a*c+(a*d+b*c)*x+b*d*x**2),x)
Output:
(c*f - d*e)**2*log(x + (-a**2*b*d*(c*f - d*e)**2/(a*d - b*c) + a**2*c*d*f* *2 + 2*a*b**2*c*(c*f - d*e)**2/(a*d - b*c) + a*b*c**2*f**2 - 4*a*b*c*d*e*f + a*b*d**2*e**2 - b**3*c**2*(c*f - d*e)**2/(d*(a*d - b*c)) + b**2*c*d*e** 2)/(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))/(d**2*(a*d - b*c)) + f**2*x/(b*d) - (a*f - b*e)**2*log(x + (a**2*c*d*f**2 + a**2*d**3*(a*f - b*e)**2/(b*(a*d - b*c)) + a*b*c**2*f** 2 - 4*a*b*c*d*e*f + a*b*d**2*e**2 - 2*a*c*d**2*(a*f - b*e)**2/(a*d - b*c) + b**2*c*d*e**2 + b*c**2*d*(a*f - b*e)**2/(a*d - b*c))/(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))/(b**2 *(a*d - b*c))
Time = 0.05 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.36 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {f^{2} x}{b d} + \frac {{\left (b^{2} e^{2} - 2 \, a b e f + a^{2} f^{2}\right )} \log \left (b x + a\right )}{b^{3} c - a b^{2} d} - \frac {{\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left (d x + c\right )}{b c d^{2} - a d^{3}} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2),x, algorithm="maxima")
Output:
f^2*x/(b*d) + (b^2*e^2 - 2*a*b*e*f + a^2*f^2)*log(b*x + a)/(b^3*c - a*b^2* d) - (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(d*x + c)/(b*c*d^2 - a*d^3)
Time = 0.36 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.38 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {f^{2} x}{b d} + \frac {{\left (b^{2} e^{2} - 2 \, a b e f + a^{2} f^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{b^{3} c - a b^{2} d} - \frac {{\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left ({\left | d x + c \right |}\right )}{b c d^{2} - a d^{3}} \] Input:
integrate((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2),x, algorithm="giac")
Output:
f^2*x/(b*d) + (b^2*e^2 - 2*a*b*e*f + a^2*f^2)*log(abs(b*x + a))/(b^3*c - a *b^2*d) - (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(abs(d*x + c))/(b*c*d^2 - a*d ^3)
Time = 0.25 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.16 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {\ln \left (a+b\,x\right )\,\left (a^2\,f^2-2\,a\,b\,e\,f+b^2\,e^2\right )}{b^3\,c-a\,b^2\,d}+\frac {f^2\,x}{b\,d}+\frac {\ln \left (c+d\,x\right )\,{\left (c\,f-d\,e\right )}^2}{d^2\,\left (a\,d-b\,c\right )} \] Input:
int((e + f*x)^2/(a*c + x*(a*d + b*c) + b*d*x^2),x)
Output:
(log(a + b*x)*(a^2*f^2 + b^2*e^2 - 2*a*b*e*f))/(b^3*c - a*b^2*d) + (f^2*x) /(b*d) + (log(c + d*x)*(c*f - d*e)^2)/(d^2*(a*d - b*c))
Time = 0.20 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.85 \[ \int \frac {(e+f x)^2}{a c+(b c+a d) x+b d x^2} \, dx=\frac {-\mathrm {log}\left (b x +a \right ) a^{2} d^{2} f^{2}+2 \,\mathrm {log}\left (b x +a \right ) a b \,d^{2} e f -\mathrm {log}\left (b x +a \right ) b^{2} d^{2} e^{2}+\mathrm {log}\left (d x +c \right ) b^{2} c^{2} f^{2}-2 \,\mathrm {log}\left (d x +c \right ) b^{2} c d e f +\mathrm {log}\left (d x +c \right ) b^{2} d^{2} e^{2}+a b \,d^{2} f^{2} x -b^{2} c d \,f^{2} x}{b^{2} d^{2} \left (a d -b c \right )} \] Input:
int((f*x+e)^2/(a*c+(a*d+b*c)*x+b*d*x^2),x)
Output:
( - log(a + b*x)*a**2*d**2*f**2 + 2*log(a + b*x)*a*b*d**2*e*f - log(a + b* x)*b**2*d**2*e**2 + log(c + d*x)*b**2*c**2*f**2 - 2*log(c + d*x)*b**2*c*d* e*f + log(c + d*x)*b**2*d**2*e**2 + a*b*d**2*f**2*x - b**2*c*d*f**2*x)/(b* *2*d**2*(a*d - b*c))