Integrand size = 19, antiderivative size = 82 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {(b c-a d) (3 b c+a d) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}} \] Output:
b^2*x/d^2+1/2*(-a*d+b*c)^2*x/c/d^2/(d*x^2+c)-1/2*(-a*d+b*c)*(a*d+3*b*c)*ar ctan(d^(1/2)*x/c^(1/2))/c^(3/2)/d^(5/2)
Time = 0.04 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.09 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {\left (3 b^2 c^2-2 a b c d-a^2 d^2\right ) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}} \] Input:
Integrate[(a + b*x^2)^2/(c + d*x^2)^2,x]
Output:
(b^2*x)/d^2 + ((b*c - a*d)^2*x)/(2*c*d^2*(c + d*x^2)) - ((3*b^2*c^2 - 2*a* b*c*d - a^2*d^2)*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(2*c^(3/2)*d^(5/2))
Time = 0.25 (sec) , antiderivative size = 82, 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.105, Rules used = {300, 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 {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \int \left (\frac {b^2}{d^2}-\frac {-a^2 d^2+2 b d x^2 (b c-a d)+b^2 c^2}{d^2 \left (c+d x^2\right )^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {(b c-a d) (a d+3 b c) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}+\frac {x (b c-a d)^2}{2 c d^2 \left (c+d x^2\right )}+\frac {b^2 x}{d^2}\) |
Input:
Int[(a + b*x^2)^2/(c + d*x^2)^2,x]
Output:
(b^2*x)/d^2 + ((b*c - a*d)^2*x)/(2*c*d^2*(c + d*x^2)) - ((b*c - a*d)*(3*b* c + a*d)*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(2*c^(3/2)*d^(5/2))
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Time = 0.41 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.12
method | result | size |
default | \(\frac {b^{2} x}{d^{2}}+\frac {\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 c \left (x^{2} d +c \right )}+\frac {\left (a^{2} d^{2}+2 a b c d -3 b^{2} c^{2}\right ) \arctan \left (\frac {x d}{\sqrt {c d}}\right )}{2 c \sqrt {c d}}}{d^{2}}\) | \(92\) |
risch | \(\frac {b^{2} x}{d^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 c \,d^{2} \left (x^{2} d +c \right )}-\frac {\ln \left (x d +\sqrt {-c d}\right ) a^{2}}{4 \sqrt {-c d}\, c}-\frac {\ln \left (x d +\sqrt {-c d}\right ) a b}{2 d \sqrt {-c d}}+\frac {3 c \ln \left (x d +\sqrt {-c d}\right ) b^{2}}{4 d^{2} \sqrt {-c d}}+\frac {\ln \left (-x d +\sqrt {-c d}\right ) a^{2}}{4 \sqrt {-c d}\, c}+\frac {\ln \left (-x d +\sqrt {-c d}\right ) a b}{2 d \sqrt {-c d}}-\frac {3 c \ln \left (-x d +\sqrt {-c d}\right ) b^{2}}{4 d^{2} \sqrt {-c d}}\) | \(202\) |
Input:
int((b*x^2+a)^2/(d*x^2+c)^2,x,method=_RETURNVERBOSE)
Output:
b^2*x/d^2+1/d^2*(1/2*(a^2*d^2-2*a*b*c*d+b^2*c^2)/c*x/(d*x^2+c)+1/2*(a^2*d^ 2+2*a*b*c*d-3*b^2*c^2)/c/(c*d)^(1/2)*arctan(x*d/(c*d)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (70) = 140\).
Time = 0.16 (sec) , antiderivative size = 302, normalized size of antiderivative = 3.68 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\left [\frac {4 \, b^{2} c^{2} d^{2} x^{3} + {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {-c d} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right ) + 2 \, {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{4 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}, \frac {2 \, b^{2} c^{2} d^{2} x^{3} - {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right ) + {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{2 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}\right ] \] Input:
integrate((b*x^2+a)^2/(d*x^2+c)^2,x, algorithm="fricas")
Output:
[1/4*(4*b^2*c^2*d^2*x^3 + (3*b^2*c^3 - 2*a*b*c^2*d - a^2*c*d^2 + (3*b^2*c^ 2*d - 2*a*b*c*d^2 - a^2*d^3)*x^2)*sqrt(-c*d)*log((d*x^2 - 2*sqrt(-c*d)*x - c)/(d*x^2 + c)) + 2*(3*b^2*c^3*d - 2*a*b*c^2*d^2 + a^2*c*d^3)*x)/(c^2*d^4 *x^2 + c^3*d^3), 1/2*(2*b^2*c^2*d^2*x^3 - (3*b^2*c^3 - 2*a*b*c^2*d - a^2*c *d^2 + (3*b^2*c^2*d - 2*a*b*c*d^2 - a^2*d^3)*x^2)*sqrt(c*d)*arctan(sqrt(c* d)*x/c) + (3*b^2*c^3*d - 2*a*b*c^2*d^2 + a^2*c*d^3)*x)/(c^2*d^4*x^2 + c^3* d^3)]
Leaf count of result is larger than twice the leaf count of optimal. 236 vs. \(2 (73) = 146\).
Time = 0.35 (sec) , antiderivative size = 236, normalized size of antiderivative = 2.88 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {b^{2} x}{d^{2}} + \frac {x \left (a^{2} d^{2} - 2 a b c d + b^{2} c^{2}\right )}{2 c^{2} d^{2} + 2 c d^{3} x^{2}} - \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (- \frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} + \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (\frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} \] Input:
integrate((b*x**2+a)**2/(d*x**2+c)**2,x)
Output:
b**2*x/d**2 + x*(a**2*d**2 - 2*a*b*c*d + b**2*c**2)/(2*c**2*d**2 + 2*c*d** 3*x**2) - sqrt(-1/(c**3*d**5))*(a*d - b*c)*(a*d + 3*b*c)*log(-c**2*d**2*sq rt(-1/(c**3*d**5))*(a*d - b*c)*(a*d + 3*b*c)/(a**2*d**2 + 2*a*b*c*d - 3*b* *2*c**2) + x)/4 + sqrt(-1/(c**3*d**5))*(a*d - b*c)*(a*d + 3*b*c)*log(c**2* d**2*sqrt(-1/(c**3*d**5))*(a*d - b*c)*(a*d + 3*b*c)/(a**2*d**2 + 2*a*b*c*d - 3*b**2*c**2) + x)/4
Time = 0.15 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.17 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x}{2 \, {\left (c d^{3} x^{2} + c^{2} d^{2}\right )}} + \frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} \] Input:
integrate((b*x^2+a)^2/(d*x^2+c)^2,x, algorithm="maxima")
Output:
1/2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*x/(c*d^3*x^2 + c^2*d^2) + b^2*x/d^2 - 1/2*(3*b^2*c^2 - 2*a*b*c*d - a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*c*d ^2)
Time = 0.12 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.16 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} + \frac {b^{2} c^{2} x - 2 \, a b c d x + a^{2} d^{2} x}{2 \, {\left (d x^{2} + c\right )} c d^{2}} \] Input:
integrate((b*x^2+a)^2/(d*x^2+c)^2,x, algorithm="giac")
Output:
b^2*x/d^2 - 1/2*(3*b^2*c^2 - 2*a*b*c*d - a^2*d^2)*arctan(d*x/sqrt(c*d))/(s qrt(c*d)*c*d^2) + 1/2*(b^2*c^2*x - 2*a*b*c*d*x + a^2*d^2*x)/((d*x^2 + c)*c *d^2)
Time = 0.51 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.51 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {b^2\,x}{d^2}+\frac {x\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,c\,\left (d^3\,x^2+c\,d^2\right )}+\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{\sqrt {c}\,\left (a^2\,d^2+2\,a\,b\,c\,d-3\,b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{2\,c^{3/2}\,d^{5/2}} \] Input:
int((a + b*x^2)^2/(c + d*x^2)^2,x)
Output:
(b^2*x)/d^2 + (x*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d))/(2*c*(c*d^2 + d^3*x^2)) + (atan((d^(1/2)*x*(a*d - b*c)*(a*d + 3*b*c))/(c^(1/2)*(a^2*d^2 - 3*b^2*c^ 2 + 2*a*b*c*d)))*(a*d - b*c)*(a*d + 3*b*c))/(2*c^(3/2)*d^(5/2))
Time = 0.19 (sec) , antiderivative size = 215, normalized size of antiderivative = 2.62 \[ \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx=\frac {\sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a^{2} c \,d^{2}+\sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a^{2} d^{3} x^{2}+2 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a b \,c^{2} d +2 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a b c \,d^{2} x^{2}-3 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) b^{2} c^{3}-3 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) b^{2} c^{2} d \,x^{2}+a^{2} c \,d^{3} x -2 a b \,c^{2} d^{2} x +3 b^{2} c^{3} d x +2 b^{2} c^{2} d^{2} x^{3}}{2 c^{2} d^{3} \left (d \,x^{2}+c \right )} \] Input:
int((b*x^2+a)^2/(d*x^2+c)^2,x)
Output:
(sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c)))*a**2*c*d**2 + sqrt(d)*sqrt( c)*atan((d*x)/(sqrt(d)*sqrt(c)))*a**2*d**3*x**2 + 2*sqrt(d)*sqrt(c)*atan(( d*x)/(sqrt(d)*sqrt(c)))*a*b*c**2*d + 2*sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d) *sqrt(c)))*a*b*c*d**2*x**2 - 3*sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c) ))*b**2*c**3 - 3*sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c)))*b**2*c**2*d *x**2 + a**2*c*d**3*x - 2*a*b*c**2*d**2*x + 3*b**2*c**3*d*x + 2*b**2*c**2* d**2*x**3)/(2*c**2*d**3*(c + d*x**2))