On 9/3/2022 11:25 PM, Jeff Barnett wrote:
>I would either
> give the system a fail because it is unreliable on that problem or I
> would test it for, say, a 100 or so seeds and give the number (a
> percent) that it gets correct.
I've tried your idea. I've run this integral 100 times, using
100 different seeds and printed the anti-derivative each time
-------------------------
using Symbolics
using SymbolicNumericIntegration
using Dates
import Random
@syms x
integrand = 1 / (((1 - 2*x)^3)*((2 + 3*x)^3)*((3 + 5*x)^2))
for i=1:100
Random.seed!(i)
anti,n_unsolved,residual_error =integrate(integrand,x)
println("seed = ",i,", anti=",anti)
end
----------------------------
This is what I get
---------------------------
seed = 1, anti=0
seed = 2, anti=0
seed = 3, anti=0.0032245661147886633(((1//4) + x^2 - x)^-1) + 1.3932951722611113(((4//9) + (4//3)*x + x^2)^-1) + 4.2331946787976005log((3//5) + x) + 2.3517748215530303(x^3)*(((9//25) + (6//5)*x + x^2)^-1) + 3.0398064936094906x*(((4//9) + (4//3)*x + x^2)^-1) - 0.21458141730725133x - 0.9634428771843939(((9//25) + (6//5)*x + x^2)^-1) - 0.010517325162243041log(x - (1//2)) - 4.274386808487491log((2//3) + x) - 0.00644913222957772x*(((1//4) + x^2 - x)^-1) - 2.1371934042401866(x^3)*(((4//9) + (4//3)*x + x^2)^-1) - 2.452377064399745x*(((9//25) + (6//5)*x + x^2)^-1)
seed = 4, anti=-0.016330430066172893log(x - (1//2))
seed = 5, anti=0
Error from sparse_fitLinearAlgebra.SingularException(4)
seed = 6, anti=0
seed = 7, anti=0
seed = 8, anti=0
seed = 9, anti=0
seed = 10, anti=0.059870841012718994x - 0.014879657188586044(((9//25) + (6//5)*x + x^2)^-1) - 0.013484342743641575log(x - (1//2)) - 0.1077675138225977log((3//5) + x) - 0.0032459258832005468x*(((9//25) + (6//5)*x + x^2)^-1) - 0.059870841012343586(x^3)*(((9//25) + (6//5)*x + x^2)^-1)
seed = 11, anti=0
seed = 12, anti=0
seed = 13, anti=0
seed = 14, anti=0
seed = 15, anti=0
seed = 16, anti=0
seed = 17, anti=0
seed = 18, anti=-0.0026325376637571993log((3//5) + x)
seed = 19, anti=0
seed = 20, anti=0
seed = 21, anti=0
seed = 22, anti=0
seed = 23, anti=0
seed = 24, anti=0
seed = 25, anti=0
seed = 26, anti=1.719315621107581x + 2.349316120556791log((3//5) + x) + 2.578973431661372log(x - (1//2)) + 2.406019727054061x*(((1//4) + x^2 - x)^-1) - 0.9880954108885848(((1//4) + x^2 - x)^-1) - 1.7193156211075782(x^3)*(((1//4) + x^2 - x)^-1)
seed = 27, anti=0
seed = 28, anti=-67.51266553547356log((3//5) + x)
seed = 29, anti=0
seed = 30, anti=0
seed = 31, anti=0
seed = 32, anti=0
seed = 33, anti=0
Error from sparse_fitLinearAlgebra.SingularException(4)
seed = 34, anti=0
seed = 35, anti=0
seed = 36, anti=0
seed = 37, anti=0
seed = 38, anti=0
seed = 39, anti=0
seed = 40, anti=0.06317647317345293log((3//5) + x)
seed = 41, anti=0
seed = 42, anti=0
seed = 43, anti=0
seed = 44, anti=0
seed = 45, anti=(0.014378665475956662 - 0.0645731363698366im)*((72 + 132x + 2262(x^4) + 6743(x^5) - 754(x^2) - 234(x^6) - 1641(x^3) - 9180(x^7) - 5400(x^8))^-1) + (-0.0995313498923154 + 0.07922575111068406im)*x*((72 + 132x + 2262(x^4) + 6743(x^5) - 754(x^2) - 234(x^6) - 1641(x^3) - 9180(x^7) - 5400(x^8))^-1)
Error from sparse_fitLinearAlgebra.SingularException(4)
Error from sparse_fitLinearAlgebra.SingularException(3)
seed = 46, anti=0
seed = 47, anti=0
seed = 48, anti=0.06276392360387156log((3//5) + x)
seed = 49, anti=-133.00981698474402log((3//5) + x)
seed = 50, anti=0
Error from sparse_fitLinearAlgebra.SingularException(4)
seed = 51, anti=0
seed = 52, anti=0.10587351232085687(((3//5) + x)^-1) + 1.3864505792612496log((3//5) + x) - 0.002356341847725731log(x - (1//2)) - 1.345612601895796log((2//3) + x)
seed = 53, anti=0
seed = 54, anti=24.16357143891812log((3//5) + x)
seed = 55, anti=0
Error from sparse_fitLinearAlgebra.SingularException(4)
seed = 56, anti=0
seed = 57, anti=0
seed = 58, anti=0.20123985741641454x + 0.003878647339941809x*(((4//9) + (4//3)*x + x^2)^-1) - 0.05704085952566808(((4//9) + (4//3)*x + x^2)^-1) - 0.40247971483032596log((2//3) + x) - 0.20123985741402833(x^3)*(((4//9) + (4//3)*x + x^2)^-1)
seed = 59, anti=0.006561881810512138x - 0.007225855430077368(((9//25) + (6//5)*x + x^2)^-1) - 0.011811387258923282log((3//5) + x) - 0.006561881810514191(x^3)*(((9//25) + (6//5)*x + x^2)^-1) - 0.009680814931677178x*(((9//25) + (6//5)*x + x^2)^-1)
seed = 60, anti=0
seed = 61, anti=0
seed = 62, anti=0
seed = 63, anti=0
seed = 64, anti=0
seed = 65, anti=0
seed = 66, anti=0
seed = 67, anti=0
seed = 68, anti=0
seed = 69, anti=0
seed = 70, anti=-771.818391946339log(x - (1//2))
seed = 71, anti=0
seed = 72, anti=2.683289125488832log((3//5) + x)
seed = 73, anti=0
seed = 74, anti=0
seed = 75, anti=0
seed = 76, anti=-0.009088132845265414log(x - (1//2))
seed = 77, anti=0
Error from sparse_fitLinearAlgebra.SingularException(3)
seed = 78, anti=0
seed = 79, anti=0
Error from sparse_fitLinearAlgebra.SingularException(4)
seed = 80, anti=0
seed = 81, anti=-0.0021911954170486065((x - (1//2))^-1) - 0.006597505528434938log(x - (1//2))
seed = 82, anti=0
seed = 83, anti=0.00853042316622113(((1//4) + x^2 - x)^-1) + 0.1222253941760599x + 0.12923006955074817(((9//25) + (6//5)*x + x^2)^-1) + 0.2713198455831079x*(((9//25) + (6//5)*x + x^2)^-1) + 0.0331534845235633(x^3)*(((1//4) + x^2 - x)^-1) - 0.049730226785344944log(x - (1//2)) - 0.2796819816593179log((3//5) + x) - 0.02534921746333307x*(((1//4) + x^2 - x)^-1) - 0.15537887869961337(x^3)*(((9//25) + (6//5)*x + x^2)^-1)
seed = 84, anti=0
seed = 85, anti=-0.006923734706044644log((3//5) + x)
seed = 86, anti=0.009191532695211821log((3//5) + x)
seed = 87, anti=0.04867187748837544log((3//5) + x)
seed = 88, anti=0
seed = 89, anti=0
seed = 90, anti=0
seed = 91, anti=0.005796247487652043x - 0.0055676726126699(((9//25) + (6//5)*x + x^2)^-1) - 0.01043324547777366log((3//5) + x) - 0.005796247487652001(x^3)*(((9//25) + (6//5)*x + x^2)^-1) - 0.0071928052588951085x*(((9//25) + (6//5)*x + x^2)^-1)
seed = 92, anti=0.025581076356940465(((9//25) + (6//5)*x + x^2)^-1) + 0.2484241701152666log((3//5) + x) + 0.13801342784197507(x^3)*(((9//25) + (6//5)*x + x^2)^-1) - 0.1380134278416556x - 0.007049706761546733x*(((9//25) + (6//5)*x + x^2)^-1)
seed = 93, anti=0
seed = 94, anti=0.03466331592299737x - 0.05509270729327145(((4//9) + (4//3)*x + x^2)^-1) - 0.06932663184599135log((2//3) + x) - 0.03466331592299913(x^3)*(((4//9) + (4//3)*x + x^2)^-1) - 0.06723314275190788x*(((4//9) + (4//3)*x + x^2)^-1)
seed = 95, anti=0
seed = 96, anti=-105277.6007622171log(x - (1//2))
seed = 97, anti=0
seed = 98, anti=0
seed = 99, anti=0
seed = 100, anti=0.15059932742674897x + 0.22589899114011922log(x - (1//2)) + 0.12969704840228988x*(((1//4) + x^2 - x)^-1) - 0.04602360827280188(((1//4) + x^2 - x)^-1) - 0.1505993274267452(x^3)*(((1//4) + x^2 - x)^-1)
-------------------------------
Looking at the above, each result which is not zero is different.
anti=0 shows up most often. This implies that we should pick anti=0.
Which implies Julia failed to integrate it, since 0 can't be antiderivative
unless the integrand is zero.
Does this sound a correct approach and what you had in mind? I am
still not sure I could do the above for all 12,500 integrals due to long
time it will take. May be I could do it for say 20 different seeds?
--Nasser