Integrand size = 25, antiderivative size = 94 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {(b B+A c) x}{f}+\frac {B c x^2}{2 f}-\frac {(b B d+A c d-a A f) \arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d} f^{3/2}}-\frac {(B c d-A b f-a B f) \log \left (d+f x^2\right )}{2 f^2} \] Output:
(A*c+B*b)*x/f+1/2*B*c*x^2/f-(-A*a*f+A*c*d+B*b*d)*arctan(f^(1/2)*x/d^(1/2)) /d^(1/2)/f^(3/2)-1/2*(-A*b*f-B*a*f+B*c*d)*ln(f*x^2+d)/f^2
Time = 0.09 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.91 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {f x (2 b B+2 A c+B c x)-\frac {2 \sqrt {f} (b B d+A c d-a A f) \arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d}}+(-B c d+A b f+a B f) \log \left (d+f x^2\right )}{2 f^2} \] Input:
Integrate[((A + B*x)*(a + b*x + c*x^2))/(d + f*x^2),x]
Output:
(f*x*(2*b*B + 2*A*c + B*c*x) - (2*Sqrt[f]*(b*B*d + A*c*d - a*A*f)*ArcTan[( Sqrt[f]*x)/Sqrt[d]])/Sqrt[d] + (-(B*c*d) + A*b*f + a*B*f)*Log[d + f*x^2])/ (2*f^2)
Time = 0.29 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {2160, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx\) |
\(\Big \downarrow \) 2160 |
\(\displaystyle \int \left (-\frac {x (-a B f-A b f+B c d)-a A f+A c d+b B d}{f \left (d+f x^2\right )}+\frac {A c+b B}{f}+\frac {B c x}{f}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) (-a A f+A c d+b B d)}{\sqrt {d} f^{3/2}}-\frac {\log \left (d+f x^2\right ) (-a B f-A b f+B c d)}{2 f^2}+\frac {x (A c+b B)}{f}+\frac {B c x^2}{2 f}\) |
Input:
Int[((A + B*x)*(a + b*x + c*x^2))/(d + f*x^2),x]
Output:
((b*B + A*c)*x)/f + (B*c*x^2)/(2*f) - ((b*B*d + A*c*d - a*A*f)*ArcTan[(Sqr t[f]*x)/Sqrt[d]])/(Sqrt[d]*f^(3/2)) - ((B*c*d - A*b*f - a*B*f)*Log[d + f*x ^2])/(2*f^2)
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Time = 1.04 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.89
method | result | size |
default | \(\frac {\frac {1}{2} B c \,x^{2}+A c x +B b x}{f}+\frac {\frac {\left (A b f +B a f -B c d \right ) \ln \left (f \,x^{2}+d \right )}{2 f}+\frac {\left (A a f -A c d -B b d \right ) \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}}}{f}\) | \(84\) |
risch | \(\frac {B c \,x^{2}}{2 f}+\frac {A c x}{f}+\frac {B b x}{f}+\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}-\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) A b}{2 f}+\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}-\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) B a}{2 f}-\frac {d \ln \left (A a f d -A c \,d^{2}-B b \,d^{2}-\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) B c}{2 f^{2}}+\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}-\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) \sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}}{2 f^{2} d}+\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}+\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) A b}{2 f}+\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}+\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) B a}{2 f}-\frac {d \ln \left (A a f d -A c \,d^{2}-B b \,d^{2}+\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) B c}{2 f^{2}}-\frac {\ln \left (A a f d -A c \,d^{2}-B b \,d^{2}+\sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}\, x \right ) \sqrt {-d f \left (A a f -A c d -B b d \right )^{2}}}{2 f^{2} d}\) | \(504\) |
Input:
int((B*x+A)*(c*x^2+b*x+a)/(f*x^2+d),x,method=_RETURNVERBOSE)
Output:
1/f*(1/2*B*c*x^2+A*c*x+B*b*x)+1/f*(1/2*(A*b*f+B*a*f-B*c*d)/f*ln(f*x^2+d)+( A*a*f-A*c*d-B*b*d)/(d*f)^(1/2)*arctan(f*x/(d*f)^(1/2)))
Time = 0.08 (sec) , antiderivative size = 200, normalized size of antiderivative = 2.13 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\left [\frac {B c d f x^{2} + 2 \, {\left (B b + A c\right )} d f x - {\left (A a f - {\left (B b + A c\right )} d\right )} \sqrt {-d f} \log \left (\frac {f x^{2} - 2 \, \sqrt {-d f} x - d}{f x^{2} + d}\right ) - {\left (B c d^{2} - {\left (B a + A b\right )} d f\right )} \log \left (f x^{2} + d\right )}{2 \, d f^{2}}, \frac {B c d f x^{2} + 2 \, {\left (B b + A c\right )} d f x + 2 \, {\left (A a f - {\left (B b + A c\right )} d\right )} \sqrt {d f} \arctan \left (\frac {\sqrt {d f} x}{d}\right ) - {\left (B c d^{2} - {\left (B a + A b\right )} d f\right )} \log \left (f x^{2} + d\right )}{2 \, d f^{2}}\right ] \] Input:
integrate((B*x+A)*(c*x^2+b*x+a)/(f*x^2+d),x, algorithm="fricas")
Output:
[1/2*(B*c*d*f*x^2 + 2*(B*b + A*c)*d*f*x - (A*a*f - (B*b + A*c)*d)*sqrt(-d* f)*log((f*x^2 - 2*sqrt(-d*f)*x - d)/(f*x^2 + d)) - (B*c*d^2 - (B*a + A*b)* d*f)*log(f*x^2 + d))/(d*f^2), 1/2*(B*c*d*f*x^2 + 2*(B*b + A*c)*d*f*x + 2*( A*a*f - (B*b + A*c)*d)*sqrt(d*f)*arctan(sqrt(d*f)*x/d) - (B*c*d^2 - (B*a + A*b)*d*f)*log(f*x^2 + d))/(d*f^2)]
Leaf count of result is larger than twice the leaf count of optimal. 333 vs. \(2 (90) = 180\).
Time = 0.79 (sec) , antiderivative size = 333, normalized size of antiderivative = 3.54 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {B c x^{2}}{2 f} + x \left (\frac {A c}{f} + \frac {B b}{f}\right ) + \left (\frac {A b f + B a f - B c d}{2 f^{2}} - \frac {\sqrt {- d f^{5}} \left (A a f - A c d - B b d\right )}{2 d f^{4}}\right ) \log {\left (x + \frac {- A b d f - B a d f + B c d^{2} + 2 d f^{2} \left (\frac {A b f + B a f - B c d}{2 f^{2}} - \frac {\sqrt {- d f^{5}} \left (A a f - A c d - B b d\right )}{2 d f^{4}}\right )}{A a f^{2} - A c d f - B b d f} \right )} + \left (\frac {A b f + B a f - B c d}{2 f^{2}} + \frac {\sqrt {- d f^{5}} \left (A a f - A c d - B b d\right )}{2 d f^{4}}\right ) \log {\left (x + \frac {- A b d f - B a d f + B c d^{2} + 2 d f^{2} \left (\frac {A b f + B a f - B c d}{2 f^{2}} + \frac {\sqrt {- d f^{5}} \left (A a f - A c d - B b d\right )}{2 d f^{4}}\right )}{A a f^{2} - A c d f - B b d f} \right )} \] Input:
integrate((B*x+A)*(c*x**2+b*x+a)/(f*x**2+d),x)
Output:
B*c*x**2/(2*f) + x*(A*c/f + B*b/f) + ((A*b*f + B*a*f - B*c*d)/(2*f**2) - s qrt(-d*f**5)*(A*a*f - A*c*d - B*b*d)/(2*d*f**4))*log(x + (-A*b*d*f - B*a*d *f + B*c*d**2 + 2*d*f**2*((A*b*f + B*a*f - B*c*d)/(2*f**2) - sqrt(-d*f**5) *(A*a*f - A*c*d - B*b*d)/(2*d*f**4)))/(A*a*f**2 - A*c*d*f - B*b*d*f)) + (( A*b*f + B*a*f - B*c*d)/(2*f**2) + sqrt(-d*f**5)*(A*a*f - A*c*d - B*b*d)/(2 *d*f**4))*log(x + (-A*b*d*f - B*a*d*f + B*c*d**2 + 2*d*f**2*((A*b*f + B*a* f - B*c*d)/(2*f**2) + sqrt(-d*f**5)*(A*a*f - A*c*d - B*b*d)/(2*d*f**4)))/( A*a*f**2 - A*c*d*f - B*b*d*f))
Time = 0.12 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.89 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {{\left (A a f - {\left (B b + A c\right )} d\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f} + \frac {B c x^{2} + 2 \, {\left (B b + A c\right )} x}{2 \, f} - \frac {{\left (B c d - {\left (B a + A b\right )} f\right )} \log \left (f x^{2} + d\right )}{2 \, f^{2}} \] Input:
integrate((B*x+A)*(c*x^2+b*x+a)/(f*x^2+d),x, algorithm="maxima")
Output:
(A*a*f - (B*b + A*c)*d)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f) + 1/2*(B*c*x^2 + 2*(B*b + A*c)*x)/f - 1/2*(B*c*d - (B*a + A*b)*f)*log(f*x^2 + d)/f^2
Time = 0.12 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.93 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=-\frac {{\left (B b d + A c d - A a f\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f} - \frac {{\left (B c d - B a f - A b f\right )} \log \left (f x^{2} + d\right )}{2 \, f^{2}} + \frac {B c f x^{2} + 2 \, B b f x + 2 \, A c f x}{2 \, f^{2}} \] Input:
integrate((B*x+A)*(c*x^2+b*x+a)/(f*x^2+d),x, algorithm="giac")
Output:
-(B*b*d + A*c*d - A*a*f)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f) - 1/2*(B*c*d - B*a*f - A*b*f)*log(f*x^2 + d)/f^2 + 1/2*(B*c*f*x^2 + 2*B*b*f*x + 2*A*c*f *x)/f^2
Time = 0.15 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.03 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {x\,\left (A\,c+B\,b\right )}{f}-\frac {\mathrm {atan}\left (\frac {\sqrt {f}\,x}{\sqrt {d}}\right )\,\left (A\,c\,d-A\,a\,f+B\,b\,d\right )}{\sqrt {d}\,f^{3/2}}+\frac {B\,c\,x^2}{2\,f}+\frac {\ln \left (f\,x^2+d\right )\,\left (4\,A\,b\,d\,f^3+4\,B\,a\,d\,f^3-4\,B\,c\,d^2\,f^2\right )}{8\,d\,f^4} \] Input:
int(((A + B*x)*(a + b*x + c*x^2))/(d + f*x^2),x)
Output:
(x*(A*c + B*b))/f - (atan((f^(1/2)*x)/d^(1/2))*(A*c*d - A*a*f + B*b*d))/(d ^(1/2)*f^(3/2)) + (B*c*x^2)/(2*f) + (log(d + f*x^2)*(4*A*b*d*f^3 + 4*B*a*d *f^3 - 4*B*c*d^2*f^2))/(8*d*f^4)
Time = 0.16 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.34 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )}{d+f x^2} \, dx=\frac {2 \sqrt {f}\, \sqrt {d}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {d}}\right ) a^{2} f -2 \sqrt {f}\, \sqrt {d}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {d}}\right ) a c d -2 \sqrt {f}\, \sqrt {d}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {d}}\right ) b^{2} d +2 \,\mathrm {log}\left (f \,x^{2}+d \right ) a b d f -\mathrm {log}\left (f \,x^{2}+d \right ) b c \,d^{2}+2 a c d f x +2 b^{2} d f x +b c d f \,x^{2}}{2 d \,f^{2}} \] Input:
int((B*x+A)*(c*x^2+b*x+a)/(f*x^2+d),x)
Output:
(2*sqrt(f)*sqrt(d)*atan((f*x)/(sqrt(f)*sqrt(d)))*a**2*f - 2*sqrt(f)*sqrt(d )*atan((f*x)/(sqrt(f)*sqrt(d)))*a*c*d - 2*sqrt(f)*sqrt(d)*atan((f*x)/(sqrt (f)*sqrt(d)))*b**2*d + 2*log(d + f*x**2)*a*b*d*f - log(d + f*x**2)*b*c*d** 2 + 2*a*c*d*f*x + 2*b**2*d*f*x + b*c*d*f*x**2)/(2*d*f**2)