Optimal. Leaf size=97 \[ \frac {b f x}{2 d}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b (d e+f-c f) (d e-(1+c) f) \text {ArcTan}(c+d x)}{2 d^2 f}+\frac {b (d e-c f) \log \left (1+(c+d x)^2\right )}{2 d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {5156, 4973,
716, 649, 209, 266} \begin {gather*} \frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b \text {ArcTan}(c+d x) (-c f+d e+f) (d e-(c+1) f)}{2 d^2 f}+\frac {b (d e-c f) \log \left ((c+d x)^2+1\right )}{2 d^2}+\frac {b f x}{2 d} \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) \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 ) \left (a+b \cot ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}\\ &=\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b \text {Subst}\left (\int \frac {\left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^2}{1+x^2} \, dx,x,c+d x\right )}{2 f}\\ &=\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b \text {Subst}\left (\int \left (\frac {f^2}{d^2}+\frac {(d e-f-c f) (d e+f-c f)+2 f (d e-c f) x}{d^2 \left (1+x^2\right )}\right ) \, dx,x,c+d x\right )}{2 f}\\ &=\frac {b f x}{2 d}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b \text {Subst}\left (\int \frac {(d e-f-c f) (d e+f-c f)+2 f (d e-c f) x}{1+x^2} \, dx,x,c+d x\right )}{2 d^2 f}\\ &=\frac {b f x}{2 d}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {(b (d e-c f)) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{d^2}+\frac {(b (d e+f-c f) (d e-(1+c) f)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,c+d x\right )}{2 d^2 f}\\ &=\frac {b f x}{2 d}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b (d e+f-c f) (d e-(1+c) f) \tan ^{-1}(c+d x)}{2 d^2 f}+\frac {b (d e-c f) \log \left (1+(c+d x)^2\right )}{2 d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.07, size = 163, normalized size = 1.68 \begin {gather*} a e x+\frac {1}{2} a f x^2+b e x \cot ^{-1}(c+d x)+\frac {b f \left (\frac {1}{2} d \left (-\frac {c}{d}+\frac {c+d x}{d}\right )^2 \cot ^{-1}(c+d x)+\frac {1}{2} d \left (\frac {x}{d}-\frac {i (i-c)^2 \log (i-c-d x)}{2 d^2}+\frac {i (i+c)^2 \log (i+c+d x)}{2 d^2}\right )\right )}{d}+\frac {b e \left (-2 c \text {ArcTan}(c+d x)+\log \left (1+c^2+2 c d x+d^2 x^2\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 150, normalized size = 1.55
method | result | size |
derivativedivides | \(\frac {-\frac {a \left (f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}\right )}{d}-\frac {b \,\mathrm {arccot}\left (d x +c \right ) f c \left (d x +c \right )}{d}+b \,\mathrm {arccot}\left (d x +c \right ) e \left (d x +c \right )+\frac {b \,\mathrm {arccot}\left (d x +c \right ) f \left (d x +c \right )^{2}}{2 d}+\frac {b f \left (d x +c \right )}{2 d}-\frac {b \ln \left (1+\left (d x +c \right )^{2}\right ) f c}{2 d}+\frac {b \ln \left (1+\left (d x +c \right )^{2}\right ) e}{2}-\frac {b f \arctan \left (d x +c \right )}{2 d}}{d}\) | \(150\) |
default | \(\frac {-\frac {a \left (f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}\right )}{d}-\frac {b \,\mathrm {arccot}\left (d x +c \right ) f c \left (d x +c \right )}{d}+b \,\mathrm {arccot}\left (d x +c \right ) e \left (d x +c \right )+\frac {b \,\mathrm {arccot}\left (d x +c \right ) f \left (d x +c \right )^{2}}{2 d}+\frac {b f \left (d x +c \right )}{2 d}-\frac {b \ln \left (1+\left (d x +c \right )^{2}\right ) f c}{2 d}+\frac {b \ln \left (1+\left (d x +c \right )^{2}\right ) e}{2}-\frac {b f \arctan \left (d x +c \right )}{2 d}}{d}\) | \(150\) |
risch | \(\frac {i b \left (f \,x^{2}+2 e x \right ) \ln \left (1+i \left (d x +c \right )\right )}{4}-\frac {i b f \,x^{2} \ln \left (1-i \left (d x +c \right )\right )}{4}+\frac {\pi b f \,x^{2}}{4}-\frac {i b e x \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {\pi b e x}{2}+\frac {a f \,x^{2}}{2}+\frac {b \,c^{2} f \arctan \left (d x +c \right )}{2 d^{2}}-\frac {b c e \arctan \left (d x +c \right )}{d}+a e x -\frac {b c f \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d^{2}}+\frac {b e \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d}+\frac {b f x}{2 d}-\frac {b f \arctan \left (d x +c \right )}{2 d^{2}}\) | \(190\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 115, normalized size = 1.19 \begin {gather*} \frac {1}{2} \, a f x^{2} + \frac {1}{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 + a x e + \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 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 7.95, size = 114, normalized size = 1.18 \begin {gather*} \frac {a d^{2} f x^{2} + 2 \, a d^{2} x e + b d f x + {\left (b d^{2} f x^{2} + 2 \, b d^{2} x e\right )} \operatorname {arccot}\left (d x + c\right ) - {\left (2 \, b c d e - {\left (b c^{2} - b\right )} f\right )} \arctan \left (d x + c\right ) - {\left (b c f - b d e\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{2 \, d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.78, size = 177, normalized size = 1.82 \begin {gather*} \begin {cases} a e x + \frac {a f x^{2}}{2} - \frac {b c^{2} f \operatorname {acot}{\left (c + d x \right )}}{2 d^{2}} + \frac {b c e \operatorname {acot}{\left (c + d x \right )}}{d} - \frac {b c f \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{2}} - \frac {i b c f \operatorname {acot}{\left (c + d x \right )}}{d^{2}} + b e x \operatorname {acot}{\left (c + d x \right )} + \frac {b f x^{2} \operatorname {acot}{\left (c + d x \right )}}{2} + \frac {b e \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {i b e \operatorname {acot}{\left (c + d x \right )}}{d} + \frac {b f x}{2 d} + \frac {b f \operatorname {acot}{\left (c + d x \right )}}{2 d^{2}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {acot}{\left (c \right )}\right ) \left (e x + \frac {f x^{2}}{2}\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. 451 vs.
\(2 (89) = 178\).
time = 0.52, size = 451, normalized size = 4.65 \begin {gather*} -\frac {4 \, b d e \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, b c f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - b f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 4 \, b d e \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}}{\tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} - 4 \, b c f \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}}{\tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 4 \, a d e \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, a c f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - a f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} - 4 \, b d e \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) + 4 \, b c f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - 2 \, b f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 2 \, b f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, a d e \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) + 4 \, a c f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - 2 \, a f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} - b f \arctan \left (\frac {1}{d x + c}\right ) - 2 \, b f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - a f}{8 \, d^{2} \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.45, size = 136, normalized size = 1.40 \begin {gather*} a\,e\,x+\frac {a\,f\,x^2}{2}+\frac {b\,e\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d}+\frac {b\,f\,\mathrm {acot}\left (c+d\,x\right )}{2\,d^2}+\frac {b\,f\,x^2\,\mathrm {acot}\left (c+d\,x\right )}{2}+\frac {b\,f\,x}{2\,d}+b\,e\,x\,\mathrm {acot}\left (c+d\,x\right )-\frac {b\,c^2\,f\,\mathrm {acot}\left (c+d\,x\right )}{2\,d^2}-\frac {b\,c\,f\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d^2}+\frac {b\,c\,e\,\mathrm {acot}\left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________