Integrand size = 19, antiderivative size = 90 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=-\frac {b B-A c-(A b-a B) x}{2 \left (b^2-a c\right ) \left (c+2 b x+a x^2\right )}-\frac {(A b-a B) \text {arctanh}\left (\frac {b+a x}{\sqrt {b^2-a c}}\right )}{2 \left (b^2-a c\right )^{3/2}} \] Output:
1/2*(-b*B+A*c+(A*b-B*a)*x)/(-a*c+b^2)/(a*x^2+2*b*x+c)-1/2*(A*b-B*a)*arctan h((a*x+b)/(-a*c+b^2)^(1/2))/(-a*c+b^2)^(3/2)
Time = 0.05 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.98 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=\frac {\frac {-b B+A c+A b x-a B x}{c+x (2 b+a x)}+\frac {(A b-a B) \arctan \left (\frac {b+a x}{\sqrt {-b^2+a c}}\right )}{\sqrt {-b^2+a c}}}{2 \left (b^2-a c\right )} \] Input:
Integrate[(B + A*x)/(c + 2*b*x + a*x^2)^2,x]
Output:
((-(b*B) + A*c + A*b*x - a*B*x)/(c + x*(2*b + a*x)) + ((A*b - a*B)*ArcTan[ (b + a*x)/Sqrt[-b^2 + a*c]])/Sqrt[-b^2 + a*c])/(2*(b^2 - a*c))
Time = 0.23 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.07, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {1159, 1083, 219}
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 x+B}{\left (a x^2+2 b x+c\right )^2} \, dx\) |
\(\Big \downarrow \) 1159 |
\(\displaystyle \frac {(A b-a B) \int \frac {1}{a x^2+2 b x+c}dx}{2 \left (b^2-a c\right )}-\frac {-x (A b-a B)-A c+b B}{2 \left (b^2-a c\right ) \left (a x^2+2 b x+c\right )}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -\frac {(A b-a B) \int \frac {1}{4 \left (b^2-a c\right )-(2 b+2 a x)^2}d(2 b+2 a x)}{b^2-a c}-\frac {-x (A b-a B)-A c+b B}{2 \left (b^2-a c\right ) \left (a x^2+2 b x+c\right )}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {(A b-a B) \text {arctanh}\left (\frac {2 a x+2 b}{2 \sqrt {b^2-a c}}\right )}{2 \left (b^2-a c\right )^{3/2}}-\frac {-x (A b-a B)-A c+b B}{2 \left (b^2-a c\right ) \left (a x^2+2 b x+c\right )}\) |
Input:
Int[(B + A*x)/(c + 2*b*x + a*x^2)^2,x]
Output:
-1/2*(b*B - A*c - (A*b - a*B)*x)/((b^2 - a*c)*(c + 2*b*x + a*x^2)) - ((A*b - a*B)*ArcTanh[(2*b + 2*a*x)/(2*Sqrt[b^2 - a*c])])/(2*(b^2 - a*c)^(3/2))
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol ] :> Simp[((b*d - 2*a*e + (2*c*d - b*e)*x)/((p + 1)*(b^2 - 4*a*c)))*(a + b* x + c*x^2)^(p + 1), x] - Simp[(2*p + 3)*((2*c*d - b*e)/((p + 1)*(b^2 - 4*a* c))) Int[(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] & & LtQ[p, -1] && NeQ[p, -3/2]
Time = 0.34 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.14
method | result | size |
default | \(\frac {\left (-2 A b +2 B a \right ) x +2 b B -2 A c}{\left (4 a c -4 b^{2}\right ) \left (a \,x^{2}+2 b x +c \right )}+\frac {\left (-2 A b +2 B a \right ) \arctan \left (\frac {2 a x +2 b}{2 \sqrt {a c -b^{2}}}\right )}{\left (4 a c -4 b^{2}\right ) \sqrt {a c -b^{2}}}\) | \(103\) |
risch | \(\frac {-\frac {\left (A b -B a \right ) x}{2 \left (a c -b^{2}\right )}-\frac {A c -b B}{2 \left (a c -b^{2}\right )}}{a \,x^{2}+2 b x +c}+\frac {\ln \left (\left (-a^{2} c +a \,b^{2}\right ) x -\left (-a c +b^{2}\right )^{\frac {3}{2}}-a b c +b^{3}\right ) A b}{4 \left (-a c +b^{2}\right )^{\frac {3}{2}}}-\frac {\ln \left (\left (-a^{2} c +a \,b^{2}\right ) x -\left (-a c +b^{2}\right )^{\frac {3}{2}}-a b c +b^{3}\right ) B a}{4 \left (-a c +b^{2}\right )^{\frac {3}{2}}}-\frac {\ln \left (\left (a^{2} c -a \,b^{2}\right ) x -\left (-a c +b^{2}\right )^{\frac {3}{2}}+a b c -b^{3}\right ) A b}{4 \left (-a c +b^{2}\right )^{\frac {3}{2}}}+\frac {\ln \left (\left (a^{2} c -a \,b^{2}\right ) x -\left (-a c +b^{2}\right )^{\frac {3}{2}}+a b c -b^{3}\right ) B a}{4 \left (-a c +b^{2}\right )^{\frac {3}{2}}}\) | \(262\) |
Input:
int((A*x+B)/(a*x^2+2*b*x+c)^2,x,method=_RETURNVERBOSE)
Output:
((-2*A*b+2*B*a)*x+2*b*B-2*A*c)/(4*a*c-4*b^2)/(a*x^2+2*b*x+c)+(-2*A*b+2*B*a )/(4*a*c-4*b^2)/(a*c-b^2)^(1/2)*arctan(1/2*(2*a*x+2*b)/(a*c-b^2)^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (81) = 162\).
Time = 0.07 (sec) , antiderivative size = 448, normalized size of antiderivative = 4.98 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=\left [-\frac {2 \, B b^{3} + 2 \, A a c^{2} - {\left ({\left (B a^{2} - A a b\right )} x^{2} + {\left (B a - A b\right )} c + 2 \, {\left (B a b - A b^{2}\right )} x\right )} \sqrt {b^{2} - a c} \log \left (\frac {a^{2} x^{2} + 2 \, a b x + 2 \, b^{2} - a c + 2 \, \sqrt {b^{2} - a c} {\left (a x + b\right )}}{a x^{2} + 2 \, b x + c}\right ) - 2 \, {\left (B a b + A b^{2}\right )} c + 2 \, {\left (B a b^{2} - A b^{3} - {\left (B a^{2} - A a b\right )} c\right )} x}{4 \, {\left (b^{4} c - 2 \, a b^{2} c^{2} + a^{2} c^{3} + {\left (a b^{4} - 2 \, a^{2} b^{2} c + a^{3} c^{2}\right )} x^{2} + 2 \, {\left (b^{5} - 2 \, a b^{3} c + a^{2} b c^{2}\right )} x\right )}}, -\frac {B b^{3} + A a c^{2} - {\left ({\left (B a^{2} - A a b\right )} x^{2} + {\left (B a - A b\right )} c + 2 \, {\left (B a b - A b^{2}\right )} x\right )} \sqrt {-b^{2} + a c} \arctan \left (-\frac {\sqrt {-b^{2} + a c} {\left (a x + b\right )}}{b^{2} - a c}\right ) - {\left (B a b + A b^{2}\right )} c + {\left (B a b^{2} - A b^{3} - {\left (B a^{2} - A a b\right )} c\right )} x}{2 \, {\left (b^{4} c - 2 \, a b^{2} c^{2} + a^{2} c^{3} + {\left (a b^{4} - 2 \, a^{2} b^{2} c + a^{3} c^{2}\right )} x^{2} + 2 \, {\left (b^{5} - 2 \, a b^{3} c + a^{2} b c^{2}\right )} x\right )}}\right ] \] Input:
integrate((A*x+B)/(a*x^2+2*b*x+c)^2,x, algorithm="fricas")
Output:
[-1/4*(2*B*b^3 + 2*A*a*c^2 - ((B*a^2 - A*a*b)*x^2 + (B*a - A*b)*c + 2*(B*a *b - A*b^2)*x)*sqrt(b^2 - a*c)*log((a^2*x^2 + 2*a*b*x + 2*b^2 - a*c + 2*sq rt(b^2 - a*c)*(a*x + b))/(a*x^2 + 2*b*x + c)) - 2*(B*a*b + A*b^2)*c + 2*(B *a*b^2 - A*b^3 - (B*a^2 - A*a*b)*c)*x)/(b^4*c - 2*a*b^2*c^2 + a^2*c^3 + (a *b^4 - 2*a^2*b^2*c + a^3*c^2)*x^2 + 2*(b^5 - 2*a*b^3*c + a^2*b*c^2)*x), -1 /2*(B*b^3 + A*a*c^2 - ((B*a^2 - A*a*b)*x^2 + (B*a - A*b)*c + 2*(B*a*b - A* b^2)*x)*sqrt(-b^2 + a*c)*arctan(-sqrt(-b^2 + a*c)*(a*x + b)/(b^2 - a*c)) - (B*a*b + A*b^2)*c + (B*a*b^2 - A*b^3 - (B*a^2 - A*a*b)*c)*x)/(b^4*c - 2*a *b^2*c^2 + a^2*c^3 + (a*b^4 - 2*a^2*b^2*c + a^3*c^2)*x^2 + 2*(b^5 - 2*a*b^ 3*c + a^2*b*c^2)*x)]
Leaf count of result is larger than twice the leaf count of optimal. 323 vs. \(2 (75) = 150\).
Time = 0.49 (sec) , antiderivative size = 323, normalized size of antiderivative = 3.59 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=- \frac {\sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) \log {\left (x + \frac {- A b^{2} + B a b - a^{2} c^{2} \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) + 2 a b^{2} c \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) - b^{4} \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right )}{- A a b + B a^{2}} \right )}}{4} + \frac {\sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) \log {\left (x + \frac {- A b^{2} + B a b + a^{2} c^{2} \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) - 2 a b^{2} c \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right ) + b^{4} \sqrt {- \frac {1}{\left (a c - b^{2}\right )^{3}}} \left (- A b + B a\right )}{- A a b + B a^{2}} \right )}}{4} + \frac {- A c + B b + x \left (- A b + B a\right )}{2 a c^{2} - 2 b^{2} c + x^{2} \cdot \left (2 a^{2} c - 2 a b^{2}\right ) + x \left (4 a b c - 4 b^{3}\right )} \] Input:
integrate((A*x+B)/(a*x**2+2*b*x+c)**2,x)
Output:
-sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a)*log(x + (-A*b**2 + B*a*b - a**2*c** 2*sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a) + 2*a*b**2*c*sqrt(-1/(a*c - b**2)* *3)*(-A*b + B*a) - b**4*sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a))/(-A*a*b + B *a**2))/4 + sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a)*log(x + (-A*b**2 + B*a*b + a**2*c**2*sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a) - 2*a*b**2*c*sqrt(-1/(a *c - b**2)**3)*(-A*b + B*a) + b**4*sqrt(-1/(a*c - b**2)**3)*(-A*b + B*a))/ (-A*a*b + B*a**2))/4 + (-A*c + B*b + x*(-A*b + B*a))/(2*a*c**2 - 2*b**2*c + x**2*(2*a**2*c - 2*a*b**2) + x*(4*a*b*c - 4*b**3))
Exception generated. \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((A*x+B)/(a*x^2+2*b*x+c)^2,x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a*c>0)', see `assume?` f or more de
Time = 0.12 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.02 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=-\frac {{\left (B a - A b\right )} \arctan \left (\frac {a x + b}{\sqrt {-b^{2} + a c}}\right )}{2 \, {\left (b^{2} - a c\right )} \sqrt {-b^{2} + a c}} - \frac {B a x - A b x + B b - A c}{2 \, {\left (a x^{2} + 2 \, b x + c\right )} {\left (b^{2} - a c\right )}} \] Input:
integrate((A*x+B)/(a*x^2+2*b*x+c)^2,x, algorithm="giac")
Output:
-1/2*(B*a - A*b)*arctan((a*x + b)/sqrt(-b^2 + a*c))/((b^2 - a*c)*sqrt(-b^2 + a*c)) - 1/2*(B*a*x - A*b*x + B*b - A*c)/((a*x^2 + 2*b*x + c)*(b^2 - a*c ))
Time = 0.17 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.77 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=\frac {\mathrm {atan}\left (\frac {2\,\left (a\,c-b^2\right )\,\left (\frac {\left (4\,b^3-4\,a\,b\,c\right )\,\left (A\,b-B\,a\right )}{8\,{\left (a\,c-b^2\right )}^{5/2}}-\frac {a\,x\,\left (A\,b-B\,a\right )}{2\,{\left (a\,c-b^2\right )}^{3/2}}\right )}{A\,b-B\,a}\right )\,\left (A\,b-B\,a\right )}{2\,{\left (a\,c-b^2\right )}^{3/2}}-\frac {\frac {A\,c-B\,b}{2\,\left (a\,c-b^2\right )}+\frac {x\,\left (A\,b-B\,a\right )}{2\,\left (a\,c-b^2\right )}}{a\,x^2+2\,b\,x+c} \] Input:
int((B + A*x)/(c + 2*b*x + a*x^2)^2,x)
Output:
(atan((2*(a*c - b^2)*(((4*b^3 - 4*a*b*c)*(A*b - B*a))/(8*(a*c - b^2)^(5/2) ) - (a*x*(A*b - B*a))/(2*(a*c - b^2)^(3/2))))/(A*b - B*a))*(A*b - B*a))/(2 *(a*c - b^2)^(3/2)) - ((A*c - B*b)/(2*(a*c - b^2)) + (x*(A*b - B*a))/(2*(a *c - b^2)))/(c + 2*b*x + a*x^2)
Time = 0.15 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.20 \[ \int \frac {B+A x}{\left (c+2 b x+a x^2\right )^2} \, dx=-\frac {1}{2 a \,x^{2}+4 b x +2 c} \] Input:
int((A*x+B)/(a*x^2+2*b*x+c)^2,x)
Output:
( - 1)/(2*(a*x**2 + 2*b*x + c))