Integrand size = 20, antiderivative size = 91 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {b c^2-a d^2+2 b c d x}{2 a b \left (a+b x^2\right )}+\frac {c d \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{3/2} \sqrt {b}}+\frac {c^2 \log (x)}{a^2}-\frac {c^2 \log \left (a+b x^2\right )}{2 a^2} \] Output:
1/2*(2*b*c*d*x-a*d^2+b*c^2)/a/b/(b*x^2+a)+c*d*arctan(b^(1/2)*x/a^(1/2))/a^ (3/2)/b^(1/2)+c^2*ln(x)/a^2-1/2*c^2*ln(b*x^2+a)/a^2
Time = 0.06 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.93 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {\frac {a \left (-a d^2+b c (c+2 d x)\right )}{b \left (a+b x^2\right )}+\frac {2 \sqrt {a} c d \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {b}}+2 c^2 \log (x)-c^2 \log \left (a+b x^2\right )}{2 a^2} \] Input:
Integrate[(c + d*x)^2/(x*(a + b*x^2)^2),x]
Output:
((a*(-(a*d^2) + b*c*(c + 2*d*x)))/(b*(a + b*x^2)) + (2*Sqrt[a]*c*d*ArcTan[ (Sqrt[b]*x)/Sqrt[a]])/Sqrt[b] + 2*c^2*Log[x] - c^2*Log[a + b*x^2])/(2*a^2)
Time = 0.42 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.01, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {532, 27, 523, 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 {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx\) |
\(\Big \downarrow \) 532 |
\(\displaystyle \frac {-a d^2+b c^2+2 b c d x}{2 a b \left (a+b x^2\right )}-\frac {\int -\frac {2 c (c+d x)}{x \left (b x^2+a\right )}dx}{2 a}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {c \int \frac {c+d x}{x \left (b x^2+a\right )}dx}{a}+\frac {-a d^2+b c^2+2 b c d x}{2 a b \left (a+b x^2\right )}\) |
\(\Big \downarrow \) 523 |
\(\displaystyle \frac {c \int \left (\frac {c}{a x}+\frac {a d-b c x}{a \left (b x^2+a\right )}\right )dx}{a}+\frac {-a d^2+b c^2+2 b c d x}{2 a b \left (a+b x^2\right )}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {c \left (\frac {d \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}}-\frac {c \log \left (a+b x^2\right )}{2 a}+\frac {c \log (x)}{a}\right )}{a}+\frac {-a d^2+b c^2+2 b c d x}{2 a b \left (a+b x^2\right )}\) |
Input:
Int[(c + d*x)^2/(x*(a + b*x^2)^2),x]
Output:
(b*c^2 - a*d^2 + 2*b*c*d*x)/(2*a*b*(a + b*x^2)) + (c*((d*ArcTan[(Sqrt[b]*x )/Sqrt[a]])/(Sqrt[a]*Sqrt[b]) + (c*Log[x])/a - (c*Log[a + b*x^2])/(2*a)))/ a
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((x_)^(m_.)*((c_) + (d_.)*(x_)))/((a_) + (b_.)*(x_)^2), x_Symbol] :> In t[ExpandIntegrand[x^m*((c + d*x)/(a + b*x^2)), x], x] /; FreeQ[{a, b, c, d} , x] && IntegerQ[m]
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) *((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[x^m *(a + b*x^2)^(p + 1)*ExpandToSum[2*a*(p + 1)*(Qx/x^m) + e*((2*p + 3)/x^m), x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[n, 0] && ILtQ[m, 0] && LtQ[p, -1] && IntegerQ[2*p]
Time = 0.27 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.89
method | result | size |
default | \(\frac {c^{2} \ln \left (x \right )}{a^{2}}+\frac {\frac {a d x c -\frac {a \left (a \,d^{2}-b \,c^{2}\right )}{2 b}}{b \,x^{2}+a}+c \left (-\frac {c \ln \left (b \,x^{2}+a \right )}{2}+\frac {a d \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}}\right )}{a^{2}}\) | \(81\) |
risch | \(\frac {\frac {c d x}{a}-\frac {a \,d^{2}-b \,c^{2}}{2 b a}}{b \,x^{2}+a}+\frac {c \ln \left (\left (-d a b -3 \sqrt {-a b}\, b c \right ) x -\sqrt {-a b}\, a d +3 a b c \right ) \sqrt {-a b}\, d}{2 b \,a^{2}}-\frac {c^{2} \ln \left (\left (-d a b -3 \sqrt {-a b}\, b c \right ) x -\sqrt {-a b}\, a d +3 a b c \right )}{2 a^{2}}-\frac {c \ln \left (\left (-d a b +3 \sqrt {-a b}\, b c \right ) x +\sqrt {-a b}\, a d +3 a b c \right ) \sqrt {-a b}\, d}{2 b \,a^{2}}-\frac {c^{2} \ln \left (\left (-d a b +3 \sqrt {-a b}\, b c \right ) x +\sqrt {-a b}\, a d +3 a b c \right )}{2 a^{2}}+\frac {c^{2} \ln \left (x \right )}{a^{2}}\) | \(235\) |
Input:
int((d*x+c)^2/x/(b*x^2+a)^2,x,method=_RETURNVERBOSE)
Output:
c^2*ln(x)/a^2+1/a^2*((a*d*x*c-1/2*a*(a*d^2-b*c^2)/b)/(b*x^2+a)+c*(-1/2*c*l n(b*x^2+a)+a*d/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))))
Time = 0.12 (sec) , antiderivative size = 260, normalized size of antiderivative = 2.86 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\left [\frac {2 \, a b c d x + a b c^{2} - a^{2} d^{2} - {\left (b c d x^{2} + a c d\right )} \sqrt {-a b} \log \left (\frac {b x^{2} - 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) - {\left (b^{2} c^{2} x^{2} + a b c^{2}\right )} \log \left (b x^{2} + a\right ) + 2 \, {\left (b^{2} c^{2} x^{2} + a b c^{2}\right )} \log \left (x\right )}{2 \, {\left (a^{2} b^{2} x^{2} + a^{3} b\right )}}, \frac {2 \, a b c d x + a b c^{2} - a^{2} d^{2} + 2 \, {\left (b c d x^{2} + a c d\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} x}{a}\right ) - {\left (b^{2} c^{2} x^{2} + a b c^{2}\right )} \log \left (b x^{2} + a\right ) + 2 \, {\left (b^{2} c^{2} x^{2} + a b c^{2}\right )} \log \left (x\right )}{2 \, {\left (a^{2} b^{2} x^{2} + a^{3} b\right )}}\right ] \] Input:
integrate((d*x+c)^2/x/(b*x^2+a)^2,x, algorithm="fricas")
Output:
[1/2*(2*a*b*c*d*x + a*b*c^2 - a^2*d^2 - (b*c*d*x^2 + a*c*d)*sqrt(-a*b)*log ((b*x^2 - 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) - (b^2*c^2*x^2 + a*b*c^2)*log(b *x^2 + a) + 2*(b^2*c^2*x^2 + a*b*c^2)*log(x))/(a^2*b^2*x^2 + a^3*b), 1/2*( 2*a*b*c*d*x + a*b*c^2 - a^2*d^2 + 2*(b*c*d*x^2 + a*c*d)*sqrt(a*b)*arctan(s qrt(a*b)*x/a) - (b^2*c^2*x^2 + a*b*c^2)*log(b*x^2 + a) + 2*(b^2*c^2*x^2 + a*b*c^2)*log(x))/(a^2*b^2*x^2 + a^3*b)]
Leaf count of result is larger than twice the leaf count of optimal. 408 vs. \(2 (83) = 166\).
Time = 1.24 (sec) , antiderivative size = 408, normalized size of antiderivative = 4.48 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\left (- \frac {c^{2}}{2 a^{2}} - \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) \log {\left (x + \frac {- 12 a^{4} b \left (- \frac {c^{2}}{2 a^{2}} - \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right )^{2} + 2 a^{3} d^{2} \left (- \frac {c^{2}}{2 a^{2}} - \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) + 6 a^{2} b c^{2} \left (- \frac {c^{2}}{2 a^{2}} - \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) - 2 a c^{2} d^{2} + 6 b c^{4}}{a c d^{3} + 9 b c^{3} d} \right )} + \left (- \frac {c^{2}}{2 a^{2}} + \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) \log {\left (x + \frac {- 12 a^{4} b \left (- \frac {c^{2}}{2 a^{2}} + \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right )^{2} + 2 a^{3} d^{2} \left (- \frac {c^{2}}{2 a^{2}} + \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) + 6 a^{2} b c^{2} \left (- \frac {c^{2}}{2 a^{2}} + \frac {c d \sqrt {- a^{5} b}}{2 a^{4} b}\right ) - 2 a c^{2} d^{2} + 6 b c^{4}}{a c d^{3} + 9 b c^{3} d} \right )} + \frac {- a d^{2} + b c^{2} + 2 b c d x}{2 a^{2} b + 2 a b^{2} x^{2}} + \frac {c^{2} \log {\left (x \right )}}{a^{2}} \] Input:
integrate((d*x+c)**2/x/(b*x**2+a)**2,x)
Output:
(-c**2/(2*a**2) - c*d*sqrt(-a**5*b)/(2*a**4*b))*log(x + (-12*a**4*b*(-c**2 /(2*a**2) - c*d*sqrt(-a**5*b)/(2*a**4*b))**2 + 2*a**3*d**2*(-c**2/(2*a**2) - c*d*sqrt(-a**5*b)/(2*a**4*b)) + 6*a**2*b*c**2*(-c**2/(2*a**2) - c*d*sqr t(-a**5*b)/(2*a**4*b)) - 2*a*c**2*d**2 + 6*b*c**4)/(a*c*d**3 + 9*b*c**3*d) ) + (-c**2/(2*a**2) + c*d*sqrt(-a**5*b)/(2*a**4*b))*log(x + (-12*a**4*b*(- c**2/(2*a**2) + c*d*sqrt(-a**5*b)/(2*a**4*b))**2 + 2*a**3*d**2*(-c**2/(2*a **2) + c*d*sqrt(-a**5*b)/(2*a**4*b)) + 6*a**2*b*c**2*(-c**2/(2*a**2) + c*d *sqrt(-a**5*b)/(2*a**4*b)) - 2*a*c**2*d**2 + 6*b*c**4)/(a*c*d**3 + 9*b*c** 3*d)) + (-a*d**2 + b*c**2 + 2*b*c*d*x)/(2*a**2*b + 2*a*b**2*x**2) + c**2*l og(x)/a**2
Time = 0.11 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.90 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c d \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a} - \frac {c^{2} \log \left (b x^{2} + a\right )}{2 \, a^{2}} + \frac {c^{2} \log \left (x\right )}{a^{2}} + \frac {2 \, b c d x + b c^{2} - a d^{2}}{2 \, {\left (a b^{2} x^{2} + a^{2} b\right )}} \] Input:
integrate((d*x+c)^2/x/(b*x^2+a)^2,x, algorithm="maxima")
Output:
c*d*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a) - 1/2*c^2*log(b*x^2 + a)/a^2 + c^2 *log(x)/a^2 + 1/2*(2*b*c*d*x + b*c^2 - a*d^2)/(a*b^2*x^2 + a^2*b)
Time = 0.12 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.95 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c d \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a} - \frac {c^{2} \log \left (b x^{2} + a\right )}{2 \, a^{2}} + \frac {c^{2} \log \left ({\left | x \right |}\right )}{a^{2}} + \frac {2 \, a b c d x + a b c^{2} - a^{2} d^{2}}{2 \, {\left (b x^{2} + a\right )} a^{2} b} \] Input:
integrate((d*x+c)^2/x/(b*x^2+a)^2,x, algorithm="giac")
Output:
c*d*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a) - 1/2*c^2*log(b*x^2 + a)/a^2 + c^2 *log(abs(x))/a^2 + 1/2*(2*a*b*c*d*x + a*b*c^2 - a^2*d^2)/((b*x^2 + a)*a^2* b)
Time = 0.29 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.08 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c^2\,\ln \left (x\right )}{a^2}-\ln \left (a\,d\,\sqrt {-a^5\,b}-3\,a^3\,b\,c+a^3\,b\,d\,x+3\,b\,c\,x\,\sqrt {-a^5\,b}\right )\,\left (\frac {c^2}{2\,a^2}-\frac {c\,d\,\sqrt {-a^5\,b}}{2\,a^4\,b}\right )-\ln \left (a\,d\,\sqrt {-a^5\,b}+3\,a^3\,b\,c-a^3\,b\,d\,x+3\,b\,c\,x\,\sqrt {-a^5\,b}\right )\,\left (\frac {c^2}{2\,a^2}+\frac {c\,d\,\sqrt {-a^5\,b}}{2\,a^4\,b}\right )-\frac {\frac {a\,d^2-b\,c^2}{2\,a\,b}-\frac {c\,d\,x}{a}}{b\,x^2+a} \] Input:
int((c + d*x)^2/(x*(a + b*x^2)^2),x)
Output:
(c^2*log(x))/a^2 - log(a*d*(-a^5*b)^(1/2) - 3*a^3*b*c + a^3*b*d*x + 3*b*c* x*(-a^5*b)^(1/2))*(c^2/(2*a^2) - (c*d*(-a^5*b)^(1/2))/(2*a^4*b)) - log(a*d *(-a^5*b)^(1/2) + 3*a^3*b*c - a^3*b*d*x + 3*b*c*x*(-a^5*b)^(1/2))*(c^2/(2* a^2) + (c*d*(-a^5*b)^(1/2))/(2*a^4*b)) - ((a*d^2 - b*c^2)/(2*a*b) - (c*d*x )/a)/(a + b*x^2)
Time = 0.18 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.60 \[ \int \frac {(c+d x)^2}{x \left (a+b x^2\right )^2} \, dx=\frac {2 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {b x}{\sqrt {b}\, \sqrt {a}}\right ) a c d +2 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {b x}{\sqrt {b}\, \sqrt {a}}\right ) b c d \,x^{2}-\mathrm {log}\left (b \,x^{2}+a \right ) a b \,c^{2}-\mathrm {log}\left (b \,x^{2}+a \right ) b^{2} c^{2} x^{2}+2 \,\mathrm {log}\left (x \right ) a b \,c^{2}+2 \,\mathrm {log}\left (x \right ) b^{2} c^{2} x^{2}+2 a b c d x +a b \,d^{2} x^{2}-b^{2} c^{2} x^{2}}{2 a^{2} b \left (b \,x^{2}+a \right )} \] Input:
int((d*x+c)^2/x/(b*x^2+a)^2,x)
Output:
(2*sqrt(b)*sqrt(a)*atan((b*x)/(sqrt(b)*sqrt(a)))*a*c*d + 2*sqrt(b)*sqrt(a) *atan((b*x)/(sqrt(b)*sqrt(a)))*b*c*d*x**2 - log(a + b*x**2)*a*b*c**2 - log (a + b*x**2)*b**2*c**2*x**2 + 2*log(x)*a*b*c**2 + 2*log(x)*b**2*c**2*x**2 + 2*a*b*c*d*x + a*b*d**2*x**2 - b**2*c**2*x**2)/(2*a**2*b*(a + b*x**2))