Integrand size = 25, antiderivative size = 148 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=-\frac {(2 c d f-b e f-b d g+2 a e g) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\sqrt {b^2-4 a c} \left (c d^2-b d e+a e^2\right )}+\frac {(e f-d g) \log (d+e x)}{c d^2-b d e+a e^2}-\frac {(e f-d g) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )} \] Output:
-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/(-4*a *c+b^2)^(1/2)/(a*e^2-b*d*e+c*d^2)+(-d*g+e*f)*ln(e*x+d)/(a*e^2-b*d*e+c*d^2) -(-d*g+e*f)*ln(c*x^2+b*x+a)/(2*a*e^2-2*b*d*e+2*c*d^2)
Time = 0.13 (sec) , antiderivative size = 127, normalized size of antiderivative = 0.86 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=\frac {(-4 c d f+2 b e f+2 b d g-4 a e g) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )-\sqrt {-b^2+4 a c} (e f-d g) (2 \log (d+e x)-\log (a+x (b+c x)))}{2 \sqrt {-b^2+4 a c} \left (-c d^2+e (b d-a e)\right )} \] Input:
Integrate[(f + g*x)/((d + e*x)*(a + b*x + c*x^2)),x]
Output:
((-4*c*d*f + 2*b*e*f + 2*b*d*g - 4*a*e*g)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4 *a*c]] - Sqrt[-b^2 + 4*a*c]*(e*f - d*g)*(2*Log[d + e*x] - Log[a + x*(b + c *x)]))/(2*Sqrt[-b^2 + 4*a*c]*(-(c*d^2) + e*(b*d - a*e)))
Time = 0.67 (sec) , antiderivative size = 148, 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 = {1200, 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 {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx\) |
\(\Big \downarrow \) 1200 |
\(\displaystyle \int \left (\frac {a e g-b e f-c x (e f-d g)+c d f}{\left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )}+\frac {e (e f-d g)}{(d+e x) \left (a e^2-b d e+c d^2\right )}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) (2 a e g-b d g-b e f+2 c d f)}{\sqrt {b^2-4 a c} \left (a e^2-b d e+c d^2\right )}-\frac {(e f-d g) \log \left (a+b x+c x^2\right )}{2 \left (a e^2-b d e+c d^2\right )}+\frac {(e f-d g) \log (d+e x)}{a e^2-b d e+c d^2}\) |
Input:
Int[(f + g*x)/((d + e*x)*(a + b*x + c*x^2)),x]
Output:
-(((2*c*d*f - b*e*f - b*d*g + 2*a*e*g)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a* c]])/(Sqrt[b^2 - 4*a*c]*(c*d^2 - b*d*e + a*e^2))) + ((e*f - d*g)*Log[d + e *x])/(c*d^2 - b*d*e + a*e^2) - ((e*f - d*g)*Log[a + b*x + c*x^2])/(2*(c*d^ 2 - b*d*e + a*e^2))
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_.) + (b_.)* (x_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g* x)^n/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && In tegersQ[n]
Time = 1.92 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.99
method | result | size |
default | \(-\frac {\left (d g -e f \right ) \ln \left (e x +d \right )}{a \,e^{2}-b d e +c \,d^{2}}+\frac {\frac {\left (c d g -f c e \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (a e g -b e f +d f c -\frac {\left (c d g -f c e \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{a \,e^{2}-b d e +c \,d^{2}}\) | \(146\) |
risch | \(\text {Expression too large to display}\) | \(15857\) |
Input:
int((g*x+f)/(e*x+d)/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
Output:
-(d*g-e*f)/(a*e^2-b*d*e+c*d^2)*ln(e*x+d)+1/(a*e^2-b*d*e+c*d^2)*(1/2*(c*d*g -c*e*f)/c*ln(c*x^2+b*x+a)+2*(a*e*g-b*e*f+d*f*c-1/2*(c*d*g-c*e*f)*b/c)/(4*a *c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)))
Time = 2.79 (sec) , antiderivative size = 395, normalized size of antiderivative = 2.67 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=\left [\frac {\sqrt {b^{2} - 4 \, a c} {\left ({\left (2 \, c d - b e\right )} f - {\left (b d - 2 \, a e\right )} g\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left ({\left (b^{2} - 4 \, a c\right )} e f - {\left (b^{2} - 4 \, a c\right )} d g\right )} \log \left (c x^{2} + b x + a\right ) + 2 \, {\left ({\left (b^{2} - 4 \, a c\right )} e f - {\left (b^{2} - 4 \, a c\right )} d g\right )} \log \left (e x + d\right )}{2 \, {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (b^{3} - 4 \, a b c\right )} d e + {\left (a b^{2} - 4 \, a^{2} c\right )} e^{2}\right )}}, -\frac {2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (2 \, c d - b e\right )} f - {\left (b d - 2 \, a e\right )} g\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left ({\left (b^{2} - 4 \, a c\right )} e f - {\left (b^{2} - 4 \, a c\right )} d g\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{2} - 4 \, a c\right )} e f - {\left (b^{2} - 4 \, a c\right )} d g\right )} \log \left (e x + d\right )}{2 \, {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (b^{3} - 4 \, a b c\right )} d e + {\left (a b^{2} - 4 \, a^{2} c\right )} e^{2}\right )}}\right ] \] Input:
integrate((g*x+f)/(e*x+d)/(c*x^2+b*x+a),x, algorithm="fricas")
Output:
[1/2*(sqrt(b^2 - 4*a*c)*((2*c*d - b*e)*f - (b*d - 2*a*e)*g)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c - sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a )) - ((b^2 - 4*a*c)*e*f - (b^2 - 4*a*c)*d*g)*log(c*x^2 + b*x + a) + 2*((b^ 2 - 4*a*c)*e*f - (b^2 - 4*a*c)*d*g)*log(e*x + d))/((b^2*c - 4*a*c^2)*d^2 - (b^3 - 4*a*b*c)*d*e + (a*b^2 - 4*a^2*c)*e^2), -1/2*(2*sqrt(-b^2 + 4*a*c)* ((2*c*d - b*e)*f - (b*d - 2*a*e)*g)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b) /(b^2 - 4*a*c)) + ((b^2 - 4*a*c)*e*f - (b^2 - 4*a*c)*d*g)*log(c*x^2 + b*x + a) - 2*((b^2 - 4*a*c)*e*f - (b^2 - 4*a*c)*d*g)*log(e*x + d))/((b^2*c - 4 *a*c^2)*d^2 - (b^3 - 4*a*b*c)*d*e + (a*b^2 - 4*a^2*c)*e^2)]
Timed out. \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=\text {Timed out} \] Input:
integrate((g*x+f)/(e*x+d)/(c*x**2+b*x+a),x)
Output:
Timed out
Exception generated. \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((g*x+f)/(e*x+d)/(c*x^2+b*x+a),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*a*c-b^2>0)', see `assume?` for more deta
Time = 0.21 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.03 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=-\frac {{\left (e f - d g\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (c d^{2} - b d e + a e^{2}\right )}} + \frac {{\left (e^{2} f - d e g\right )} \log \left ({\left | e x + d \right |}\right )}{c d^{2} e - b d e^{2} + a e^{3}} + \frac {{\left (2 \, c d f - b e f - b d g + 2 \, a e g\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (c d^{2} - b d e + a e^{2}\right )} \sqrt {-b^{2} + 4 \, a c}} \] Input:
integrate((g*x+f)/(e*x+d)/(c*x^2+b*x+a),x, algorithm="giac")
Output:
-1/2*(e*f - d*g)*log(c*x^2 + b*x + a)/(c*d^2 - b*d*e + a*e^2) + (e^2*f - d *e*g)*log(abs(e*x + d))/(c*d^2*e - b*d*e^2 + a*e^3) + (2*c*d*f - b*e*f - b *d*g + 2*a*e*g)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((c*d^2 - b*d*e + a *e^2)*sqrt(-b^2 + 4*a*c))
Time = 18.53 (sec) , antiderivative size = 1026, normalized size of antiderivative = 6.93 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx =\text {Too large to display} \] Input:
int((f + g*x)/((d + e*x)*(a + b*x + c*x^2)),x)
Output:
(log(c*e*g^2*x + ((a*c*e^2*g - b*c*e^2*f - c^2*d*e*f + c*e*x*(b*e*g + c*d* g - 3*c*e*f) + b*c*d*e*g - (c*e*(2*b^2*e^2*x + 2*c^2*d^2*x + a*b*e^2 + b*c *d^2 + b^2*d*e - 6*a*c*e^2*x - 8*a*c*d*e - 2*b*c*d*e*x)*((b^2*d*g)/2 - (b^ 2*e*f)/2 + a*e*g*(b^2 - 4*a*c)^(1/2) - (b*d*g*(b^2 - 4*a*c)^(1/2))/2 - (b* e*f*(b^2 - 4*a*c)^(1/2))/2 + c*d*f*(b^2 - 4*a*c)^(1/2) - 2*a*c*d*g + 2*a*c *e*f))/((4*a*c - b^2)*(a*e^2 + c*d^2 - b*d*e)))*((b^2*d*g)/2 - (b^2*e*f)/2 + a*e*g*(b^2 - 4*a*c)^(1/2) - (b*d*g*(b^2 - 4*a*c)^(1/2))/2 - (b*e*f*(b^2 - 4*a*c)^(1/2))/2 + c*d*f*(b^2 - 4*a*c)^(1/2) - 2*a*c*d*g + 2*a*c*e*f))/( (4*a*c - b^2)*(a*e^2 + c*d^2 - b*d*e)) + c*e*f*g)*(b^2*((d*g)/2 - (e*f)/2) - b*((d*g*(b^2 - 4*a*c)^(1/2))/2 + (e*f*(b^2 - 4*a*c)^(1/2))/2) + a*e*g*( b^2 - 4*a*c)^(1/2) + c*d*f*(b^2 - 4*a*c)^(1/2) - 2*a*c*d*g + 2*a*c*e*f))/( a*b^2*e^2 - 4*a*c^2*d^2 - 4*a^2*c*e^2 + b^2*c*d^2 - b^3*d*e + 4*a*b*c*d*e) + (log(c*e*g^2*x + ((a*c*e^2*g - b*c*e^2*f - c^2*d*e*f + c*e*x*(b*e*g + c *d*g - 3*c*e*f) + b*c*d*e*g - (c*e*(2*b^2*e^2*x + 2*c^2*d^2*x + a*b*e^2 + b*c*d^2 + b^2*d*e - 6*a*c*e^2*x - 8*a*c*d*e - 2*b*c*d*e*x)*((b^2*d*g)/2 - (b^2*e*f)/2 - a*e*g*(b^2 - 4*a*c)^(1/2) + (b*d*g*(b^2 - 4*a*c)^(1/2))/2 + (b*e*f*(b^2 - 4*a*c)^(1/2))/2 - c*d*f*(b^2 - 4*a*c)^(1/2) - 2*a*c*d*g + 2* a*c*e*f))/((4*a*c - b^2)*(a*e^2 + c*d^2 - b*d*e)))*((b^2*d*g)/2 - (b^2*e*f )/2 - a*e*g*(b^2 - 4*a*c)^(1/2) + (b*d*g*(b^2 - 4*a*c)^(1/2))/2 + (b*e*f*( b^2 - 4*a*c)^(1/2))/2 - c*d*f*(b^2 - 4*a*c)^(1/2) - 2*a*c*d*g + 2*a*c*e...
Time = 0.21 (sec) , antiderivative size = 322, normalized size of antiderivative = 2.18 \[ \int \frac {f+g x}{(d+e x) \left (a+b x+c x^2\right )} \, dx=\frac {4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a e g -2 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b d g -2 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b e f +4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) c d f +4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a c d g -4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a c e f -\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{2} d g +\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{2} e f -8 \,\mathrm {log}\left (e x +d \right ) a c d g +8 \,\mathrm {log}\left (e x +d \right ) a c e f +2 \,\mathrm {log}\left (e x +d \right ) b^{2} d g -2 \,\mathrm {log}\left (e x +d \right ) b^{2} e f}{8 a^{2} c \,e^{2}-2 a \,b^{2} e^{2}-8 a b c d e +8 a \,c^{2} d^{2}+2 b^{3} d e -2 b^{2} c \,d^{2}} \] Input:
int((g*x+f)/(e*x+d)/(c*x^2+b*x+a),x)
Output:
(4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*e*g - 2*sqrt( 4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*d*g - 2*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*e*f + 4*sqrt(4*a*c - b**2)*at an((b + 2*c*x)/sqrt(4*a*c - b**2))*c*d*f + 4*log(a + b*x + c*x**2)*a*c*d*g - 4*log(a + b*x + c*x**2)*a*c*e*f - log(a + b*x + c*x**2)*b**2*d*g + log( a + b*x + c*x**2)*b**2*e*f - 8*log(d + e*x)*a*c*d*g + 8*log(d + e*x)*a*c*e *f + 2*log(d + e*x)*b**2*d*g - 2*log(d + e*x)*b**2*e*f)/(2*(4*a**2*c*e**2 - a*b**2*e**2 - 4*a*b*c*d*e + 4*a*c**2*d**2 + b**3*d*e - b**2*c*d**2))