3.6.47 \(\int \frac {1}{d f+(e f+d g) x+e g x^2} \, dx\) [547]

Optimal. Leaf size=36 \[ \frac {\log (d+e x)}{e f-d g}-\frac {\log (f+g x)}{e f-d g} \]

[Out]

ln(e*x+d)/(-d*g+e*f)-ln(g*x+f)/(-d*g+e*f)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {630, 31} \begin {gather*} \frac {\log (d+e x)}{e f-d g}-\frac {\log (f+g x)}{e f-d g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*f + (e*f + d*g)*x + e*g*x^2)^(-1),x]

[Out]

Log[d + e*x]/(e*f - d*g) - Log[f + g*x]/(e*f - d*g)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 630

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rubi steps

\begin {align*} \int \frac {1}{d f+(e f+d g) x+e g x^2} \, dx &=-\frac {(e g) \int \frac {1}{e f+e g x} \, dx}{e f-d g}+\frac {(e g) \int \frac {1}{d g+e g x} \, dx}{e f-d g}\\ &=\frac {\log (d+e x)}{e f-d g}-\frac {\log (f+g x)}{e f-d g}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 26, normalized size = 0.72 \begin {gather*} \frac {\log (d+e x)-\log (f+g x)}{e f-d g} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*f + (e*f + d*g)*x + e*g*x^2)^(-1),x]

[Out]

(Log[d + e*x] - Log[f + g*x])/(e*f - d*g)

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 37, normalized size = 1.03

method result size
default \(-\frac {\ln \left (e x +d \right )}{d g -e f}+\frac {\ln \left (g x +f \right )}{d g -e f}\) \(37\)
norman \(-\frac {\ln \left (e x +d \right )}{d g -e f}+\frac {\ln \left (g x +f \right )}{d g -e f}\) \(37\)
risch \(-\frac {\ln \left (e x +d \right )}{d g -e f}+\frac {\ln \left (-g x -f \right )}{d g -e f}\) \(40\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(d*f+(d*g+e*f)*x+e*g*x^2),x,method=_RETURNVERBOSE)

[Out]

-1/(d*g-e*f)*ln(e*x+d)+1/(d*g-e*f)*ln(g*x+f)

________________________________________________________________________________________

Maxima [A]
time = 0.32, size = 36, normalized size = 1.00 \begin {gather*} \frac {\log \left (e x + d\right )}{e f - d g} - \frac {\log \left (g x + f\right )}{e f - d g} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(d*f+(d*g+e*f)*x+e*g*x^2),x, algorithm="maxima")

[Out]

log(e*x + d)/(e*f - d*g) - log(g*x + f)/(e*f - d*g)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 28, normalized size = 0.78 \begin {gather*} \frac {\log \left (g x + f\right ) - \log \left (x e + d\right )}{d g - f e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(d*f+(d*g+e*f)*x+e*g*x^2),x, algorithm="fricas")

[Out]

(log(g*x + f) - log(x*e + d))/(d*g - f*e)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (26) = 52\).
time = 0.16, size = 128, normalized size = 3.56 \begin {gather*} \frac {\log {\left (x + \frac {- \frac {d^{2} g^{2}}{d g - e f} + \frac {2 d e f g}{d g - e f} + d g - \frac {e^{2} f^{2}}{d g - e f} + e f}{2 e g} \right )}}{d g - e f} - \frac {\log {\left (x + \frac {\frac {d^{2} g^{2}}{d g - e f} - \frac {2 d e f g}{d g - e f} + d g + \frac {e^{2} f^{2}}{d g - e f} + e f}{2 e g} \right )}}{d g - e f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(d*f+(d*g+e*f)*x+e*g*x**2),x)

[Out]

log(x + (-d**2*g**2/(d*g - e*f) + 2*d*e*f*g/(d*g - e*f) + d*g - e**2*f**2/(d*g - e*f) + e*f)/(2*e*g))/(d*g - e
*f) - log(x + (d**2*g**2/(d*g - e*f) - 2*d*e*f*g/(d*g - e*f) + d*g + e**2*f**2/(d*g - e*f) + e*f)/(2*e*g))/(d*
g - e*f)

________________________________________________________________________________________

Giac [A]
time = 4.79, size = 49, normalized size = 1.36 \begin {gather*} \frac {g \log \left ({\left | g x + f \right |}\right )}{d g^{2} - f g e} - \frac {e \log \left ({\left | x e + d \right |}\right )}{d g e - f e^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(d*f+(d*g+e*f)*x+e*g*x^2),x, algorithm="giac")

[Out]

g*log(abs(g*x + f))/(d*g^2 - f*g*e) - e*log(abs(x*e + d))/(d*g*e - f*e^2)

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 40, normalized size = 1.11 \begin {gather*} \frac {\mathrm {atan}\left (\frac {e\,f\,2{}\mathrm {i}+e\,g\,x\,2{}\mathrm {i}}{d\,g-e\,f}+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d\,g-e\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(d*f + x*(d*g + e*f) + e*g*x^2),x)

[Out]

(atan((e*f*2i + e*g*x*2i)/(d*g - e*f) + 1i)*2i)/(d*g - e*f)

________________________________________________________________________________________