Integrand size = 29, antiderivative size = 113 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=-\frac {(e f-d g)^2}{6 d e^3 (d+e x)^3}-\frac {(e f-d g) (e f+3 d g)}{8 d^2 e^3 (d+e x)^2}-\frac {(e f+d g)^2}{8 d^3 e^3 (d+e x)}+\frac {(e f+d g)^2 \text {arctanh}\left (\frac {e x}{d}\right )}{8 d^4 e^3} \] Output:
-1/6*(-d*g+e*f)^2/d/e^3/(e*x+d)^3-1/8*(-d*g+e*f)*(3*d*g+e*f)/d^2/e^3/(e*x+ d)^2-1/8*(d*g+e*f)^2/d^3/e^3/(e*x+d)+1/8*(d*g+e*f)^2*arctanh(e*x/d)/d^4/e^ 3
Time = 0.04 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.08 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=\frac {-\frac {8 d^3 (e f-d g)^2}{(d+e x)^3}+\frac {6 d^2 \left (-e^2 f^2-2 d e f g+3 d^2 g^2\right )}{(d+e x)^2}-\frac {6 d (e f+d g)^2}{d+e x}-3 (e f+d g)^2 \log (d-e x)+3 (e f+d g)^2 \log (d+e x)}{48 d^4 e^3} \] Input:
Integrate[(f + g*x)^2/((d + e*x)^3*(d^2 - e^2*x^2)),x]
Output:
((-8*d^3*(e*f - d*g)^2)/(d + e*x)^3 + (6*d^2*(-(e^2*f^2) - 2*d*e*f*g + 3*d ^2*g^2))/(d + e*x)^2 - (6*d*(e*f + d*g)^2)/(d + e*x) - 3*(e*f + d*g)^2*Log [d - e*x] + 3*(e*f + d*g)^2*Log[d + e*x])/(48*d^4*e^3)
Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {639, 99, 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)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx\) |
\(\Big \downarrow \) 639 |
\(\displaystyle \int \frac {(f+g x)^2}{(d-e x) (d+e x)^4}dx\) |
\(\Big \downarrow \) 99 |
\(\displaystyle \int \left (\frac {(d g+e f)^2}{8 d^3 e^2 (d+e x)^2}+\frac {(e f-d g) (3 d g+e f)}{4 d^2 e^2 (d+e x)^3}+\frac {(d g+e f)^2}{8 d^3 e^2 \left (d^2-e^2 x^2\right )}+\frac {(d g-e f)^2}{2 d e^2 (d+e x)^4}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\text {arctanh}\left (\frac {e x}{d}\right ) (d g+e f)^2}{8 d^4 e^3}-\frac {(d g+e f)^2}{8 d^3 e^3 (d+e x)}-\frac {(3 d g+e f) (e f-d g)}{8 d^2 e^3 (d+e x)^2}-\frac {(e f-d g)^2}{6 d e^3 (d+e x)^3}\) |
Input:
Int[(f + g*x)^2/((d + e*x)^3*(d^2 - e^2*x^2)),x]
Output:
-1/6*(e*f - d*g)^2/(d*e^3*(d + e*x)^3) - ((e*f - d*g)*(e*f + 3*d*g))/(8*d^ 2*e^3*(d + e*x)^2) - (e*f + d*g)^2/(8*d^3*e^3*(d + e*x)) + ((e*f + d*g)^2* ArcTanh[(e*x)/d])/(8*d^4*e^3)
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) )^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | | (GtQ[m, 0] && GeQ[n, -1]))
Int[((c_) + (d_.)*(x_))^(m_.)*((e_) + (f_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^ 2)^(p_.), x_Symbol] :> Int[(c + d*x)^(m + p)*(e + f*x)^n*(a/c + (b/d)*x)^p, x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[b*c^2 + a*d^2, 0] && (I ntegerQ[p] || (GtQ[a, 0] && GtQ[c, 0] && !IntegerQ[m]))
Time = 0.94 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.57
method | result | size |
norman | \(\frac {-\frac {\left (d^{2} g^{2}-2 d e f g -5 e^{2} f^{2}\right ) x^{3}}{12 d^{4}}-\frac {\left (d^{2} g^{2}+2 d e f g -7 e^{2} f^{2}\right ) x}{8 d^{2} e^{2}}-\frac {\left (3 d^{2} g^{2}-2 d e f g -9 e^{2} f^{2}\right ) x^{2}}{8 d^{3} e}}{\left (e x +d \right )^{3}}-\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 d^{4} e^{3}}+\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 d^{4} e^{3}}\) | \(177\) |
default | \(-\frac {-3 d^{2} g^{2}+2 d e f g +e^{2} f^{2}}{8 d^{2} e^{3} \left (e x +d \right )^{2}}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{6 e^{3} d \left (e x +d \right )^{3}}+\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 d^{4} e^{3}}-\frac {d^{2} g^{2}+2 d e f g +e^{2} f^{2}}{8 d^{3} e^{3} \left (e x +d \right )}+\frac {\left (-d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 d^{4} e^{3}}\) | \(184\) |
risch | \(\frac {-\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) x^{2}}{8 d^{3} e}+\frac {\left (d^{2} g^{2}-6 d e f g -3 e^{2} f^{2}\right ) x}{8 d^{2} e^{2}}+\frac {d^{2} g^{2}-2 d e f g -5 e^{2} f^{2}}{12 d \,e^{3}}}{\left (e x +d \right )^{3}}-\frac {\ln \left (-e x +d \right ) g^{2}}{16 d^{2} e^{3}}-\frac {\ln \left (-e x +d \right ) f g}{8 d^{3} e^{2}}-\frac {\ln \left (-e x +d \right ) f^{2}}{16 d^{4} e}+\frac {\ln \left (e x +d \right ) g^{2}}{16 d^{2} e^{3}}+\frac {\ln \left (e x +d \right ) f g}{8 d^{3} e^{2}}+\frac {\ln \left (e x +d \right ) f^{2}}{16 d^{4} e}\) | \(207\) |
parallelrisch | \(-\frac {18 \ln \left (e x -d \right ) x^{2} d^{2} e^{3} f g +3 \ln \left (e x -d \right ) x^{3} e^{5} f^{2}-3 \ln \left (e x +d \right ) x^{3} e^{5} f^{2}-3 \ln \left (e x +d \right ) d^{3} e^{2} f^{2}+3 \ln \left (e x -d \right ) d^{3} e^{2} f^{2}+6 x \,d^{4} e \,g^{2}-42 x \,d^{2} e^{3} f^{2}+6 \ln \left (e x -d \right ) x^{3} d \,e^{4} f g +4 x^{3} d^{2} e^{3} g^{2}+18 x^{2} d^{3} e^{2} g^{2}-54 x^{2} d \,e^{4} f^{2}-18 \ln \left (e x +d \right ) x^{2} d^{2} e^{3} f g +18 \ln \left (e x -d \right ) x \,d^{3} e^{2} f g -18 \ln \left (e x +d \right ) x \,d^{3} e^{2} f g -6 \ln \left (e x +d \right ) x^{3} d \,e^{4} f g -8 x^{3} d \,e^{4} f g -12 x^{2} d^{2} e^{3} f g +6 \ln \left (e x -d \right ) d^{4} e f g +12 x \,d^{3} e^{2} f g +9 \ln \left (e x -d \right ) x^{2} d \,e^{4} f^{2}-9 \ln \left (e x +d \right ) x^{2} d^{3} e^{2} g^{2}-9 \ln \left (e x +d \right ) x^{2} d \,e^{4} f^{2}+9 \ln \left (e x -d \right ) x \,d^{4} e \,g^{2}+9 \ln \left (e x -d \right ) x \,d^{2} e^{3} f^{2}-9 \ln \left (e x +d \right ) x \,d^{4} e \,g^{2}-9 \ln \left (e x +d \right ) x \,d^{2} e^{3} f^{2}-6 \ln \left (e x +d \right ) d^{4} e f g +3 \ln \left (e x -d \right ) x^{3} d^{2} e^{3} g^{2}-3 \ln \left (e x +d \right ) x^{3} d^{2} e^{3} g^{2}+9 \ln \left (e x -d \right ) x^{2} d^{3} e^{2} g^{2}-3 \ln \left (e x +d \right ) d^{5} g^{2}+3 \ln \left (e x -d \right ) d^{5} g^{2}-20 x^{3} e^{5} f^{2}}{48 d^{4} e^{3} \left (e x +d \right )^{3}}\) | \(563\) |
Input:
int((g*x+f)^2/(e*x+d)^3/(-e^2*x^2+d^2),x,method=_RETURNVERBOSE)
Output:
(-1/12*(d^2*g^2-2*d*e*f*g-5*e^2*f^2)/d^4*x^3-1/8*(d^2*g^2+2*d*e*f*g-7*e^2* f^2)/d^2/e^2*x-1/8*(3*d^2*g^2-2*d*e*f*g-9*e^2*f^2)/d^3/e*x^2)/(e*x+d)^3-1/ 16*(d^2*g^2+2*d*e*f*g+e^2*f^2)/d^4/e^3*ln(-e*x+d)+1/16*(d^2*g^2+2*d*e*f*g+ e^2*f^2)/d^4/e^3*ln(e*x+d)
Leaf count of result is larger than twice the leaf count of optimal. 400 vs. \(2 (105) = 210\).
Time = 0.08 (sec) , antiderivative size = 400, normalized size of antiderivative = 3.54 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=-\frac {20 \, d^{3} e^{2} f^{2} + 8 \, d^{4} e f g - 4 \, d^{5} g^{2} + 6 \, {\left (d e^{4} f^{2} + 2 \, d^{2} e^{3} f g + d^{3} e^{2} g^{2}\right )} x^{2} + 6 \, {\left (3 \, d^{2} e^{3} f^{2} + 6 \, d^{3} e^{2} f g - d^{4} e g^{2}\right )} x - 3 \, {\left (d^{3} e^{2} f^{2} + 2 \, d^{4} e f g + d^{5} g^{2} + {\left (e^{5} f^{2} + 2 \, d e^{4} f g + d^{2} e^{3} g^{2}\right )} x^{3} + 3 \, {\left (d e^{4} f^{2} + 2 \, d^{2} e^{3} f g + d^{3} e^{2} g^{2}\right )} x^{2} + 3 \, {\left (d^{2} e^{3} f^{2} + 2 \, d^{3} e^{2} f g + d^{4} e g^{2}\right )} x\right )} \log \left (e x + d\right ) + 3 \, {\left (d^{3} e^{2} f^{2} + 2 \, d^{4} e f g + d^{5} g^{2} + {\left (e^{5} f^{2} + 2 \, d e^{4} f g + d^{2} e^{3} g^{2}\right )} x^{3} + 3 \, {\left (d e^{4} f^{2} + 2 \, d^{2} e^{3} f g + d^{3} e^{2} g^{2}\right )} x^{2} + 3 \, {\left (d^{2} e^{3} f^{2} + 2 \, d^{3} e^{2} f g + d^{4} e g^{2}\right )} x\right )} \log \left (e x - d\right )}{48 \, {\left (d^{4} e^{6} x^{3} + 3 \, d^{5} e^{5} x^{2} + 3 \, d^{6} e^{4} x + d^{7} e^{3}\right )}} \] Input:
integrate((g*x+f)^2/(e*x+d)^3/(-e^2*x^2+d^2),x, algorithm="fricas")
Output:
-1/48*(20*d^3*e^2*f^2 + 8*d^4*e*f*g - 4*d^5*g^2 + 6*(d*e^4*f^2 + 2*d^2*e^3 *f*g + d^3*e^2*g^2)*x^2 + 6*(3*d^2*e^3*f^2 + 6*d^3*e^2*f*g - d^4*e*g^2)*x - 3*(d^3*e^2*f^2 + 2*d^4*e*f*g + d^5*g^2 + (e^5*f^2 + 2*d*e^4*f*g + d^2*e^ 3*g^2)*x^3 + 3*(d*e^4*f^2 + 2*d^2*e^3*f*g + d^3*e^2*g^2)*x^2 + 3*(d^2*e^3* f^2 + 2*d^3*e^2*f*g + d^4*e*g^2)*x)*log(e*x + d) + 3*(d^3*e^2*f^2 + 2*d^4* e*f*g + d^5*g^2 + (e^5*f^2 + 2*d*e^4*f*g + d^2*e^3*g^2)*x^3 + 3*(d*e^4*f^2 + 2*d^2*e^3*f*g + d^3*e^2*g^2)*x^2 + 3*(d^2*e^3*f^2 + 2*d^3*e^2*f*g + d^4 *e*g^2)*x)*log(e*x - d))/(d^4*e^6*x^3 + 3*d^5*e^5*x^2 + 3*d^6*e^4*x + d^7* e^3)
Leaf count of result is larger than twice the leaf count of optimal. 248 vs. \(2 (99) = 198\).
Time = 0.67 (sec) , antiderivative size = 248, normalized size of antiderivative = 2.19 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=- \frac {- 2 d^{4} g^{2} + 4 d^{3} e f g + 10 d^{2} e^{2} f^{2} + x^{2} \cdot \left (3 d^{2} e^{2} g^{2} + 6 d e^{3} f g + 3 e^{4} f^{2}\right ) + x \left (- 3 d^{3} e g^{2} + 18 d^{2} e^{2} f g + 9 d e^{3} f^{2}\right )}{24 d^{6} e^{3} + 72 d^{5} e^{4} x + 72 d^{4} e^{5} x^{2} + 24 d^{3} e^{6} x^{3}} - \frac {\left (d g + e f\right )^{2} \log {\left (- \frac {d \left (d g + e f\right )^{2}}{e \left (d^{2} g^{2} + 2 d e f g + e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} + \frac {\left (d g + e f\right )^{2} \log {\left (\frac {d \left (d g + e f\right )^{2}}{e \left (d^{2} g^{2} + 2 d e f g + e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} \] Input:
integrate((g*x+f)**2/(e*x+d)**3/(-e**2*x**2+d**2),x)
Output:
-(-2*d**4*g**2 + 4*d**3*e*f*g + 10*d**2*e**2*f**2 + x**2*(3*d**2*e**2*g**2 + 6*d*e**3*f*g + 3*e**4*f**2) + x*(-3*d**3*e*g**2 + 18*d**2*e**2*f*g + 9* d*e**3*f**2))/(24*d**6*e**3 + 72*d**5*e**4*x + 72*d**4*e**5*x**2 + 24*d**3 *e**6*x**3) - (d*g + e*f)**2*log(-d*(d*g + e*f)**2/(e*(d**2*g**2 + 2*d*e*f *g + e**2*f**2)) + x)/(16*d**4*e**3) + (d*g + e*f)**2*log(d*(d*g + e*f)**2 /(e*(d**2*g**2 + 2*d*e*f*g + e**2*f**2)) + x)/(16*d**4*e**3)
Time = 0.04 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.82 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=-\frac {10 \, d^{2} e^{2} f^{2} + 4 \, d^{3} e f g - 2 \, d^{4} g^{2} + 3 \, {\left (e^{4} f^{2} + 2 \, d e^{3} f g + d^{2} e^{2} g^{2}\right )} x^{2} + 3 \, {\left (3 \, d e^{3} f^{2} + 6 \, d^{2} e^{2} f g - d^{3} e g^{2}\right )} x}{24 \, {\left (d^{3} e^{6} x^{3} + 3 \, d^{4} e^{5} x^{2} + 3 \, d^{5} e^{4} x + d^{6} e^{3}\right )}} + \frac {{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x + d\right )}{16 \, d^{4} e^{3}} - \frac {{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x - d\right )}{16 \, d^{4} e^{3}} \] Input:
integrate((g*x+f)^2/(e*x+d)^3/(-e^2*x^2+d^2),x, algorithm="maxima")
Output:
-1/24*(10*d^2*e^2*f^2 + 4*d^3*e*f*g - 2*d^4*g^2 + 3*(e^4*f^2 + 2*d*e^3*f*g + d^2*e^2*g^2)*x^2 + 3*(3*d*e^3*f^2 + 6*d^2*e^2*f*g - d^3*e*g^2)*x)/(d^3* e^6*x^3 + 3*d^4*e^5*x^2 + 3*d^5*e^4*x + d^6*e^3) + 1/16*(e^2*f^2 + 2*d*e*f *g + d^2*g^2)*log(e*x + d)/(d^4*e^3) - 1/16*(e^2*f^2 + 2*d*e*f*g + d^2*g^2 )*log(e*x - d)/(d^4*e^3)
Time = 0.19 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.65 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=\frac {{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left ({\left | e x + d \right |}\right )}{16 \, d^{4} e^{3}} - \frac {{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left ({\left | e x - d \right |}\right )}{16 \, d^{4} e^{3}} - \frac {10 \, d^{3} e^{2} f^{2} + 4 \, d^{4} e f g - 2 \, d^{5} g^{2} + 3 \, {\left (d e^{4} f^{2} + 2 \, d^{2} e^{3} f g + d^{3} e^{2} g^{2}\right )} x^{2} + 3 \, {\left (3 \, d^{2} e^{3} f^{2} + 6 \, d^{3} e^{2} f g - d^{4} e g^{2}\right )} x}{24 \, {\left (e x + d\right )}^{3} d^{4} e^{3}} \] Input:
integrate((g*x+f)^2/(e*x+d)^3/(-e^2*x^2+d^2),x, algorithm="giac")
Output:
1/16*(e^2*f^2 + 2*d*e*f*g + d^2*g^2)*log(abs(e*x + d))/(d^4*e^3) - 1/16*(e ^2*f^2 + 2*d*e*f*g + d^2*g^2)*log(abs(e*x - d))/(d^4*e^3) - 1/24*(10*d^3*e ^2*f^2 + 4*d^4*e*f*g - 2*d^5*g^2 + 3*(d*e^4*f^2 + 2*d^2*e^3*f*g + d^3*e^2* g^2)*x^2 + 3*(3*d^2*e^3*f^2 + 6*d^3*e^2*f*g - d^4*e*g^2)*x)/((e*x + d)^3*d ^4*e^3)
Time = 0.09 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.35 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=\frac {\mathrm {atanh}\left (\frac {e\,x}{d}\right )\,{\left (d\,g+e\,f\right )}^2}{8\,d^4\,e^3}-\frac {\frac {-d^2\,g^2+2\,d\,e\,f\,g+5\,e^2\,f^2}{12\,d\,e^3}+\frac {x\,\left (-d^2\,g^2+6\,d\,e\,f\,g+3\,e^2\,f^2\right )}{8\,d^2\,e^2}+\frac {x^2\,\left (d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2\right )}{8\,d^3\,e}}{d^3+3\,d^2\,e\,x+3\,d\,e^2\,x^2+e^3\,x^3} \] Input:
int((f + g*x)^2/((d^2 - e^2*x^2)*(d + e*x)^3),x)
Output:
(atanh((e*x)/d)*(d*g + e*f)^2)/(8*d^4*e^3) - ((5*e^2*f^2 - d^2*g^2 + 2*d*e *f*g)/(12*d*e^3) + (x*(3*e^2*f^2 - d^2*g^2 + 6*d*e*f*g))/(8*d^2*e^2) + (x^ 2*(d^2*g^2 + e^2*f^2 + 2*d*e*f*g))/(8*d^3*e))/(d^3 + e^3*x^3 + 3*d*e^2*x^2 + 3*d^2*e*x)
Time = 0.20 (sec) , antiderivative size = 560, normalized size of antiderivative = 4.96 \[ \int \frac {(f+g x)^2}{(d+e x)^3 \left (d^2-e^2 x^2\right )} \, dx=\frac {4 d \,e^{4} f g \,x^{3}-3 \,\mathrm {log}\left (-e x +d \right ) e^{5} f^{2} x^{3}+3 \,\mathrm {log}\left (e x +d \right ) d^{3} e^{2} f^{2}+3 \,\mathrm {log}\left (e x +d \right ) e^{5} f^{2} x^{3}-4 d^{4} e f g -6 \,\mathrm {log}\left (-e x +d \right ) d^{4} e f g -24 d^{3} e^{2} f g x +3 \,\mathrm {log}\left (e x +d \right ) d^{5} g^{2}-18 d^{3} e^{2} f^{2}-9 \,\mathrm {log}\left (-e x +d \right ) d^{4} e \,g^{2} x -9 \,\mathrm {log}\left (-e x +d \right ) d^{3} e^{2} g^{2} x^{2}-9 \,\mathrm {log}\left (-e x +d \right ) d^{2} e^{3} f^{2} x -3 \,\mathrm {log}\left (-e x +d \right ) d^{2} e^{3} g^{2} x^{3}-9 \,\mathrm {log}\left (-e x +d \right ) d \,e^{4} f^{2} x^{2}+6 \,\mathrm {log}\left (e x +d \right ) d^{4} e f g +9 \,\mathrm {log}\left (e x +d \right ) d^{4} e \,g^{2} x +9 \,\mathrm {log}\left (e x +d \right ) d^{3} e^{2} g^{2} x^{2}+9 \,\mathrm {log}\left (e x +d \right ) d^{2} e^{3} f^{2} x +3 \,\mathrm {log}\left (e x +d \right ) d^{2} e^{3} g^{2} x^{3}+9 \,\mathrm {log}\left (e x +d \right ) d \,e^{4} f^{2} x^{2}-3 \,\mathrm {log}\left (-e x +d \right ) d^{3} e^{2} f^{2}+12 d^{4} e \,g^{2} x -12 d^{2} e^{3} f^{2} x +2 d^{2} e^{3} g^{2} x^{3}-3 \,\mathrm {log}\left (-e x +d \right ) d^{5} g^{2}+2 e^{5} f^{2} x^{3}-18 \,\mathrm {log}\left (-e x +d \right ) d^{3} e^{2} f g x -18 \,\mathrm {log}\left (-e x +d \right ) d^{2} e^{3} f g \,x^{2}-6 \,\mathrm {log}\left (-e x +d \right ) d \,e^{4} f g \,x^{3}+18 \,\mathrm {log}\left (e x +d \right ) d^{3} e^{2} f g x +18 \,\mathrm {log}\left (e x +d \right ) d^{2} e^{3} f g \,x^{2}+6 \,\mathrm {log}\left (e x +d \right ) d \,e^{4} f g \,x^{3}+6 d^{5} g^{2}}{48 d^{4} e^{3} \left (e^{3} x^{3}+3 d \,e^{2} x^{2}+3 d^{2} e x +d^{3}\right )} \] Input:
int((g*x+f)^2/(e*x+d)^3/(-e^2*x^2+d^2),x)
Output:
( - 3*log(d - e*x)*d**5*g**2 - 6*log(d - e*x)*d**4*e*f*g - 9*log(d - e*x)* d**4*e*g**2*x - 3*log(d - e*x)*d**3*e**2*f**2 - 18*log(d - e*x)*d**3*e**2* f*g*x - 9*log(d - e*x)*d**3*e**2*g**2*x**2 - 9*log(d - e*x)*d**2*e**3*f**2 *x - 18*log(d - e*x)*d**2*e**3*f*g*x**2 - 3*log(d - e*x)*d**2*e**3*g**2*x* *3 - 9*log(d - e*x)*d*e**4*f**2*x**2 - 6*log(d - e*x)*d*e**4*f*g*x**3 - 3* log(d - e*x)*e**5*f**2*x**3 + 3*log(d + e*x)*d**5*g**2 + 6*log(d + e*x)*d* *4*e*f*g + 9*log(d + e*x)*d**4*e*g**2*x + 3*log(d + e*x)*d**3*e**2*f**2 + 18*log(d + e*x)*d**3*e**2*f*g*x + 9*log(d + e*x)*d**3*e**2*g**2*x**2 + 9*l og(d + e*x)*d**2*e**3*f**2*x + 18*log(d + e*x)*d**2*e**3*f*g*x**2 + 3*log( d + e*x)*d**2*e**3*g**2*x**3 + 9*log(d + e*x)*d*e**4*f**2*x**2 + 6*log(d + e*x)*d*e**4*f*g*x**3 + 3*log(d + e*x)*e**5*f**2*x**3 + 6*d**5*g**2 - 4*d* *4*e*f*g + 12*d**4*e*g**2*x - 18*d**3*e**2*f**2 - 24*d**3*e**2*f*g*x - 12* d**2*e**3*f**2*x + 2*d**2*e**3*g**2*x**3 + 4*d*e**4*f*g*x**3 + 2*e**5*f**2 *x**3)/(48*d**4*e**3*(d**3 + 3*d**2*e*x + 3*d*e**2*x**2 + e**3*x**3))