Optimal. Leaf size=21 \[ \frac {(2+x) \left (-x+\frac {\log (4+x)}{x}\right )^2}{x^4} \]
________________________________________________________________________________________
Rubi [B] time = 1.31, antiderivative size = 81, normalized size of antiderivative = 3.86, number of steps used = 75, number of rules used = 22, integrand size = 74, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.297, Rules used = {1593, 6742, 1620, 2418, 2395, 44, 36, 29, 31, 2392, 2391, 2390, 2301, 2416, 2398, 2411, 2347, 2344, 2316, 2315, 2314, 2319} \begin {gather*} \frac {2 \log ^2(x+4)}{x^6}+\frac {\log ^2(x+4)}{x^5}-\frac {4 \log (x+4)}{x^4}-\frac {2 \log (x+4)}{x^3}+\frac {2}{x^2}+\frac {1}{x}-\frac {(x+4) \log (x+4)}{1024 x}+\frac {\log (x+4)}{256 x}+\frac {\log (x+4)}{1024} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 44
Rule 1593
Rule 1620
Rule 2301
Rule 2314
Rule 2315
Rule 2316
Rule 2319
Rule 2344
Rule 2347
Rule 2390
Rule 2391
Rule 2392
Rule 2395
Rule 2398
Rule 2411
Rule 2416
Rule 2418
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-4 x^3-18 x^4-8 x^5-x^6+\left (4 x+66 x^2+40 x^3+6 x^4\right ) \log (4+x)+\left (-48-32 x-5 x^2\right ) \log ^2(4+x)}{x^7 (4+x)} \, dx\\ &=\int \left (\frac {-4-18 x-8 x^2-x^3}{x^4 (4+x)}+\frac {2 \left (2+33 x+20 x^2+3 x^3\right ) \log (4+x)}{x^6 (4+x)}-\frac {(12+5 x) \log ^2(4+x)}{x^7}\right ) \, dx\\ &=2 \int \frac {\left (2+33 x+20 x^2+3 x^3\right ) \log (4+x)}{x^6 (4+x)} \, dx+\int \frac {-4-18 x-8 x^2-x^3}{x^4 (4+x)} \, dx-\int \frac {(12+5 x) \log ^2(4+x)}{x^7} \, dx\\ &=2 \int \left (\frac {\log (4+x)}{2 x^6}+\frac {65 \log (4+x)}{8 x^5}+\frac {95 \log (4+x)}{32 x^4}+\frac {\log (4+x)}{128 x^3}-\frac {\log (4+x)}{512 x^2}+\frac {\log (4+x)}{2048 x}-\frac {\log (4+x)}{2048 (4+x)}\right ) \, dx+\int \left (-\frac {1}{x^4}-\frac {17}{4 x^3}-\frac {15}{16 x^2}-\frac {1}{64 x}+\frac {1}{64 (4+x)}\right ) \, dx-\int \left (\frac {12 \log ^2(4+x)}{x^7}+\frac {5 \log ^2(4+x)}{x^6}\right ) \, dx\\ &=\frac {1}{3 x^3}+\frac {17}{8 x^2}+\frac {15}{16 x}-\frac {\log (x)}{64}+\frac {1}{64} \log (4+x)+\frac {\int \frac {\log (4+x)}{x} \, dx}{1024}-\frac {\int \frac {\log (4+x)}{4+x} \, dx}{1024}-\frac {1}{256} \int \frac {\log (4+x)}{x^2} \, dx+\frac {1}{64} \int \frac {\log (4+x)}{x^3} \, dx-5 \int \frac {\log ^2(4+x)}{x^6} \, dx+\frac {95}{16} \int \frac {\log (4+x)}{x^4} \, dx-12 \int \frac {\log ^2(4+x)}{x^7} \, dx+\frac {65}{4} \int \frac {\log (4+x)}{x^5} \, dx+\int \frac {\log (4+x)}{x^6} \, dx\\ &=\frac {1}{3 x^3}+\frac {17}{8 x^2}+\frac {15}{16 x}-\frac {\log (x)}{64}+\frac {\log (4) \log (x)}{1024}+\frac {1}{64} \log (4+x)-\frac {\log (4+x)}{5 x^5}-\frac {65 \log (4+x)}{16 x^4}-\frac {95 \log (4+x)}{48 x^3}-\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}+\frac {\int \frac {\log \left (1+\frac {x}{4}\right )}{x} \, dx}{1024}-\frac {\operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,4+x\right )}{1024}-\frac {1}{256} \int \frac {1}{x (4+x)} \, dx+\frac {1}{128} \int \frac {1}{x^2 (4+x)} \, dx+\frac {1}{5} \int \frac {1}{x^5 (4+x)} \, dx+\frac {95}{48} \int \frac {1}{x^3 (4+x)} \, dx-2 \int \frac {\log (4+x)}{x^5 (4+x)} \, dx-4 \int \frac {\log (4+x)}{x^6 (4+x)} \, dx+\frac {65}{16} \int \frac {1}{x^4 (4+x)} \, dx\\ &=\frac {1}{3 x^3}+\frac {17}{8 x^2}+\frac {15}{16 x}-\frac {\log (x)}{64}+\frac {\log (4) \log (x)}{1024}+\frac {1}{64} \log (4+x)-\frac {\log (4+x)}{5 x^5}-\frac {65 \log (4+x)}{16 x^4}-\frac {95 \log (4+x)}{48 x^3}-\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}-\frac {\int \frac {1}{x} \, dx}{1024}+\frac {\int \frac {1}{4+x} \, dx}{1024}+\frac {1}{128} \int \left (\frac {1}{4 x^2}-\frac {1}{16 x}+\frac {1}{16 (4+x)}\right ) \, dx+\frac {1}{5} \int \left (\frac {1}{4 x^5}-\frac {1}{16 x^4}+\frac {1}{64 x^3}-\frac {1}{256 x^2}+\frac {1}{1024 x}-\frac {1}{1024 (4+x)}\right ) \, dx+\frac {95}{48} \int \left (\frac {1}{4 x^3}-\frac {1}{16 x^2}+\frac {1}{64 x}-\frac {1}{64 (4+x)}\right ) \, dx-2 \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^5 x} \, dx,x,4+x\right )-4 \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^6 x} \, dx,x,4+x\right )+\frac {65}{16} \int \left (\frac {1}{4 x^4}-\frac {1}{16 x^3}+\frac {1}{64 x^2}-\frac {1}{256 x}+\frac {1}{256 (4+x)}\right ) \, dx\\ &=-\frac {1}{80 x^4}-\frac {1}{960 x^3}+\frac {15383}{7680 x^2}+\frac {15307}{15360 x}-\frac {113 \log (x)}{61440}+\frac {\log (4) \log (x)}{1024}+\frac {113 \log (4+x)}{61440}-\frac {\log (4+x)}{5 x^5}-\frac {65 \log (4+x)}{16 x^4}-\frac {95 \log (4+x)}{48 x^3}-\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}-\frac {1}{2} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^5} \, dx,x,4+x\right )+\frac {1}{2} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^4 x} \, dx,x,4+x\right )-\operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^6} \, dx,x,4+x\right )+\operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^5 x} \, dx,x,4+x\right )\\ &=-\frac {1}{80 x^4}-\frac {1}{960 x^3}+\frac {15383}{7680 x^2}+\frac {15307}{15360 x}-\frac {113 \log (x)}{61440}+\frac {\log (4) \log (x)}{1024}+\frac {113 \log (4+x)}{61440}-\frac {63 \log (4+x)}{16 x^4}-\frac {95 \log (4+x)}{48 x^3}-\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}-\frac {1}{8} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^4 x} \, dx,x,4+x\right )+\frac {1}{8} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^4} \, dx,x,4+x\right )-\frac {1}{8} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^3 x} \, dx,x,4+x\right )-\frac {1}{5} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^5 x} \, dx,x,4+x\right )+\frac {1}{4} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^5} \, dx,x,4+x\right )-\frac {1}{4} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^4 x} \, dx,x,4+x\right )\\ &=-\frac {1}{80 x^4}-\frac {1}{960 x^3}+\frac {15383}{7680 x^2}+\frac {15307}{15360 x}-\frac {113 \log (x)}{61440}+\frac {\log (4) \log (x)}{1024}+\frac {113 \log (4+x)}{61440}-\frac {4 \log (4+x)}{x^4}-\frac {97 \log (4+x)}{48 x^3}-\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}-\frac {1}{32} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^3} \, dx,x,4+x\right )+\frac {1}{32} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^2 x} \, dx,x,4+x\right )+\frac {1}{24} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^3 x} \, dx,x,4+x\right )+\frac {1}{16} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^4 x} \, dx,x,4+x\right )-\frac {1}{16} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^4} \, dx,x,4+x\right )+\frac {1}{16} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^3 x} \, dx,x,4+x\right )-\frac {1}{8} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^4}-\frac {1}{16 (-4+x)^3}+\frac {1}{64 (-4+x)^2}-\frac {1}{256 (-4+x)}+\frac {1}{256 x}\right ) \, dx,x,4+x\right )-\frac {1}{5} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^5}-\frac {1}{16 (-4+x)^4}+\frac {1}{64 (-4+x)^3}-\frac {1}{256 (-4+x)^2}+\frac {1}{1024 (-4+x)}-\frac {1}{1024 x}\right ) \, dx,x,4+x\right )\\ &=\frac {1}{192 x^3}+\frac {3073}{1536 x^2}+\frac {3065}{3072 x}-\frac {19 \log (x)}{12288}+\frac {\log (4) \log (x)}{1024}+\frac {19 \log (4+x)}{12288}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {\log (4+x)}{128 x^2}+\frac {\log (4+x)}{256 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}+\frac {1}{128} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^2} \, dx,x,4+x\right )-\frac {1}{128} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x) x} \, dx,x,4+x\right )-\frac {1}{64} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^2 x} \, dx,x,4+x\right )+\frac {1}{64} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^3} \, dx,x,4+x\right )-\frac {1}{64} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^2 x} \, dx,x,4+x\right )-\frac {1}{48} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^3 x} \, dx,x,4+x\right )+\frac {1}{24} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^3}-\frac {1}{16 (-4+x)^2}+\frac {1}{64 (-4+x)}-\frac {1}{64 x}\right ) \, dx,x,4+x\right )+\frac {1}{16} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^4}-\frac {1}{16 (-4+x)^3}+\frac {1}{64 (-4+x)^2}-\frac {1}{256 (-4+x)}+\frac {1}{256 x}\right ) \, dx,x,4+x\right )\\ &=\frac {767}{384 x^2}+\frac {1535}{1536 x}-\frac {7 \log (x)}{6144}+\frac {\log (4) \log (x)}{1024}+\frac {7 \log (4+x)}{6144}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {\log (4+x)}{256 x}-\frac {(4+x) \log (4+x)}{512 x}-\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}+\frac {1}{512} \operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,4+x\right )-\frac {1}{512} \operatorname {Subst}\left (\int \frac {\log (x)}{-4+x} \, dx,x,4+x\right )+\frac {1}{512} \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,4+x\right )-\frac {1}{256} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x)^2} \, dx,x,4+x\right )+\frac {1}{256} \operatorname {Subst}\left (\int \frac {\log (x)}{(-4+x) x} \, dx,x,4+x\right )+\frac {1}{128} \operatorname {Subst}\left (\int \frac {1}{(-4+x)^2 x} \, dx,x,4+x\right )-\frac {1}{64} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^2}-\frac {1}{16 (-4+x)}+\frac {1}{16 x}\right ) \, dx,x,4+x\right )-\frac {1}{48} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^3}-\frac {1}{16 (-4+x)^2}+\frac {1}{64 (-4+x)}-\frac {1}{64 x}\right ) \, dx,x,4+x\right )\\ &=\frac {2}{x^2}+\frac {513}{512 x}+\frac {3 \log (x)}{2048}-\frac {\log (4) \log (x)}{1024}+\frac {\log (4+x)}{2048}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {\log (4+x)}{256 x}-\frac {(4+x) \log (4+x)}{1024 x}+\frac {\log ^2(4+x)}{2048}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}-\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}-\frac {\operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,4+x\right )}{1024}+\frac {\operatorname {Subst}\left (\int \frac {\log (x)}{-4+x} \, dx,x,4+x\right )}{1024}-\frac {\operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,4+x\right )}{1024}-\frac {1}{512} \operatorname {Subst}\left (\int \frac {\log \left (\frac {x}{4}\right )}{-4+x} \, dx,x,4+x\right )+\frac {1}{128} \operatorname {Subst}\left (\int \left (\frac {1}{4 (-4+x)^2}-\frac {1}{16 (-4+x)}+\frac {1}{16 x}\right ) \, dx,x,4+x\right )\\ &=\frac {2}{x^2}+\frac {1}{x}+\frac {\log (4+x)}{1024}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {\log (4+x)}{256 x}-\frac {(4+x) \log (4+x)}{1024 x}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}+\frac {\text {Li}_2\left (-\frac {x}{4}\right )}{1024}+\frac {\operatorname {Subst}\left (\int \frac {\log \left (\frac {x}{4}\right )}{-4+x} \, dx,x,4+x\right )}{1024}\\ &=\frac {2}{x^2}+\frac {1}{x}+\frac {\log (4+x)}{1024}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {\log (4+x)}{256 x}-\frac {(4+x) \log (4+x)}{1024 x}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [B] time = 0.29, size = 48, normalized size = 2.29 \begin {gather*} \frac {2}{x^2}+\frac {1}{x}-\frac {4 \log (4+x)}{x^4}-\frac {2 \log (4+x)}{x^3}+\frac {2 \log ^2(4+x)}{x^6}+\frac {\log ^2(4+x)}{x^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 38, normalized size = 1.81 \begin {gather*} \frac {x^{5} + 2 \, x^{4} + {\left (x + 2\right )} \log \left (x + 4\right )^{2} - 2 \, {\left (x^{3} + 2 \, x^{2}\right )} \log \left (x + 4\right )}{x^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 33, normalized size = 1.57 \begin {gather*} \frac {x + 2}{x^{2}} - \frac {2 \, {\left (x + 2\right )} \log \left (x + 4\right )}{x^{4}} + \frac {{\left (x + 2\right )} \log \left (x + 4\right )^{2}}{x^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.22, size = 34, normalized size = 1.62
method | result | size |
risch | \(\frac {\left (2+x \right ) \ln \left (4+x \right )^{2}}{x^{6}}-\frac {2 \left (2+x \right ) \ln \left (4+x \right )}{x^{4}}+\frac {2+x}{x^{2}}\) | \(34\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.42, size = 87, normalized size = 4.14 \begin {gather*} -\frac {9 \, {\left (x - 2\right )}}{8 \, x^{2}} + \frac {2}{x} + \frac {3 \, x^{2} - 6 \, x + 16}{48 \, x^{3}} + \frac {12 \, x^{5} - 24 \, x^{4} - 64 \, x^{3} + 192 \, {\left (x + 2\right )} \log \left (x + 4\right )^{2} - 3 \, {\left (x^{6} + 128 \, x^{3} + 256 \, x^{2}\right )} \log \left (x + 4\right )}{192 \, x^{6}} + \frac {1}{64} \, \log \left (x + 4\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.28, size = 47, normalized size = 2.24 \begin {gather*} \frac {x^5+2\,x^4-2\,x^3\,\ln \left (x+4\right )-4\,x^2\,\ln \left (x+4\right )+x\,{\ln \left (x+4\right )}^2+2\,{\ln \left (x+4\right )}^2}{x^6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.21, size = 36, normalized size = 1.71 \begin {gather*} - \frac {- x - 2}{x^{2}} + \frac {\left (- 2 x - 4\right ) \log {\left (x + 4 \right )}}{x^{4}} + \frac {\left (x + 2\right ) \log {\left (x + 4 \right )}^{2}}{x^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________