\(\int \frac {a+b x^3}{1+x^2} \, dx\) [279]

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

Optimal result

Integrand size = 15, antiderivative size = 24 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {b x^2}{2}+a \arctan (x)-\frac {1}{2} b \log \left (1+x^2\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {1824, 649, 209, 266} \[ \int \frac {a+b x^3}{1+x^2} \, dx=a \arctan (x)+\frac {b x^2}{2}-\frac {1}{2} b \log \left (x^2+1\right ) \]

[In]

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

[Out]

(b*x^2)/2 + a*ArcTan[x] - (b*Log[1 + x^2])/2

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 266

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

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 1824

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a,
b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {a+b x^3}{1+x^2} \, dx=a \arctan (x)+\frac {1}{2} b \left (x^2-\log \left (1+x^2\right )\right ) \]

[In]

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

[Out]

a*ArcTan[x] + (b*(x^2 - Log[1 + x^2]))/2

Maple [A] (verified)

Time = 0.82 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.88

method result size
default \(\frac {b \,x^{2}}{2}+a \arctan \left (x \right )-\frac {b \ln \left (x^{2}+1\right )}{2}\) \(21\)
meijerg \(\frac {b \left (x^{2}-\ln \left (x^{2}+1\right )\right )}{2}+a \arctan \left (x \right )\) \(21\)
risch \(\frac {b \,x^{2}}{2}+a \arctan \left (x \right )-\frac {b \ln \left (x^{2}+1\right )}{2}\) \(21\)
parallelrisch \(\frac {b \,x^{2}}{2}-\frac {\ln \left (x -i\right ) b}{2}-\frac {i \ln \left (x -i\right ) a}{2}-\frac {\ln \left (x +i\right ) b}{2}+\frac {i \ln \left (x +i\right ) a}{2}\) \(42\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {1}{2} \, b x^{2} + a \arctan \left (x\right ) - \frac {1}{2} \, b \log \left (x^{2} + 1\right ) \]

[In]

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

[Out]

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

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.08 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.42 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {b x^{2}}{2} + \left (- \frac {i a}{2} - \frac {b}{2}\right ) \log {\left (x - i \right )} + \left (\frac {i a}{2} - \frac {b}{2}\right ) \log {\left (x + i \right )} \]

[In]

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

[Out]

b*x**2/2 + (-I*a/2 - b/2)*log(x - I) + (I*a/2 - b/2)*log(x + I)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {1}{2} \, b x^{2} + a \arctan \left (x\right ) - \frac {1}{2} \, b \log \left (x^{2} + 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {1}{2} \, b x^{2} + a \arctan \left (x\right ) - \frac {1}{2} \, b \log \left (x^{2} + 1\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.34 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {a+b x^3}{1+x^2} \, dx=\frac {b\,x^2}{2}-\frac {b\,\ln \left (x^2+1\right )}{2}+a\,\mathrm {atan}\left (x\right ) \]

[In]

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

[Out]

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