\(\int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx\) [253]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 12 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\log \left (a+\sqrt {1+x^2}\right ) \]

[Out]

ln(a+(x^2+1)^(1/2))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2186, 31} \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\log \left (a+\sqrt {x^2+1}\right ) \]

[In]

Int[x/(1 + x^2 + a*Sqrt[1 + x^2]),x]

[Out]

Log[a + Sqrt[1 + x^2]]

Rule 31

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

Rule 2186

Int[(x_)^(m_.)/((c_) + (d_.)*(x_)^(n_) + (e_.)*Sqrt[(a_) + (b_.)*(x_)^(n_)]), x_Symbol] :> Dist[1/n, Subst[Int
[x^((m + 1)/n - 1)/(c + d*x + e*Sqrt[a + b*x]), x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && EqQ[b*c
- a*d, 0] && IntegerQ[(m + 1)/n]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int \frac {1}{1+x+a \sqrt {1+x}} \, dx,x,x^2\right ) \\ & = \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,\sqrt {1+x^2}\right ) \\ & = \log \left (a+\sqrt {1+x^2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\log \left (a+\sqrt {1+x^2}\right ) \]

[In]

Integrate[x/(1 + x^2 + a*Sqrt[1 + x^2]),x]

[Out]

Log[a + Sqrt[1 + x^2]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(353\) vs. \(2(10)=20\).

Time = 0.08 (sec) , antiderivative size = 354, normalized size of antiderivative = 29.50

method result size
default \(\frac {\sqrt {x^{2}+1}}{a}-\frac {\sqrt {\left (x -\sqrt {\left (1+a \right ) \left (a -1\right )}\right )^{2}+2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x -\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+a^{2}}}{2 a}+\frac {a \ln \left (\frac {2 a^{2}+2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x -\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+2 \sqrt {a^{2}}\, \sqrt {\left (x -\sqrt {\left (1+a \right ) \left (a -1\right )}\right )^{2}+2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x -\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+a^{2}}}{x -\sqrt {\left (1+a \right ) \left (a -1\right )}}\right )}{2 \sqrt {a^{2}}}-\frac {\sqrt {\left (x +\sqrt {\left (1+a \right ) \left (a -1\right )}\right )^{2}-2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x +\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+a^{2}}}{2 a}+\frac {a \ln \left (\frac {2 a^{2}-2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x +\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+2 \sqrt {a^{2}}\, \sqrt {\left (x +\sqrt {\left (1+a \right ) \left (a -1\right )}\right )^{2}-2 \sqrt {\left (1+a \right ) \left (a -1\right )}\, \left (x +\sqrt {\left (1+a \right ) \left (a -1\right )}\right )+a^{2}}}{x +\sqrt {\left (1+a \right ) \left (a -1\right )}}\right )}{2 \sqrt {a^{2}}}+\frac {\ln \left (-a^{2}+x^{2}+1\right )}{2 a^{2}}-\frac {\left (-a^{2}+1\right ) \ln \left (-a^{2}+x^{2}+1\right )}{2 a^{2}}\) \(354\)

[In]

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

[Out]

1/a*(x^2+1)^(1/2)-1/2/a*((x-((1+a)*(a-1))^(1/2))^2+2*((1+a)*(a-1))^(1/2)*(x-((1+a)*(a-1))^(1/2))+a^2)^(1/2)+1/
2*a/(a^2)^(1/2)*ln((2*a^2+2*((1+a)*(a-1))^(1/2)*(x-((1+a)*(a-1))^(1/2))+2*(a^2)^(1/2)*((x-((1+a)*(a-1))^(1/2))
^2+2*((1+a)*(a-1))^(1/2)*(x-((1+a)*(a-1))^(1/2))+a^2)^(1/2))/(x-((1+a)*(a-1))^(1/2)))-1/2/a*((x+((1+a)*(a-1))^
(1/2))^2-2*((1+a)*(a-1))^(1/2)*(x+((1+a)*(a-1))^(1/2))+a^2)^(1/2)+1/2*a/(a^2)^(1/2)*ln((2*a^2-2*((1+a)*(a-1))^
(1/2)*(x+((1+a)*(a-1))^(1/2))+2*(a^2)^(1/2)*((x+((1+a)*(a-1))^(1/2))^2-2*((1+a)*(a-1))^(1/2)*(x+((1+a)*(a-1))^
(1/2))+a^2)^(1/2))/(x+((1+a)*(a-1))^(1/2)))+1/2/a^2*ln(-a^2+x^2+1)-1/2*(-a^2+1)/a^2*ln(-a^2+x^2+1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 62 vs. \(2 (10) = 20\).

Time = 0.24 (sec) , antiderivative size = 62, normalized size of antiderivative = 5.17 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\frac {1}{2} \, \log \left (-a^{2} + x^{2} + 1\right ) - \frac {1}{2} \, \log \left (a x + x^{2} - \sqrt {x^{2} + 1} {\left (a + x\right )} + 1\right ) + \frac {1}{2} \, \log \left (-a x + x^{2} + \sqrt {x^{2} + 1} {\left (a - x\right )} + 1\right ) \]

[In]

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

[Out]

1/2*log(-a^2 + x^2 + 1) - 1/2*log(a*x + x^2 - sqrt(x^2 + 1)*(a + x) + 1) + 1/2*log(-a*x + x^2 + sqrt(x^2 + 1)*
(a - x) + 1)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (10) = 20\).

Time = 0.74 (sec) , antiderivative size = 58, normalized size of antiderivative = 4.83 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=- a \left (- \frac {\log {\left (2 a + 2 \sqrt {x^{2} + 1} \right )}}{2 a} + \frac {\log {\left (- 2 \sqrt {x^{2} + 1} \right )}}{2 a}\right ) + \frac {\log {\left (2 a \sqrt {x^{2} + 1} + 2 x^{2} + 2 \right )}}{2} \]

[In]

integrate(x/(1+x**2+a*(x**2+1)**(1/2)),x)

[Out]

-a*(-log(2*a + 2*sqrt(x**2 + 1))/(2*a) + log(-2*sqrt(x**2 + 1))/(2*a)) + log(2*a*sqrt(x**2 + 1) + 2*x**2 + 2)/
2

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\log \left (a + \sqrt {x^{2} + 1}\right ) \]

[In]

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

[Out]

log(a + sqrt(x^2 + 1))

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.92 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\log \left ({\left | a + \sqrt {x^{2} + 1} \right |}\right ) \]

[In]

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

[Out]

log(abs(a + sqrt(x^2 + 1)))

Mupad [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 154, normalized size of antiderivative = 12.83 \[ \int \frac {x}{1+x^2+a \sqrt {1+x^2}} \, dx=\frac {\ln \left (x+\sqrt {a-1}\,\sqrt {a+1}\right )}{2}+\frac {\ln \left (x-\sqrt {a-1}\,\sqrt {a+1}\right )}{2}-\frac {a\,\left (\ln \left (x+\sqrt {a-1}\,\sqrt {a+1}\right )-\ln \left (\sqrt {x^2+1}\,\sqrt {a^2}-x\,\sqrt {a-1}\,\sqrt {a+1}+1\right )\right )}{2\,\sqrt {\left (a-1\right )\,\left (a+1\right )+1}}-\frac {a\,\left (\ln \left (x-\sqrt {a-1}\,\sqrt {a+1}\right )-\ln \left (\sqrt {x^2+1}\,\sqrt {a^2}+x\,\sqrt {a-1}\,\sqrt {a+1}+1\right )\right )}{2\,\sqrt {\left (a-1\right )\,\left (a+1\right )+1}} \]

[In]

int(x/(a*(x^2 + 1)^(1/2) + x^2 + 1),x)

[Out]

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