Optimal. Leaf size=154 \[ \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 \cot ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e-c f) \left (d^2 e^2-2 c d e f-\left (3-c^2\right ) f^2\right ) \text {ArcTan}(c+d x)}{3 d^3 f}+\frac {b \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right ) \log \left (1+(c+d x)^2\right )}{6 d^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 154, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5156, 4973,
716, 649, 209, 266} \begin {gather*} \frac {(e+f x)^3 \left (a+b \cot ^{-1}(c+d x)\right )}{3 f}+\frac {b \text {ArcTan}(c+d x) (d e-c f) \left (-\left (3-c^2\right ) f^2-2 c d e f+d^2 e^2\right )}{3 d^3 f}+\frac {b \left (-\left (1-3 c^2\right ) f^2-6 c d e f+3 d^2 e^2\right ) \log \left ((c+d x)^2+1\right )}{6 d^3}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {b f x (d e-c f)}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 716
Rule 4973
Rule 5156
Rubi steps
\begin {align*} \int (e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^2 \left (a+b \cot ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}\\ &=\frac {(e+f x)^3 \left (a+b \cot ^{-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 \cot ^{-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 \cot ^{-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 \cot ^{-1}(c+d x)\right )}{3 f}+\frac {\left (b \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right )\right ) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{3 d^3}+\frac {\left (b (d e-c f) \left (d^2 e^2-2 c d e f-\left (3-c^2\right ) f^2\right )\right ) \text {Subst}\left (\int \frac {1}{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 \cot ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e-c f) \left (d^2 e^2-2 c d e f-\left (3-c^2\right ) f^2\right ) \tan ^{-1}(c+d x)}{3 d^3 f}+\frac {b \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right ) \log \left (1+(c+d x)^2\right )}{6 d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.11, size = 118, normalized size = 0.77 \begin {gather*} \frac {(e+f x)^3 \left (a+b \cot ^{-1}(c+d x)\right )+\frac {b \left (6 d f^2 (d e-c f) x+f^3 (c+d x)^2-i (d e-(-i+c) f)^3 \log (i-c-d x)+i (d e-(i+c) f)^3 \log (i+c+d x)\right )}{2 d^3}}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(429\) vs.
\(2(146)=292\).
time = 0.28, size = 430, normalized size = 2.79
method | result | size |
risch | \(-\frac {i f b e \,x^{2} \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {x^{3} f^{2} a}{3}+\frac {f^{2} b \,x^{2}}{6 d}-\frac {i b \,e^{3} \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{12 f}+\frac {i \left (f x +e \right )^{3} b \ln \left (1+i \left (d x +c \right )\right )}{6 f}-\frac {f^{2} b \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{6 d^{3}}+x^{2} f e a +x a \,e^{2}-\frac {2 f^{2} b c x}{3 d^{2}}+\frac {f b e x}{d}-\frac {f b e \arctan \left (d x +c \right )}{d^{2}}+\frac {x \,e^{2} b \pi }{2}+\frac {x^{2} f e b \pi }{2}+\frac {f b \,c^{2} e \arctan \left (d x +c \right )}{d^{2}}-\frac {b c \,e^{2} \arctan \left (d x +c \right )}{d}-\frac {i b \,e^{2} x \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {e^{2} b \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d}-\frac {f b c e \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{d^{2}}-\frac {f^{2} b \,c^{3} \arctan \left (d x +c \right )}{3 d^{3}}+\frac {b \,e^{3} \arctan \left (d x +c \right )}{6 f}+\frac {f^{2} b c \arctan \left (d x +c \right )}{d^{3}}+\frac {f^{2} b \,c^{2} \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d^{3}}-\frac {i f^{2} b \,x^{3} \ln \left (1-i \left (d x +c \right )\right )}{6}+\frac {x^{3} f^{2} b \pi }{6}\) | \(400\) |
derivativedivides | \(\frac {-\frac {\left (c f -d e -f \left (d x +c \right )\right )^{3} a}{3 d^{2} f}-\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c^{3}}{3 d^{2}}+\frac {b f \,\mathrm {arccot}\left (d x +c \right ) c^{2} e}{d}+\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c^{2} \left (d x +c \right )}{d^{2}}-b \,\mathrm {arccot}\left (d x +c \right ) c \,e^{2}-\frac {2 b f \,\mathrm {arccot}\left (d x +c \right ) c e \left (d x +c \right )}{d}-\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c \left (d x +c \right )^{2}}{d^{2}}+\frac {b d \,\mathrm {arccot}\left (d x +c \right ) e^{3}}{3 f}+b \,\mathrm {arccot}\left (d x +c \right ) e^{2} \left (d x +c \right )+\frac {b f \,\mathrm {arccot}\left (d x +c \right ) e \left (d x +c \right )^{2}}{d}+\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) \left (d x +c \right )^{3}}{3 d^{2}}-\frac {b \,f^{2} c \left (d x +c \right )}{d^{2}}+\frac {b f e \left (d x +c \right )}{d}+\frac {b \,f^{2} \left (d x +c \right )^{2}}{6 d^{2}}+\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right ) c^{2}}{2 d^{2}}-\frac {b f \ln \left (1+\left (d x +c \right )^{2}\right ) c e}{d}+\frac {e^{2} b \ln \left (1+\left (d x +c \right )^{2}\right )}{2}-\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{6 d^{2}}-\frac {b \,f^{2} \arctan \left (d x +c \right ) c^{3}}{3 d^{2}}+\frac {b f \arctan \left (d x +c \right ) c^{2} e}{d}-b \arctan \left (d x +c \right ) c \,e^{2}+\frac {b d \arctan \left (d x +c \right ) e^{3}}{3 f}+\frac {b \,f^{2} \arctan \left (d x +c \right ) c}{d^{2}}-\frac {b f \arctan \left (d x +c \right ) e}{d}}{d}\) | \(430\) |
default | \(\frac {-\frac {\left (c f -d e -f \left (d x +c \right )\right )^{3} a}{3 d^{2} f}-\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c^{3}}{3 d^{2}}+\frac {b f \,\mathrm {arccot}\left (d x +c \right ) c^{2} e}{d}+\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c^{2} \left (d x +c \right )}{d^{2}}-b \,\mathrm {arccot}\left (d x +c \right ) c \,e^{2}-\frac {2 b f \,\mathrm {arccot}\left (d x +c \right ) c e \left (d x +c \right )}{d}-\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) c \left (d x +c \right )^{2}}{d^{2}}+\frac {b d \,\mathrm {arccot}\left (d x +c \right ) e^{3}}{3 f}+b \,\mathrm {arccot}\left (d x +c \right ) e^{2} \left (d x +c \right )+\frac {b f \,\mathrm {arccot}\left (d x +c \right ) e \left (d x +c \right )^{2}}{d}+\frac {b \,f^{2} \mathrm {arccot}\left (d x +c \right ) \left (d x +c \right )^{3}}{3 d^{2}}-\frac {b \,f^{2} c \left (d x +c \right )}{d^{2}}+\frac {b f e \left (d x +c \right )}{d}+\frac {b \,f^{2} \left (d x +c \right )^{2}}{6 d^{2}}+\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right ) c^{2}}{2 d^{2}}-\frac {b f \ln \left (1+\left (d x +c \right )^{2}\right ) c e}{d}+\frac {e^{2} b \ln \left (1+\left (d x +c \right )^{2}\right )}{2}-\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{6 d^{2}}-\frac {b \,f^{2} \arctan \left (d x +c \right ) c^{3}}{3 d^{2}}+\frac {b f \arctan \left (d x +c \right ) c^{2} e}{d}-b \arctan \left (d x +c \right ) c \,e^{2}+\frac {b d \arctan \left (d x +c \right ) e^{3}}{3 f}+\frac {b \,f^{2} \arctan \left (d x +c \right ) c}{d^{2}}-\frac {b f \arctan \left (d x +c \right ) e}{d}}{d}\) | \(430\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 216, normalized size = 1.40 \begin {gather*} \frac {1}{3} \, a f^{2} x^{3} + a f x^{2} e + \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {arccot}\left (d x + c\right ) + d {\left (\frac {d x^{2} - 4 \, c x}{d^{3}} - \frac {2 \, {\left (c^{3} - 3 \, c\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{4}} + \frac {{\left (3 \, c^{2} - 1\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{4}}\right )}\right )} b f^{2} + {\left (x^{2} \operatorname {arccot}\left (d x + c\right ) + d {\left (\frac {x}{d^{2}} + \frac {{\left (c^{2} - 1\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{3}} - \frac {c \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{3}}\right )}\right )} b f e + a x e^{2} + \frac {{\left (2 \, {\left (d x + c\right )} \operatorname {arccot}\left (d x + c\right ) + \log \left ({\left (d x + c\right )}^{2} + 1\right )\right )} b e^{2}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.45, size = 208, normalized size = 1.35 \begin {gather*} \frac {2 \, a d^{3} f^{2} x^{3} + b d^{2} f^{2} x^{2} - 4 \, b c d f^{2} x + 6 \, a d^{3} x e^{2} + 2 \, {\left (b d^{3} f^{2} x^{3} + 3 \, b d^{3} f x^{2} e + 3 \, b d^{3} x e^{2}\right )} \operatorname {arccot}\left (d x + c\right ) - 2 \, {\left (3 \, b c d^{2} e^{2} - 3 \, {\left (b c^{2} - b\right )} d f e + {\left (b c^{3} - 3 \, b c\right )} f^{2}\right )} \arctan \left (d x + c\right ) + 6 \, {\left (a d^{3} f x^{2} + b d^{2} f x\right )} e - {\left (6 \, b c d f e - 3 \, b d^{2} e^{2} - {\left (3 \, b c^{2} - b\right )} f^{2}\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{6 \, d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 4.58, size = 376, normalized size = 2.44 \begin {gather*} \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 {acot}{\left (c + d x \right )}}{3 d^{3}} - \frac {b c^{2} e f \operatorname {acot}{\left (c + d x \right )}}{d^{2}} + \frac {b c^{2} f^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{3}} + \frac {i b c^{2} f^{2} \operatorname {acot}{\left (c + d x \right )}}{d^{3}} + \frac {b c e^{2} \operatorname {acot}{\left (c + d x \right )}}{d} - \frac {2 b c e f \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{2}} - \frac {2 i b c e f \operatorname {acot}{\left (c + d x \right )}}{d^{2}} - \frac {2 b c f^{2} x}{3 d^{2}} - \frac {b c f^{2} \operatorname {acot}{\left (c + d x \right )}}{d^{3}} + b e^{2} x \operatorname {acot}{\left (c + d x \right )} + b e f x^{2} \operatorname {acot}{\left (c + d x \right )} + \frac {b f^{2} x^{3} \operatorname {acot}{\left (c + d x \right )}}{3} + \frac {b e^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {i b e^{2} \operatorname {acot}{\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 {acot}{\left (c + d x \right )}}{d^{2}} - \frac {b f^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{3 d^{3}} - \frac {i b f^{2} \operatorname {acot}{\left (c + d x \right )}}{3 d^{3}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {acot}{\left (c \right )}\right ) \left (e^{2} x + e f x^{2} + \frac {f^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1161 vs.
\(2 (142) = 284\).
time = 1.15, size = 1161, normalized size = 7.54 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.96, size = 409, normalized size = 2.66 \begin {gather*} 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 )-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 )+\mathrm {acot}\left (c+d\,x\right )\,\left (b\,e^2\,x+b\,e\,f\,x^2+\frac {b\,f^2\,x^3}{3}\right )+\frac {a\,f^2\,x^3}{3}+\frac {\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )\,\left (36\,b\,c^2\,d^3\,f^2-72\,b\,c\,d^4\,e\,f+36\,b\,d^5\,e^2-12\,b\,d^3\,f^2\right )}{72\,d^6}-\frac {b\,\mathrm {atan}\left (\frac {3\,d^2\,\left (\frac {c\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d^2}+\frac {x\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d}\right )}{c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f}\right )\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________