3.7.73 \(\int \frac {1+x-x^2}{4 x^2} \, dx\)

Optimal. Leaf size=16 \[ \frac {1}{4} \left (-5-\frac {1}{x}-x+\log (x)\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.19, number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {12, 14} \begin {gather*} -\frac {x}{4}-\frac {1}{4 x}+\frac {\log (x)}{4} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + x - x^2)/(4*x^2),x]

[Out]

-1/4*1/x - x/4 + Log[x]/4

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\frac {1}{4} \int \frac {1+x-x^2}{x^2} \, dx\\ &=\frac {1}{4} \int \left (-1+\frac {1}{x^2}+\frac {1}{x}\right ) \, dx\\ &=-\frac {1}{4 x}-\frac {x}{4}+\frac {\log (x)}{4}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 15, normalized size = 0.94 \begin {gather*} \frac {1}{4} \left (-\frac {1}{x}-x+\log (x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + x - x^2)/(4*x^2),x]

[Out]

(-x^(-1) - x + Log[x])/4

________________________________________________________________________________________

fricas [A]  time = 1.38, size = 15, normalized size = 0.94 \begin {gather*} -\frac {x^{2} - x \log \relax (x) + 1}{4 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/4*(-x^2+x+1)/x^2,x, algorithm="fricas")

[Out]

-1/4*(x^2 - x*log(x) + 1)/x

________________________________________________________________________________________

giac [A]  time = 0.26, size = 14, normalized size = 0.88 \begin {gather*} -\frac {1}{4} \, x - \frac {1}{4 \, x} + \frac {1}{4} \, \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/4*(-x^2+x+1)/x^2,x, algorithm="giac")

[Out]

-1/4*x - 1/4/x + 1/4*log(abs(x))

________________________________________________________________________________________

maple [A]  time = 0.02, size = 14, normalized size = 0.88




method result size



default \(-\frac {x}{4}+\frac {\ln \relax (x )}{4}-\frac {1}{4 x}\) \(14\)
risch \(-\frac {x}{4}+\frac {\ln \relax (x )}{4}-\frac {1}{4 x}\) \(14\)
norman \(\frac {-\frac {1}{4}-\frac {x^{2}}{4}}{x}+\frac {\ln \relax (x )}{4}\) \(17\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/4*(-x^2+x+1)/x^2,x,method=_RETURNVERBOSE)

[Out]

-1/4*x+1/4*ln(x)-1/4/x

________________________________________________________________________________________

maxima [A]  time = 0.57, size = 13, normalized size = 0.81 \begin {gather*} -\frac {1}{4} \, x - \frac {1}{4 \, x} + \frac {1}{4} \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/4*(-x^2+x+1)/x^2,x, algorithm="maxima")

[Out]

-1/4*x - 1/4/x + 1/4*log(x)

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 13, normalized size = 0.81 \begin {gather*} \frac {\ln \relax (x)}{4}-\frac {x}{4}-\frac {1}{4\,x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x/4 - x^2/4 + 1/4)/x^2,x)

[Out]

log(x)/4 - x/4 - 1/(4*x)

________________________________________________________________________________________

sympy [A]  time = 0.07, size = 12, normalized size = 0.75 \begin {gather*} - \frac {x}{4} + \frac {\log {\relax (x )}}{4} - \frac {1}{4 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/4*(-x**2+x+1)/x**2,x)

[Out]

-x/4 + log(x)/4 - 1/(4*x)

________________________________________________________________________________________