\(\int (e+f x)^2 (a+b \coth ^{-1}(c+d x)) \, dx\) [103]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 120 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e+f-c f)^3 \log (1-c-d x)}{6 d^3 f}-\frac {b (d e-(1+c) f)^3 \log (1+c+d x)}{6 d^3 f} \]

[Out]

b*f*(-c*f+d*e)*x/d^2+1/6*b*f^2*(d*x+c)^2/d^3+1/3*(f*x+e)^3*(a+b*arccoth(d*x+c))/f+1/6*b*(-c*f+d*e+f)^3*ln(-d*x
-c+1)/d^3/f-1/6*b*(d*e-(1+c)*f)^3*ln(d*x+c+1)/d^3/f

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {6247, 6064, 716, 647, 31} \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}+\frac {b (-c f+d e+f)^3 \log (-c-d x+1)}{6 d^3 f}-\frac {b (d e-(c+1) f)^3 \log (c+d x+1)}{6 d^3 f}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {b f x (d e-c f)}{d^2} \]

[In]

Int[(e + f*x)^2*(a + b*ArcCoth[c + d*x]),x]

[Out]

(b*f*(d*e - c*f)*x)/d^2 + (b*f^2*(c + d*x)^2)/(6*d^3) + ((e + f*x)^3*(a + b*ArcCoth[c + d*x]))/(3*f) + (b*(d*e
 + f - c*f)^3*Log[1 - c - d*x])/(6*d^3*f) - (b*(d*e - (1 + c)*f)^3*Log[1 + c + d*x])/(6*d^3*f)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 647

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[(-a)*c, 2]}, Dist[e/2 + c*(d/(2*q)),
Int[1/(-q + c*x), x], x] + Dist[e/2 - c*(d/(2*q)), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[(-a)*c]

Rule 716

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[(d + e*x)^m, a + c*x^2,
x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[m, 1] && (NeQ[d, 0] || GtQ[m, 2])

Rule 6064

Int[((a_.) + ArcCoth[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b
*ArcCoth[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 - c^2*x^2), x], x] /; FreeQ
[{a, b, c, d, e, q}, x] && NeQ[q, -1]

Rule 6247

Int[((a_.) + ArcCoth[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Dist[1/d, Subst[
Int[((d*e - c*f)/d + f*(x/d))^m*(a + b*ArcCoth[x])^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &
& IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^2 \left (a+b \coth ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d} \\ & = \frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \frac {\left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^3}{1-x^2} \, dx,x,c+d x\right )}{3 f} \\ & = \frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \left (-\frac {3 f^2 (d e-c f)}{d^3}-\frac {f^3 x}{d^3}+\frac {(d e-c f) \left (d^2 e^2-2 c d e f+3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f+\left (1+3 c^2\right ) f^2\right ) x}{d^3 \left (1-x^2\right )}\right ) \, dx,x,c+d x\right )}{3 f} \\ & = \frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \frac {(d e-c f) \left (d^2 e^2-2 c d e f+3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f+\left (1+3 c^2\right ) f^2\right ) x}{1-x^2} \, dx,x,c+d x\right )}{3 d^3 f} \\ & = \frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}-\frac {\left (b (d e+f-c f)^3\right ) \text {Subst}\left (\int \frac {1}{1-x} \, dx,x,c+d x\right )}{6 d^3 f}+\frac {\left (b (d e-(1+c) f)^3\right ) \text {Subst}\left (\int \frac {1}{-1-x} \, dx,x,c+d x\right )}{6 d^3 f} \\ & = \frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \coth ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e+f-c f)^3 \log (1-c-d x)}{6 d^3 f}-\frac {b (d e-(1+c) f)^3 \log (1+c+d x)}{6 d^3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.45 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\frac {2 d \left (3 a d^2 e^2+b f (3 d e-2 c f)\right ) x+d^2 f (6 a d e+b f) x^2+2 a d^3 f^2 x^3+2 b d^3 x \left (3 e^2+3 e f x+f^2 x^2\right ) \coth ^{-1}(c+d x)-b (-1+c) \left (3 d^2 e^2-3 (-1+c) d e f+(-1+c)^2 f^2\right ) \log (1-c-d x)+b (1+c) \left (3 d^2 e^2-3 (1+c) d e f+(1+c)^2 f^2\right ) \log (1+c+d x)}{6 d^3} \]

[In]

Integrate[(e + f*x)^2*(a + b*ArcCoth[c + d*x]),x]

[Out]

(2*d*(3*a*d^2*e^2 + b*f*(3*d*e - 2*c*f))*x + d^2*f*(6*a*d*e + b*f)*x^2 + 2*a*d^3*f^2*x^3 + 2*b*d^3*x*(3*e^2 +
3*e*f*x + f^2*x^2)*ArcCoth[c + d*x] - b*(-1 + c)*(3*d^2*e^2 - 3*(-1 + c)*d*e*f + (-1 + c)^2*f^2)*Log[1 - c - d
*x] + b*(1 + c)*(3*d^2*e^2 - 3*(1 + c)*d*e*f + (1 + c)^2*f^2)*Log[1 + c + d*x])/(6*d^3)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(350\) vs. \(2(112)=224\).

Time = 0.48 (sec) , antiderivative size = 351, normalized size of antiderivative = 2.92

method result size
parallelrisch \(\frac {6 x^{2} a \,d^{3} e f +6 x \,\operatorname {arccoth}\left (d x +c \right ) b \,d^{3} e^{2}+2 x^{3} \operatorname {arccoth}\left (d x +c \right ) b \,d^{3} f^{2}+6 \,\operatorname {arccoth}\left (d x +c \right ) b c \,d^{2} e^{2}-6 \,\operatorname {arccoth}\left (d x +c \right ) b d e f -4 x b c d \,f^{2}+6 x b \,d^{2} e f -6 a \,c^{2} e f d +x^{2} b \,d^{2} f^{2}+2 \,\operatorname {arccoth}\left (d x +c \right ) b \,c^{3} f^{2}+6 \,\operatorname {arccoth}\left (d x +c \right ) b \,c^{2} f^{2}+6 \,\operatorname {arccoth}\left (d x +c \right ) b \,d^{2} e^{2}+6 \,\operatorname {arccoth}\left (d x +c \right ) b c \,f^{2}+6 x a \,d^{3} e^{2}+2 x^{3} a \,d^{3} f^{2}+6 \ln \left (d x +c -1\right ) b \,c^{2} f^{2}+6 \ln \left (d x +c -1\right ) b \,d^{2} e^{2}-12 a c \,e^{2} d^{2}-12 \ln \left (d x +c -1\right ) b c d e f +6 x^{2} \operatorname {arccoth}\left (d x +c \right ) b \,d^{3} e f -12 \,\operatorname {arccoth}\left (d x +c \right ) b c d e f -6 \,\operatorname {arccoth}\left (d x +c \right ) b \,c^{2} d e f +b \,f^{2}+7 b \,c^{2} f^{2}+6 a e f d -12 b c d e f +2 \ln \left (d x +c -1\right ) b \,f^{2}+2 \,\operatorname {arccoth}\left (d x +c \right ) b \,f^{2}}{6 d^{3}}\) \(351\)
parts \(\frac {a \left (f x +e \right )^{3}}{3 f}+\frac {b \left (\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right )^{3}}{3 d^{2}}-\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right )^{2} c}{d^{2}}+\frac {f \,\operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right )^{2} e}{d}+\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right ) c^{2}}{d^{2}}-\frac {2 f \,\operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right ) c e}{d}+\operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right ) e^{2}-\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) c^{3}}{3 d^{2}}+\frac {f \,\operatorname {arccoth}\left (d x +c \right ) c^{2} e}{d}-\operatorname {arccoth}\left (d x +c \right ) c \,e^{2}+\frac {d \,\operatorname {arccoth}\left (d x +c \right ) e^{3}}{3 f}+\frac {\frac {f^{3} \left (d x +c \right )^{2}}{2}-3 c \,f^{3} \left (d x +c \right )+3 d e \,f^{2} \left (d x +c \right )+\frac {\left (-c^{3} f^{3}+3 c^{2} d e \,f^{2}-3 c \,d^{2} e^{2} f +d^{3} e^{3}+3 c^{2} f^{3}-6 c d e \,f^{2}+3 d^{2} e^{2} f -3 c \,f^{3}+3 d e \,f^{2}+f^{3}\right ) \ln \left (d x +c -1\right )}{2}-\frac {\left (-c^{3} f^{3}+3 c^{2} d e \,f^{2}-3 c \,d^{2} e^{2} f +d^{3} e^{3}-3 c^{2} f^{3}+6 c d e \,f^{2}-3 d^{2} e^{2} f -3 c \,f^{3}+3 d e \,f^{2}-f^{3}\right ) \ln \left (d x +c +1\right )}{2}}{3 d^{2} f}\right )}{d}\) \(415\)
derivativedivides \(\frac {-\frac {a \left (c f -d e -f \left (d x +c \right )\right )^{3}}{3 d^{2} f}+\frac {b \left (-\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) c^{3}}{3}+f \,\operatorname {arccoth}\left (d x +c \right ) c^{2} d e +f^{2} \operatorname {arccoth}\left (d x +c \right ) c^{2} \left (d x +c \right )-\operatorname {arccoth}\left (d x +c \right ) c \,d^{2} e^{2}-2 f \,\operatorname {arccoth}\left (d x +c \right ) c d e \left (d x +c \right )-f^{2} \operatorname {arccoth}\left (d x +c \right ) c \left (d x +c \right )^{2}+\frac {\operatorname {arccoth}\left (d x +c \right ) d^{3} e^{3}}{3 f}+\operatorname {arccoth}\left (d x +c \right ) d^{2} e^{2} \left (d x +c \right )+f \,\operatorname {arccoth}\left (d x +c \right ) d e \left (d x +c \right )^{2}+\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right )^{3}}{3}-\frac {3 c \,f^{3} \left (d x +c \right )-3 d e \,f^{2} \left (d x +c \right )-\frac {f^{3} \left (d x +c \right )^{2}}{2}+\frac {\left (c^{3} f^{3}-3 c^{2} d e \,f^{2}+3 c \,d^{2} e^{2} f -d^{3} e^{3}-3 c^{2} f^{3}+6 c d e \,f^{2}-3 d^{2} e^{2} f +3 c \,f^{3}-3 d e \,f^{2}-f^{3}\right ) \ln \left (d x +c -1\right )}{2}-\frac {\left (c^{3} f^{3}-3 c^{2} d e \,f^{2}+3 c \,d^{2} e^{2} f -d^{3} e^{3}+3 c^{2} f^{3}-6 c d e \,f^{2}+3 d^{2} e^{2} f +3 c \,f^{3}-3 d e \,f^{2}+f^{3}\right ) \ln \left (d x +c +1\right )}{2}}{3 f}\right )}{d^{2}}}{d}\) \(420\)
default \(\frac {-\frac {a \left (c f -d e -f \left (d x +c \right )\right )^{3}}{3 d^{2} f}+\frac {b \left (-\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) c^{3}}{3}+f \,\operatorname {arccoth}\left (d x +c \right ) c^{2} d e +f^{2} \operatorname {arccoth}\left (d x +c \right ) c^{2} \left (d x +c \right )-\operatorname {arccoth}\left (d x +c \right ) c \,d^{2} e^{2}-2 f \,\operatorname {arccoth}\left (d x +c \right ) c d e \left (d x +c \right )-f^{2} \operatorname {arccoth}\left (d x +c \right ) c \left (d x +c \right )^{2}+\frac {\operatorname {arccoth}\left (d x +c \right ) d^{3} e^{3}}{3 f}+\operatorname {arccoth}\left (d x +c \right ) d^{2} e^{2} \left (d x +c \right )+f \,\operatorname {arccoth}\left (d x +c \right ) d e \left (d x +c \right )^{2}+\frac {f^{2} \operatorname {arccoth}\left (d x +c \right ) \left (d x +c \right )^{3}}{3}-\frac {3 c \,f^{3} \left (d x +c \right )-3 d e \,f^{2} \left (d x +c \right )-\frac {f^{3} \left (d x +c \right )^{2}}{2}+\frac {\left (c^{3} f^{3}-3 c^{2} d e \,f^{2}+3 c \,d^{2} e^{2} f -d^{3} e^{3}-3 c^{2} f^{3}+6 c d e \,f^{2}-3 d^{2} e^{2} f +3 c \,f^{3}-3 d e \,f^{2}-f^{3}\right ) \ln \left (d x +c -1\right )}{2}-\frac {\left (c^{3} f^{3}-3 c^{2} d e \,f^{2}+3 c \,d^{2} e^{2} f -d^{3} e^{3}+3 c^{2} f^{3}-6 c d e \,f^{2}+3 d^{2} e^{2} f +3 c \,f^{3}-3 d e \,f^{2}+f^{3}\right ) \ln \left (d x +c +1\right )}{2}}{3 f}\right )}{d^{2}}}{d}\) \(420\)
risch \(-\frac {\ln \left (-d x -c -1\right ) b \,e^{3}}{6 f}-\frac {b \,e^{2} x \ln \left (d x +c -1\right )}{2}+\frac {f^{2} a \,x^{3}}{3}+\frac {f^{2} b \,x^{2}}{6 d}+\frac {f^{2} \ln \left (-d x -c -1\right ) b}{6 d^{3}}+\frac {f^{2} \ln \left (d x +c -1\right ) b}{6 d^{3}}+\frac {\ln \left (-d x -c -1\right ) b \,e^{2}}{2 d}+\frac {\ln \left (d x +c -1\right ) b \,e^{2}}{2 d}-\frac {f^{2} b \,x^{3} \ln \left (d x +c -1\right )}{6}+a \,e^{2} x -\frac {2 f^{2} b c x}{3 d^{2}}+\frac {f b e x}{d}-\frac {f^{2} \ln \left (d x +c -1\right ) b \,c^{3}}{6 d^{3}}+\frac {f^{2} \ln \left (-d x -c -1\right ) b \,c^{2}}{2 d^{3}}+\frac {f^{2} \ln \left (d x +c -1\right ) b \,c^{2}}{2 d^{3}}+\frac {f^{2} \ln \left (-d x -c -1\right ) b c}{2 d^{3}}-\frac {f \ln \left (-d x -c -1\right ) b e}{2 d^{2}}-\frac {f^{2} \ln \left (d x +c -1\right ) b c}{2 d^{3}}+\frac {f \ln \left (d x +c -1\right ) b e}{2 d^{2}}+\frac {f^{2} \ln \left (-d x -c -1\right ) b \,c^{3}}{6 d^{3}}-\frac {\ln \left (d x +c -1\right ) b c \,e^{2}}{2 d}-\frac {f b e \,x^{2} \ln \left (d x +c -1\right )}{2}+\frac {\ln \left (-d x -c -1\right ) b c \,e^{2}}{2 d}+f a e \,x^{2}+\frac {\left (f x +e \right )^{3} b \ln \left (d x +c +1\right )}{6 f}+\frac {f \ln \left (d x +c -1\right ) b \,c^{2} e}{2 d^{2}}-\frac {f \ln \left (-d x -c -1\right ) b c e}{d^{2}}-\frac {f \ln \left (d x +c -1\right ) b c e}{d^{2}}-\frac {f \ln \left (-d x -c -1\right ) b \,c^{2} e}{2 d^{2}}\) \(472\)

[In]

int((f*x+e)^2*(a+b*arccoth(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/6*(6*x^2*a*d^3*e*f+6*x*arccoth(d*x+c)*b*d^3*e^2+2*x^3*arccoth(d*x+c)*b*d^3*f^2+6*arccoth(d*x+c)*b*c*d^2*e^2-
6*arccoth(d*x+c)*b*d*e*f-4*x*b*c*d*f^2+6*x*b*d^2*e*f-6*a*c^2*e*f*d+x^2*b*d^2*f^2+2*arccoth(d*x+c)*b*c^3*f^2+6*
arccoth(d*x+c)*b*c^2*f^2+6*arccoth(d*x+c)*b*d^2*e^2+6*arccoth(d*x+c)*b*c*f^2+6*x*a*d^3*e^2+2*x^3*a*d^3*f^2+6*l
n(d*x+c-1)*b*c^2*f^2+6*ln(d*x+c-1)*b*d^2*e^2-12*a*c*e^2*d^2-12*ln(d*x+c-1)*b*c*d*e*f+6*x^2*arccoth(d*x+c)*b*d^
3*e*f-12*arccoth(d*x+c)*b*c*d*e*f-6*arccoth(d*x+c)*b*c^2*d*e*f+b*f^2+7*b*c^2*f^2+6*a*e*f*d-12*b*c*d*e*f+2*ln(d
*x+c-1)*b*f^2+2*arccoth(d*x+c)*b*f^2)/d^3

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 241 vs. \(2 (112) = 224\).

Time = 0.27 (sec) , antiderivative size = 241, normalized size of antiderivative = 2.01 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\frac {2 \, a d^{3} f^{2} x^{3} + {\left (6 \, a d^{3} e f + b d^{2} f^{2}\right )} x^{2} + 2 \, {\left (3 \, a d^{3} e^{2} + 3 \, b d^{2} e f - 2 \, b c d f^{2}\right )} x + {\left (3 \, {\left (b c + b\right )} d^{2} e^{2} - 3 \, {\left (b c^{2} + 2 \, b c + b\right )} d e f + {\left (b c^{3} + 3 \, b c^{2} + 3 \, b c + b\right )} f^{2}\right )} \log \left (d x + c + 1\right ) - {\left (3 \, {\left (b c - b\right )} d^{2} e^{2} - 3 \, {\left (b c^{2} - 2 \, b c + b\right )} d e f + {\left (b c^{3} - 3 \, b c^{2} + 3 \, b c - b\right )} f^{2}\right )} \log \left (d x + c - 1\right ) + {\left (b d^{3} f^{2} x^{3} + 3 \, b d^{3} e f x^{2} + 3 \, b d^{3} e^{2} x\right )} \log \left (\frac {d x + c + 1}{d x + c - 1}\right )}{6 \, d^{3}} \]

[In]

integrate((f*x+e)^2*(a+b*arccoth(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(2*a*d^3*f^2*x^3 + (6*a*d^3*e*f + b*d^2*f^2)*x^2 + 2*(3*a*d^3*e^2 + 3*b*d^2*e*f - 2*b*c*d*f^2)*x + (3*(b*c
 + b)*d^2*e^2 - 3*(b*c^2 + 2*b*c + b)*d*e*f + (b*c^3 + 3*b*c^2 + 3*b*c + b)*f^2)*log(d*x + c + 1) - (3*(b*c -
b)*d^2*e^2 - 3*(b*c^2 - 2*b*c + b)*d*e*f + (b*c^3 - 3*b*c^2 + 3*b*c - b)*f^2)*log(d*x + c - 1) + (b*d^3*f^2*x^
3 + 3*b*d^3*e*f*x^2 + 3*b*d^3*e^2*x)*log((d*x + c + 1)/(d*x + c - 1)))/d^3

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 369 vs. \(2 (105) = 210\).

Time = 0.52 (sec) , antiderivative size = 369, normalized size of antiderivative = 3.08 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\begin {cases} a e^{2} x + a e f x^{2} + \frac {a f^{2} x^{3}}{3} + \frac {b c^{3} f^{2} \operatorname {acoth}{\left (c + d x \right )}}{3 d^{3}} - \frac {b c^{2} e f \operatorname {acoth}{\left (c + d x \right )}}{d^{2}} + \frac {b c^{2} f^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d^{3}} - \frac {b c^{2} f^{2} \operatorname {acoth}{\left (c + d x \right )}}{d^{3}} + \frac {b c e^{2} \operatorname {acoth}{\left (c + d x \right )}}{d} - \frac {2 b c e f \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d^{2}} + \frac {2 b c e f \operatorname {acoth}{\left (c + d x \right )}}{d^{2}} - \frac {2 b c f^{2} x}{3 d^{2}} + \frac {b c f^{2} \operatorname {acoth}{\left (c + d x \right )}}{d^{3}} + b e^{2} x \operatorname {acoth}{\left (c + d x \right )} + b e f x^{2} \operatorname {acoth}{\left (c + d x \right )} + \frac {b f^{2} x^{3} \operatorname {acoth}{\left (c + d x \right )}}{3} + \frac {b e^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d} - \frac {b e^{2} \operatorname {acoth}{\left (c + d x \right )}}{d} + \frac {b e f x}{d} + \frac {b f^{2} x^{2}}{6 d} - \frac {b e f \operatorname {acoth}{\left (c + d x \right )}}{d^{2}} + \frac {b f^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{3 d^{3}} - \frac {b f^{2} \operatorname {acoth}{\left (c + d x \right )}}{3 d^{3}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {acoth}{\left (c \right )}\right ) \left (e^{2} x + e f x^{2} + \frac {f^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((f*x+e)**2*(a+b*acoth(d*x+c)),x)

[Out]

Piecewise((a*e**2*x + a*e*f*x**2 + a*f**2*x**3/3 + b*c**3*f**2*acoth(c + d*x)/(3*d**3) - b*c**2*e*f*acoth(c +
d*x)/d**2 + b*c**2*f**2*log(c/d + x + 1/d)/d**3 - b*c**2*f**2*acoth(c + d*x)/d**3 + b*c*e**2*acoth(c + d*x)/d
- 2*b*c*e*f*log(c/d + x + 1/d)/d**2 + 2*b*c*e*f*acoth(c + d*x)/d**2 - 2*b*c*f**2*x/(3*d**2) + b*c*f**2*acoth(c
 + d*x)/d**3 + b*e**2*x*acoth(c + d*x) + b*e*f*x**2*acoth(c + d*x) + b*f**2*x**3*acoth(c + d*x)/3 + b*e**2*log
(c/d + x + 1/d)/d - b*e**2*acoth(c + d*x)/d + b*e*f*x/d + b*f**2*x**2/(6*d) - b*e*f*acoth(c + d*x)/d**2 + b*f*
*2*log(c/d + x + 1/d)/(3*d**3) - b*f**2*acoth(c + d*x)/(3*d**3), Ne(d, 0)), ((a + b*acoth(c))*(e**2*x + e*f*x*
*2 + f**2*x**3/3), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.72 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\frac {1}{3} \, a f^{2} x^{3} + a e f x^{2} + \frac {1}{2} \, {\left (2 \, x^{2} \operatorname {arcoth}\left (d x + c\right ) + d {\left (\frac {2 \, x}{d^{2}} - \frac {{\left (c^{2} + 2 \, c + 1\right )} \log \left (d x + c + 1\right )}{d^{3}} + \frac {{\left (c^{2} - 2 \, c + 1\right )} \log \left (d x + c - 1\right )}{d^{3}}\right )}\right )} b e f + \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {arcoth}\left (d x + c\right ) + d {\left (\frac {d x^{2} - 4 \, c x}{d^{3}} + \frac {{\left (c^{3} + 3 \, c^{2} + 3 \, c + 1\right )} \log \left (d x + c + 1\right )}{d^{4}} - \frac {{\left (c^{3} - 3 \, c^{2} + 3 \, c - 1\right )} \log \left (d x + c - 1\right )}{d^{4}}\right )}\right )} b f^{2} + a e^{2} x + \frac {{\left (2 \, {\left (d x + c\right )} \operatorname {arcoth}\left (d x + c\right ) + \log \left (-{\left (d x + c\right )}^{2} + 1\right )\right )} b e^{2}}{2 \, d} \]

[In]

integrate((f*x+e)^2*(a+b*arccoth(d*x+c)),x, algorithm="maxima")

[Out]

1/3*a*f^2*x^3 + a*e*f*x^2 + 1/2*(2*x^2*arccoth(d*x + c) + d*(2*x/d^2 - (c^2 + 2*c + 1)*log(d*x + c + 1)/d^3 +
(c^2 - 2*c + 1)*log(d*x + c - 1)/d^3))*b*e*f + 1/6*(2*x^3*arccoth(d*x + c) + d*((d*x^2 - 4*c*x)/d^3 + (c^3 + 3
*c^2 + 3*c + 1)*log(d*x + c + 1)/d^4 - (c^3 - 3*c^2 + 3*c - 1)*log(d*x + c - 1)/d^4))*b*f^2 + a*e^2*x + 1/2*(2
*(d*x + c)*arccoth(d*x + c) + log(-(d*x + c)^2 + 1))*b*e^2/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 973 vs. \(2 (112) = 224\).

Time = 0.30 (sec) , antiderivative size = 973, normalized size of antiderivative = 8.11 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=\text {Too large to display} \]

[In]

integrate((f*x+e)^2*(a+b*arccoth(d*x+c)),x, algorithm="giac")

[Out]

1/6*((c + 1)*d - (c - 1)*d)*((3*(d*x + c + 1)^2*b*d^2*e^2/(d*x + c - 1)^2 - 6*(d*x + c + 1)*b*d^2*e^2/(d*x + c
 - 1) + 3*b*d^2*e^2 - 6*(d*x + c + 1)^2*b*c*d*e*f/(d*x + c - 1)^2 + 12*(d*x + c + 1)*b*c*d*e*f/(d*x + c - 1) -
 6*b*c*d*e*f + 3*(d*x + c + 1)^2*b*c^2*f^2/(d*x + c - 1)^2 - 6*(d*x + c + 1)*b*c^2*f^2/(d*x + c - 1) + 3*b*c^2
*f^2 + 6*(d*x + c + 1)^2*b*d*e*f/(d*x + c - 1)^2 - 6*(d*x + c + 1)*b*d*e*f/(d*x + c - 1) - 6*(d*x + c + 1)^2*b
*c*f^2/(d*x + c - 1)^2 + 6*(d*x + c + 1)*b*c*f^2/(d*x + c - 1) + 3*(d*x + c + 1)^2*b*f^2/(d*x + c - 1)^2 + b*f
^2)*log((d*x + c + 1)/(d*x + c - 1))/((d*x + c + 1)^3*d^4/(d*x + c - 1)^3 - 3*(d*x + c + 1)^2*d^4/(d*x + c - 1
)^2 + 3*(d*x + c + 1)*d^4/(d*x + c - 1) - d^4) + 2*(3*(d*x + c + 1)^2*a*d^2*e^2/(d*x + c - 1)^2 - 6*(d*x + c +
 1)*a*d^2*e^2/(d*x + c - 1) + 3*a*d^2*e^2 - 6*(d*x + c + 1)^2*a*c*d*e*f/(d*x + c - 1)^2 + 12*(d*x + c + 1)*a*c
*d*e*f/(d*x + c - 1) - 6*a*c*d*e*f + 3*(d*x + c + 1)^2*a*c^2*f^2/(d*x + c - 1)^2 - 6*(d*x + c + 1)*a*c^2*f^2/(
d*x + c - 1) + 3*a*c^2*f^2 + 6*(d*x + c + 1)^2*a*d*e*f/(d*x + c - 1)^2 - 6*(d*x + c + 1)*a*d*e*f/(d*x + c - 1)
 + 3*(d*x + c + 1)^2*b*d*e*f/(d*x + c - 1)^2 - 6*(d*x + c + 1)*b*d*e*f/(d*x + c - 1) + 3*b*d*e*f - 6*(d*x + c
+ 1)^2*a*c*f^2/(d*x + c - 1)^2 + 6*(d*x + c + 1)*a*c*f^2/(d*x + c - 1) - 3*(d*x + c + 1)^2*b*c*f^2/(d*x + c -
1)^2 + 6*(d*x + c + 1)*b*c*f^2/(d*x + c - 1) - 3*b*c*f^2 + 3*(d*x + c + 1)^2*a*f^2/(d*x + c - 1)^2 + a*f^2 + (
d*x + c + 1)^2*b*f^2/(d*x + c - 1)^2 - (d*x + c + 1)*b*f^2/(d*x + c - 1))/((d*x + c + 1)^3*d^4/(d*x + c - 1)^3
 - 3*(d*x + c + 1)^2*d^4/(d*x + c - 1)^2 + 3*(d*x + c + 1)*d^4/(d*x + c - 1) - d^4) - (3*b*d^2*e^2 - 6*b*c*d*e
*f + 3*b*c^2*f^2 + b*f^2)*log((d*x + c + 1)/(d*x + c - 1) - 1)/d^4 + (3*b*d^2*e^2 - 6*b*c*d*e*f + 3*b*c^2*f^2
+ b*f^2)*log((d*x + c + 1)/(d*x + c - 1))/d^4)

Mupad [B] (verification not implemented)

Time = 4.69 (sec) , antiderivative size = 386, normalized size of antiderivative = 3.22 \[ \int (e+f x)^2 \left (a+b \coth ^{-1}(c+d x)\right ) \, dx=x^2\,\left (\frac {f\,\left (b\,f+6\,a\,c\,f+6\,a\,d\,e\right )}{6\,d}-\frac {a\,c\,f^2}{d}\right )-\ln \left (1-\frac {1}{c+d\,x}\right )\,\left (\frac {b\,e^2\,x}{2}+\frac {b\,e\,f\,x^2}{2}+\frac {b\,f^2\,x^3}{6}\right )-x\,\left (\frac {2\,c\,\left (\frac {f\,\left (b\,f+6\,a\,c\,f+6\,a\,d\,e\right )}{3\,d}-\frac {2\,a\,c\,f^2}{d}\right )}{d}-\frac {3\,a\,c^2\,f^2+12\,a\,c\,d\,e\,f+3\,a\,d^2\,e^2+3\,b\,d\,e\,f-3\,a\,f^2}{3\,d^2}+\frac {a\,f^2\,\left (3\,c^2-3\right )}{3\,d^2}\right )+\ln \left (\frac {1}{c+d\,x}+1\right )\,\left (\frac {b\,e^2\,x}{2}+\frac {b\,e\,f\,x^2}{2}+\frac {b\,f^2\,x^3}{6}\right )+\frac {a\,f^2\,x^3}{3}+\frac {\ln \left (c+d\,x-1\right )\,\left (\frac {b\,f^2}{6}+d\,\left (\frac {b\,e\,f\,c^2}{2}-b\,e\,f\,c+\frac {b\,e\,f}{2}\right )+d^2\,\left (\frac {b\,e^2}{2}-\frac {b\,c\,e^2}{2}\right )+\frac {b\,c^2\,f^2}{2}-\frac {b\,c^3\,f^2}{6}-\frac {b\,c\,f^2}{2}\right )}{d^3}+\frac {\ln \left (c+d\,x+1\right )\,\left (\frac {b\,f^2}{6}-d\,\left (\frac {b\,e\,f\,c^2}{2}+b\,e\,f\,c+\frac {b\,e\,f}{2}\right )+d^2\,\left (\frac {b\,e^2}{2}+\frac {b\,c\,e^2}{2}\right )+\frac {b\,c^2\,f^2}{2}+\frac {b\,c^3\,f^2}{6}+\frac {b\,c\,f^2}{2}\right )}{d^3} \]

[In]

int((e + f*x)^2*(a + b*acoth(c + d*x)),x)

[Out]

x^2*((f*(b*f + 6*a*c*f + 6*a*d*e))/(6*d) - (a*c*f^2)/d) - log(1 - 1/(c + d*x))*((b*f^2*x^3)/6 + (b*e^2*x)/2 +
(b*e*f*x^2)/2) - x*((2*c*((f*(b*f + 6*a*c*f + 6*a*d*e))/(3*d) - (2*a*c*f^2)/d))/d - (3*a*c^2*f^2 - 3*a*f^2 + 3
*a*d^2*e^2 + 3*b*d*e*f + 12*a*c*d*e*f)/(3*d^2) + (a*f^2*(3*c^2 - 3))/(3*d^2)) + log(1/(c + d*x) + 1)*((b*f^2*x
^3)/6 + (b*e^2*x)/2 + (b*e*f*x^2)/2) + (a*f^2*x^3)/3 + (log(c + d*x - 1)*((b*f^2)/6 + d*((b*e*f)/2 + (b*c^2*e*
f)/2 - b*c*e*f) + d^2*((b*e^2)/2 - (b*c*e^2)/2) + (b*c^2*f^2)/2 - (b*c^3*f^2)/6 - (b*c*f^2)/2))/d^3 + (log(c +
 d*x + 1)*((b*f^2)/6 - d*((b*e*f)/2 + (b*c^2*e*f)/2 + b*c*e*f) + d^2*((b*e^2)/2 + (b*c*e^2)/2) + (b*c^2*f^2)/2
 + (b*c^3*f^2)/6 + (b*c*f^2)/2))/d^3