Integrand size = 22, antiderivative size = 85 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=-\frac {a^2}{c^2 x}-\frac {(b c-a d)^2 x}{2 c^2 d \left (c+d x^2\right )}+\frac {(b c-a d) (b c+3 a d) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}} \] Output:
-a^2/c^2/x-1/2*(-a*d+b*c)^2*x/c^2/d/(d*x^2+c)+1/2*(-a*d+b*c)*(3*a*d+b*c)*a rctan(d^(1/2)*x/c^(1/2))/c^(5/2)/d^(3/2)
Time = 0.04 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.07 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=-\frac {a^2}{c^2 x}-\frac {(b c-a d)^2 x}{2 c^2 d \left (c+d x^2\right )}+\frac {\left (b^2 c^2+2 a b c d-3 a^2 d^2\right ) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}} \] Input:
Integrate[(a + b*x^2)^2/(x^2*(c + d*x^2)^2),x]
Output:
-(a^2/(c^2*x)) - ((b*c - a*d)^2*x)/(2*c^2*d*(c + d*x^2)) + ((b^2*c^2 + 2*a *b*c*d - 3*a^2*d^2)*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(2*c^(5/2)*d^(3/2))
Time = 0.23 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.25, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {365, 298, 218}
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}{x^2 \left (c+d x^2\right )^2} \, dx\) |
\(\Big \downarrow \) 365 |
\(\displaystyle \frac {\int \frac {b^2 c x^2+a (2 b c-3 a d)}{\left (d x^2+c\right )^2}dx}{c}-\frac {a^2}{c x \left (c+d x^2\right )}\) |
\(\Big \downarrow \) 298 |
\(\displaystyle \frac {\frac {(b c-a d) (3 a d+b c) \int \frac {1}{d x^2+c}dx}{2 c d}+\frac {x \left (-\frac {3 a^2 d}{c}+2 a b-\frac {b^2 c}{d}\right )}{2 \left (c+d x^2\right )}}{c}-\frac {a^2}{c x \left (c+d x^2\right )}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {x \left (-\frac {3 a^2 d}{c}+2 a b-\frac {b^2 c}{d}\right )}{2 \left (c+d x^2\right )}+\frac {(b c-a d) (3 a d+b c) \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{3/2}}}{c}-\frac {a^2}{c x \left (c+d x^2\right )}\) |
Input:
Int[(a + b*x^2)^2/(x^2*(c + d*x^2)^2),x]
Output:
-(a^2/(c*x*(c + d*x^2))) + (((2*a*b - (b^2*c)/d - (3*a^2*d)/c)*x)/(2*(c + d*x^2)) + ((b*c - a*d)*(b*c + 3*a*d)*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(2*c^(3/ 2)*d^(3/2)))/c
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 2*p + 3))/(2*a*b*(p + 1)) Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^2, x _Symbol] :> Simp[c^2*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(a*e*(m + 1))), x] - Simp[1/(a*e^2*(m + 1)) Int[(e*x)^(m + 2)*(a + b*x^2)^p*Simp[2*b*c^2*(p + 1) + c*(b*c - 2*a*d)*(m + 1) - a*d^2*(m + 1)*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1]
Time = 0.44 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.14
method | result | size |
default | \(-\frac {a^{2}}{c^{2} x}-\frac {\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 d \left (x^{2} d +c \right )}+\frac {\left (3 a^{2} d^{2}-2 a b c d -b^{2} c^{2}\right ) \arctan \left (\frac {x d}{\sqrt {c d}}\right )}{2 d \sqrt {c d}}}{c^{2}}\) | \(97\) |
risch | \(\frac {-\frac {\left (3 a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x^{2}}{2 c^{2} d}-\frac {a^{2}}{c}}{x \left (x^{2} d +c \right )}-\frac {3 d \ln \left (-\sqrt {-c d}\, x -c \right ) a^{2}}{4 \sqrt {-c d}\, c^{2}}+\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) a b}{2 \sqrt {-c d}\, c}+\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) b^{2}}{4 \sqrt {-c d}\, d}+\frac {3 d \ln \left (-\sqrt {-c d}\, x +c \right ) a^{2}}{4 \sqrt {-c d}\, c^{2}}-\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) a b}{2 \sqrt {-c d}\, c}-\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) b^{2}}{4 \sqrt {-c d}\, d}\) | \(219\) |
Input:
int((b*x^2+a)^2/x^2/(d*x^2+c)^2,x,method=_RETURNVERBOSE)
Output:
-a^2/c^2/x-1/c^2*(1/2*(a^2*d^2-2*a*b*c*d+b^2*c^2)/d*x/(d*x^2+c)+1/2*(3*a^2 *d^2-2*a*b*c*d-b^2*c^2)/d/(c*d)^(1/2)*arctan(x*d/(c*d)^(1/2)))
Time = 0.15 (sec) , antiderivative size = 305, normalized size of antiderivative = 3.59 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=\left [-\frac {4 \, a^{2} c^{2} d^{2} + 2 \, {\left (b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + 3 \, a^{2} c d^{3}\right )} x^{2} - {\left ({\left (b^{2} c^{2} d + 2 \, a b c d^{2} - 3 \, a^{2} d^{3}\right )} x^{3} + {\left (b^{2} c^{3} + 2 \, a b c^{2} d - 3 \, a^{2} c d^{2}\right )} x\right )} \sqrt {-c d} \log \left (\frac {d x^{2} + 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right )}{4 \, {\left (c^{3} d^{3} x^{3} + c^{4} d^{2} x\right )}}, -\frac {2 \, a^{2} c^{2} d^{2} + {\left (b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + 3 \, a^{2} c d^{3}\right )} x^{2} - {\left ({\left (b^{2} c^{2} d + 2 \, a b c d^{2} - 3 \, a^{2} d^{3}\right )} x^{3} + {\left (b^{2} c^{3} + 2 \, a b c^{2} d - 3 \, a^{2} c d^{2}\right )} x\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right )}{2 \, {\left (c^{3} d^{3} x^{3} + c^{4} d^{2} x\right )}}\right ] \] Input:
integrate((b*x^2+a)^2/x^2/(d*x^2+c)^2,x, algorithm="fricas")
Output:
[-1/4*(4*a^2*c^2*d^2 + 2*(b^2*c^3*d - 2*a*b*c^2*d^2 + 3*a^2*c*d^3)*x^2 - ( (b^2*c^2*d + 2*a*b*c*d^2 - 3*a^2*d^3)*x^3 + (b^2*c^3 + 2*a*b*c^2*d - 3*a^2 *c*d^2)*x)*sqrt(-c*d)*log((d*x^2 + 2*sqrt(-c*d)*x - c)/(d*x^2 + c)))/(c^3* d^3*x^3 + c^4*d^2*x), -1/2*(2*a^2*c^2*d^2 + (b^2*c^3*d - 2*a*b*c^2*d^2 + 3 *a^2*c*d^3)*x^2 - ((b^2*c^2*d + 2*a*b*c*d^2 - 3*a^2*d^3)*x^3 + (b^2*c^3 + 2*a*b*c^2*d - 3*a^2*c*d^2)*x)*sqrt(c*d)*arctan(sqrt(c*d)*x/c))/(c^3*d^3*x^ 3 + c^4*d^2*x)]
Leaf count of result is larger than twice the leaf count of optimal. 238 vs. \(2 (73) = 146\).
Time = 0.43 (sec) , antiderivative size = 238, normalized size of antiderivative = 2.80 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=\frac {\sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (- \frac {c^{3} d \sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} - \frac {\sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (\frac {c^{3} d \sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} + \frac {- 2 a^{2} c d + x^{2} \left (- 3 a^{2} d^{2} + 2 a b c d - b^{2} c^{2}\right )}{2 c^{3} d x + 2 c^{2} d^{2} x^{3}} \] Input:
integrate((b*x**2+a)**2/x**2/(d*x**2+c)**2,x)
Output:
sqrt(-1/(c**5*d**3))*(a*d - b*c)*(3*a*d + b*c)*log(-c**3*d*sqrt(-1/(c**5*d **3))*(a*d - b*c)*(3*a*d + b*c)/(3*a**2*d**2 - 2*a*b*c*d - b**2*c**2) + x) /4 - sqrt(-1/(c**5*d**3))*(a*d - b*c)*(3*a*d + b*c)*log(c**3*d*sqrt(-1/(c* *5*d**3))*(a*d - b*c)*(3*a*d + b*c)/(3*a**2*d**2 - 2*a*b*c*d - b**2*c**2) + x)/4 + (-2*a**2*c*d + x**2*(-3*a**2*d**2 + 2*a*b*c*d - b**2*c**2))/(2*c* *3*d*x + 2*c**2*d**2*x**3)
Time = 0.14 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.18 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=-\frac {2 \, a^{2} c d + {\left (b^{2} c^{2} - 2 \, a b c d + 3 \, a^{2} d^{2}\right )} x^{2}}{2 \, {\left (c^{2} d^{2} x^{3} + c^{3} d x\right )}} + \frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c^{2} d} \] Input:
integrate((b*x^2+a)^2/x^2/(d*x^2+c)^2,x, algorithm="maxima")
Output:
-1/2*(2*a^2*c*d + (b^2*c^2 - 2*a*b*c*d + 3*a^2*d^2)*x^2)/(c^2*d^2*x^3 + c^ 3*d*x) + 1/2*(b^2*c^2 + 2*a*b*c*d - 3*a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt (c*d)*c^2*d)
Time = 0.12 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.20 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=\frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c^{2} d} - \frac {b^{2} c^{2} x^{2} - 2 \, a b c d x^{2} + 3 \, a^{2} d^{2} x^{2} + 2 \, a^{2} c d}{2 \, {\left (d x^{3} + c x\right )} c^{2} d} \] Input:
integrate((b*x^2+a)^2/x^2/(d*x^2+c)^2,x, algorithm="giac")
Output:
1/2*(b^2*c^2 + 2*a*b*c*d - 3*a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*c^2 *d) - 1/2*(b^2*c^2*x^2 - 2*a*b*c*d*x^2 + 3*a^2*d^2*x^2 + 2*a^2*c*d)/((d*x^ 3 + c*x)*c^2*d)
Time = 0.54 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.51 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{\sqrt {c}\,\left (-3\,a^2\,d^2+2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{2\,c^{5/2}\,d^{3/2}}-\frac {\frac {a^2}{c}+\frac {x^2\,\left (3\,a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,c^2\,d}}{d\,x^3+c\,x} \] Input:
int((a + b*x^2)^2/(x^2*(c + d*x^2)^2),x)
Output:
(atan((d^(1/2)*x*(a*d - b*c)*(3*a*d + b*c))/(c^(1/2)*(b^2*c^2 - 3*a^2*d^2 + 2*a*b*c*d)))*(a*d - b*c)*(3*a*d + b*c))/(2*c^(5/2)*d^(3/2)) - (a^2/c + ( x^2*(3*a^2*d^2 + b^2*c^2 - 2*a*b*c*d))/(2*c^2*d))/(c*x + d*x^3)
Time = 0.24 (sec) , antiderivative size = 225, normalized size of antiderivative = 2.65 \[ \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx=\frac {-3 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a^{2} c \,d^{2} x -3 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a^{2} d^{3} x^{3}+2 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a b \,c^{2} d x +2 \sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) a b c \,d^{2} x^{3}+\sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) b^{2} c^{3} x +\sqrt {d}\, \sqrt {c}\, \mathit {atan} \left (\frac {d x}{\sqrt {d}\, \sqrt {c}}\right ) b^{2} c^{2} d \,x^{3}-2 a^{2} c^{2} d^{2}-3 a^{2} c \,d^{3} x^{2}+2 a b \,c^{2} d^{2} x^{2}-b^{2} c^{3} d \,x^{2}}{2 c^{3} d^{2} x \left (d \,x^{2}+c \right )} \] Input:
int((b*x^2+a)^2/x^2/(d*x^2+c)^2,x)
Output:
( - 3*sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c)))*a**2*c*d**2*x - 3*sqrt (d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c)))*a**2*d**3*x**3 + 2*sqrt(d)*sqrt( c)*atan((d*x)/(sqrt(d)*sqrt(c)))*a*b*c**2*d*x + 2*sqrt(d)*sqrt(c)*atan((d* x)/(sqrt(d)*sqrt(c)))*a*b*c*d**2*x**3 + sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d )*sqrt(c)))*b**2*c**3*x + sqrt(d)*sqrt(c)*atan((d*x)/(sqrt(d)*sqrt(c)))*b* *2*c**2*d*x**3 - 2*a**2*c**2*d**2 - 3*a**2*c*d**3*x**2 + 2*a*b*c**2*d**2*x **2 - b**2*c**3*d*x**2)/(2*c**3*d**2*x*(c + d*x**2))