3.261 $$\int \frac{(d+e x)^2}{b x+c x^2} \, dx$$

Optimal. Leaf size=42 $-\frac{(c d-b e)^2 \log (b+c x)}{b c^2}+\frac{d^2 \log (x)}{b}+\frac{e^2 x}{c}$

[Out]

(e^2*x)/c + (d^2*Log[x])/b - ((c*d - b*e)^2*Log[b + c*x])/(b*c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0335049, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 19, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.053, Rules used = {698} $-\frac{(c d-b e)^2 \log (b+c x)}{b c^2}+\frac{d^2 \log (x)}{b}+\frac{e^2 x}{c}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(e^2*x)/c + (d^2*Log[x])/b - ((c*d - b*e)^2*Log[b + c*x])/(b*c^2)

Rule 698

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*
e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && IntegerQ[p] && (GtQ[p, 0] || (EqQ[a, 0] && IntegerQ[m]))

Rubi steps

\begin{align*} \int \frac{(d+e x)^2}{b x+c x^2} \, dx &=\int \left (\frac{e^2}{c}+\frac{d^2}{b x}-\frac{(-c d+b e)^2}{b c (b+c x)}\right ) \, dx\\ &=\frac{e^2 x}{c}+\frac{d^2 \log (x)}{b}-\frac{(c d-b e)^2 \log (b+c x)}{b c^2}\\ \end{align*}

Mathematica [A]  time = 0.0185061, size = 42, normalized size = 1. $\frac{-(c d-b e)^2 \log (b+c x)+b c e^2 x+c^2 d^2 \log (x)}{b c^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(b*c*e^2*x + c^2*d^2*Log[x] - (c*d - b*e)^2*Log[b + c*x])/(b*c^2)

________________________________________________________________________________________

Maple [A]  time = 0.052, size = 61, normalized size = 1.5 \begin{align*}{\frac{{e}^{2}x}{c}}+{\frac{{d}^{2}\ln \left ( x \right ) }{b}}-{\frac{b\ln \left ( cx+b \right ){e}^{2}}{{c}^{2}}}+2\,{\frac{\ln \left ( cx+b \right ) de}{c}}-{\frac{\ln \left ( cx+b \right ){d}^{2}}{b}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.1029, size = 72, normalized size = 1.71 \begin{align*} \frac{e^{2} x}{c} + \frac{d^{2} \log \left (x\right )}{b} - \frac{{\left (c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2}\right )} \log \left (c x + b\right )}{b c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

e^2*x/c + d^2*log(x)/b - (c^2*d^2 - 2*b*c*d*e + b^2*e^2)*log(c*x + b)/(b*c^2)

________________________________________________________________________________________

Fricas [A]  time = 1.68877, size = 115, normalized size = 2.74 \begin{align*} \frac{b c e^{2} x + c^{2} d^{2} \log \left (x\right ) -{\left (c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2}\right )} \log \left (c x + b\right )}{b c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(b*c*e^2*x + c^2*d^2*log(x) - (c^2*d^2 - 2*b*c*d*e + b^2*e^2)*log(c*x + b))/(b*c^2)

________________________________________________________________________________________

Sympy [B]  time = 2.63886, size = 73, normalized size = 1.74 \begin{align*} \frac{e^{2} x}{c} + \frac{d^{2} \log{\left (x \right )}}{b} - \frac{\left (b e - c d\right )^{2} \log{\left (x + \frac{b c d^{2} + \frac{b \left (b e - c d\right )^{2}}{c}}{b^{2} e^{2} - 2 b c d e + 2 c^{2} d^{2}} \right )}}{b c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

e**2*x/c + d**2*log(x)/b - (b*e - c*d)**2*log(x + (b*c*d**2 + b*(b*e - c*d)**2/c)/(b**2*e**2 - 2*b*c*d*e + 2*c
**2*d**2))/(b*c**2)

________________________________________________________________________________________

Giac [A]  time = 1.28209, size = 73, normalized size = 1.74 \begin{align*} \frac{d^{2} \log \left ({\left | x \right |}\right )}{b} + \frac{x e^{2}}{c} - \frac{{\left (c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2}\right )} \log \left ({\left | c x + b \right |}\right )}{b c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

d^2*log(abs(x))/b + x*e^2/c - (c^2*d^2 - 2*b*c*d*e + b^2*e^2)*log(abs(c*x + b))/(b*c^2)