1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
// Giac integration test file: "0 Independent test suites\Apostol Problems.txt"
// "nock" means we do not check the antiderivative
lst:=[
// Kevin Charlwood - Integration on Computer Algebra Systems (2008)
// Problem #1
[arcsin(x)*log(x),x,8,arctanh(sqrt(1-x^2))-x*arcsin(x)*(1-log(x))-2*sqrt(1-x^2)+log(x)*sqrt(1-x^2),-x*arcsin(x)+arctanh(sqrt(1-x^2))+x*arcsin(x)*log(x)-2*sqrt(1-x^2)+log(x)*sqrt(1-x^2)],
// Problem #2
[x*arcsin(x)/sqrt(1-x^2),x,2,x-arcsin(x)*sqrt(1-x^2)],
// Problem #3
[arcsin(-sqrt(x)+sqrt(1+x)),x,0,-3,-(3/8+x)*arcsin(sqrt(x)-sqrt(1+x))+1/4*(sqrt(x)+3*sqrt(1+x))*sqrt(-x+sqrt(x)*sqrt(1+x))/sqrt(2)],
// Problem #4
[log(1+x*sqrt(1+x^2)),x,-32,-2*x+x*log(1+x*sqrt(1+x^2))-arctanh((x+sqrt(1+x^2))*sqrt(2+sqrt(5)))*sqrt(2*(-1+sqrt(5)))+arctan((x+sqrt(1+x^2))*sqrt(-2+sqrt(5)))*sqrt(2*(1+sqrt(5)))],
// Problem #5
[cos(x)^2/sqrt(1+cos(x)^2+cos(x)^4),x,-5,1/3*x+1/3*arctan(cos(x)*(1+cos(x)^2)*sin(x)/(1+cos(x)^2*sqrt(1+cos(x)^2+cos(x)^4)))],
// Problem #6
[sqrt(1+tan(x)^4)*tan(x),x,7,-1/2*arcsinh(tan(x)^2)-arctanh((1-tan(x)^2)/(sqrt(2)*sqrt(1+tan(x)^4)))/sqrt(2)+1/2*sqrt(1+tan(x)^4)],
// Problem #7
[tan(x)/sqrt(1+sec(x)^3),x,4,-2/3*arctanh(sqrt(1+sec(x)^3))],
// Problem #8
[sqrt(2+2*tan(x)+tan(x)^2),x,0,9,arcsinh(1+tan(x))-arctanh((2*sqrt(5)+(5-sqrt(5))*tan(x))/(sqrt(10*(-1+sqrt(5)))*sqrt(2+2*tan(x)+tan(x)^2)))*sqrt(1/2*(-1+sqrt(5)))-arctan((2*sqrt(5)-(5+sqrt(5))*tan(x))/(sqrt(10*(1+sqrt(5)))*sqrt(2+2*tan(x)+tan(x)^2)))*sqrt(1/2*(1+sqrt(5)))],
// Problem //9
[arctan(sqrt(-1+sec(x)))*sin(x),x,0,1/2*arctan(sqrt(-1+sec(x)))-arctan(sqrt(-1+sec(x)))*cos(x)+1/2*cos(x)*sqrt(-1+sec(x))],
// Problem //10
[exp(arcsin(x))*x^3/sqrt(1-x^2),x,5,1/10*exp(arcsin(x))*(3*x+x^3-3*sqrt(1-x^2)-3*x^2*sqrt(1-x^2)),3/10*exp(arcsin(x))*x+1/10*exp(arcsin(x))*x^3-3/10*exp(arcsin(x))*sqrt(1-x^2)-3/10*exp(arcsin(x))*x^2*sqrt(1-x^2)],
// Problem //11
[x*log(1+x^2)*log(x+sqrt(1+x^2))/sqrt(1+x^2),x,7,4*x-2*arctan(x)-x*log(1+x^2)-2*log(x+sqrt(1+x^2))*sqrt(1+x^2)+log(1+x^2)*log(x+sqrt(1+x^2))*sqrt(1+x^2)],
// Problem //12
[arctan(x+sqrt(1-x^2)),x,-40,-1/2*arcsin(x)+x*arctan(x+sqrt(1-x^2))-1/4*arctanh(x*sqrt(1-x^2))-1/8*log(1-x^2+x^4)-1/4*arctan((-1+2*x^2)/sqrt(3))*sqrt(3)+1/4*arctan((-1+x*sqrt(3))/sqrt(1-x^2))*sqrt(3)+1/4*arctan((1+x*sqrt(3))/sqrt(1-x^2))*sqrt(3)],
// Problem //13
[x*arctan(x+sqrt(1-x^2))/sqrt(1-x^2),x,-32,-1/2*arcsin(x)+1/4*arctanh(x*sqrt(1-x^2))+1/8*log(1-x^2+x^4)-1/4*arctan((-1+2*x^2)/sqrt(3))*sqrt(3)+1/4*arctan((-1+x*sqrt(3))/sqrt(1-x^2))*sqrt(3)+1/4*arctan((1+x*sqrt(3))/sqrt(1-x^2))*sqrt(3)-arctan(x+sqrt(1-x^2))*sqrt(1-x^2)],
// Problem //14
[arcsin(x)/(1+sqrt(1-x^2)),x,9,1/2*arcsin(x)^2-log(1+sqrt(1-x^2))-x*arcsin(x)/(1+sqrt(1-x^2)),-arcsin(x)/x+1/2*arcsin(x)^2-arctanh(sqrt(1-x^2))-log(x)+arcsin(x)*sqrt(1-x^2)/x],
// Problem //15
[log(x+sqrt(1+x^2))/(1-x^2)^(3/2),x,0,3,-1/2*arcsin(x^2)+x*log(x+sqrt(1+x^2))/sqrt(1-x^2)],
// Problem //16
[arcsin(x)/(1+x^2)^(3/2),x,0,3,-1/2*arcsin(x^2)+x*arcsin(x)/sqrt(1+x^2)],
// Problem //17
[log(x+sqrt(-1+x^2))/(1+x^2)^(3/2),x,3,-1/2*arccosh(x^2)+x*log(x+sqrt(-1+x^2))/sqrt(1+x^2)],
// Problem //18
[log(x)/(x^2*sqrt(-1+x^2)),x,4,-arctanh(x/sqrt(-1+x^2))+sqrt(-1+x^2)/x+log(x)*sqrt(-1+x^2)/x],
// Problem //19
[sqrt(1+x^3)/x,x,4,-2/3*arctanh(sqrt(1+x^3))+2/3*sqrt(1+x^3)],
// Problem //20
[x*log(x+sqrt(-1+x^2))/sqrt(-1+x^2),x,2,-x+log(x+sqrt(-1+x^2))*sqrt(-1+x^2)],
// Problem //21
[x^3*arcsin(x)/sqrt(1-x^4),x,5,1/4*arcsinh(x)+1/4*x*sqrt(1+x^2)-1/2*arcsin(x)*sqrt(1-x^4)],
// Problem //22
[x^3*arcsec(x)/sqrt(-1+x^4),x,7,1/2*arctanh(x*sqrt(1+(-1)/x^2)/sqrt(-1+x^4))+1/2*arcsec(x)*sqrt(-1+x^4)-1/2*sqrt(-1+x^4)/(x*sqrt(1+(-1)/x^2)),1/2*arctan(sqrt(-1+x^4)/sqrt(1-x^2))*sqrt(1-x^2)/(x*sqrt(1+(-1)/x^2))+1/2*arcsec(x)*sqrt(-1+x^4)-1/2*sqrt(-1+x^4)/(x*sqrt(1+(-1)/x^2))],
// Problem //23
[x*arctan(x)*log(x+sqrt(1+x^2))/sqrt(1+x^2),x,4,-x*arctan(x)+1/2*log(1+x^2)-1/2*log(x+sqrt(1+x^2))^2+arctan(x)*log(x+sqrt(1+x^2))*sqrt(1+x^2)],
// Problem //24
[x*log(1+sqrt(1-x^2))/sqrt(1-x^2),x,5,-log(1+sqrt(1-x^2))+sqrt(1-x^2)-log(1+sqrt(1-x^2))*sqrt(1-x^2)],
// Problem //25
[x*log(x+sqrt(1+x^2))/sqrt(1+x^2),x,2,-x+log(x+sqrt(1+x^2))*sqrt(1+x^2)],
// Problem //26
[x*log(x+sqrt(1-x^2))/sqrt(1-x^2),x,18,arctanh(x*sqrt(2))/sqrt(2)-arctanh(sqrt(2)*sqrt(1-x^2))/sqrt(2)+sqrt(1-x^2)-log(x+sqrt(1-x^2))*sqrt(1-x^2)],
// Problem //27
[log(x)/(x^2*sqrt(1-x^2)),x,3,-arcsin(x)-sqrt(1-x^2)/x-log(x)*sqrt(1-x^2)/x],
// Problem //28
[x*arctan(x)/sqrt(1+x^2),x,2,-arcsinh(x)+arctan(x)*sqrt(1+x^2)],
// Problem //29
[arctan(x)/(x^2*sqrt(1-x^2)),x,7,-arctanh(sqrt(1-x^2))+arctanh(sqrt(1-x^2)/sqrt(2))*sqrt(2)-arctan(x)*sqrt(1-x^2)/x],
// Problem //30
[x*arctan(x)/sqrt(1-x^2),x,5,-arcsin(x)+arctan(x*sqrt(2)/sqrt(1-x^2))*sqrt(2)-arctan(x)*sqrt(1-x^2)],
// Problem //31
[arctan(x)/(x^2*sqrt(1+x^2)),x,4,-arctanh(sqrt(1+x^2))-arctan(x)*sqrt(1+x^2)/x],
// Problem //32
[arcsin(x)/(x^2*sqrt(1-x^2)),x,2,log(x)-arcsin(x)*sqrt(1-x^2)/x],
// Problem //33
[x*log(x)/sqrt(-1+x^2),x,5,arctan(sqrt(-1+x^2))-sqrt(-1+x^2)+log(x)*sqrt(-1+x^2)],
// Problem //34
[log(x)/(x^2*sqrt(1+x^2)),x,3,arcsinh(x)-sqrt(1+x^2)/x-log(x)*sqrt(1+x^2)/x],
// Problem //35
[x*arcsec(x)/sqrt(-1+x^2),x,2,-x*log(x)/sqrt(x^2)+arcsec(x)*sqrt(-1+x^2)],
// Problem //36
[x*log(x)/sqrt(1+x^2),x,5,arctanh(sqrt(1+x^2))-sqrt(1+x^2)+log(x)*sqrt(1+x^2)],
// Problem //37
[sin(x)/(1+sin(x)^2),x,2,-arctanh(cos(x)/sqrt(2))/sqrt(2)],
// Problem //38
[(1+x^2)/((1-x^2)*sqrt(1+x^4)),x,2,arctanh(x*sqrt(2)/sqrt(1+x^4))/sqrt(2)],
// Problem //39
[(1-x^2)/((1+x^2)*sqrt(1+x^4)),x,2,arctan(x*sqrt(2)/sqrt(1+x^4))/sqrt(2)],
// Problem //40
[log(sin(x))/(1+sin(x)),x,4,-x-arctanh(cos(x))-cos(x)*log(sin(x))/(1+sin(x))],
// Problem //41
[log(sin(x))*sqrt(1+sin(x)),x,0,6,-4*arctanh(cos(x)/sqrt(1+sin(x)))+4*cos(x)/sqrt(1+sin(x))-2*cos(x)*log(sin(x))/sqrt(1+sin(x))],
// Problem //42
[sec(x)/sqrt(-1+sec(x)^4),x,-5,-arctanh(cos(x)*cot(x)*sqrt(-1+sec(x)^4)/sqrt(2))/sqrt(2)],
// Problem //43
[tan(x)/sqrt(1+tan(x)^4),x,4,-1/2*arctanh((1-tan(x)^2)/(sqrt(2)*sqrt(1+tan(x)^4)))/sqrt(2)],
// Problem //44
[sin(x)/sqrt(1-sin(x)^6),x,"assume(0<x<pi/2)",4,1/2*arctanh(1/2*cos(x)*(1+sin(x)^2)*sqrt(3)/sqrt(1-sin(x)^6))/sqrt(3),1/2*arctanh(1/2*cos(x)*(6-3*cos(x)^2)/(sqrt(3)*sqrt(3*cos(x)^2-3*cos(x)^4+cos(x)^6)))/sqrt(3)],
// Problem //45
[sqrt(-sqrt(-1+sec(x))+sqrt(1+sec(x))),x,-1,cot(x)*sqrt(2)*sqrt(-1+sec(x))*sqrt(1+sec(x))*(arctan(1/2*(-sqrt(2)-sqrt(-1+sec(x))+sqrt(1+sec(x)))*sqrt(-2+2*sqrt(2))/sqrt(-sqrt(-1+sec(x))+sqrt(1+sec(x))))*sqrt(-1+sqrt(2))+arctanh(sqrt(2+2*sqrt(2))*sqrt(-sqrt(-1+sec(x))+sqrt(1+sec(x)))/(sqrt(2)-sqrt(-1+sec(x))+sqrt(1+sec(x))))*sqrt(-1+sqrt(2))-arctan(1/2*(-sqrt(2)-sqrt(-1+sec(x))+sqrt(1+sec(x)))*sqrt(2+2*sqrt(2))/sqrt(-sqrt(-1+sec(x))+sqrt(1+sec(x))))*sqrt(1+sqrt(2))-arctanh(sqrt(-2+2*sqrt(2))*sqrt(-sqrt(-1+sec(x))+sqrt(1+sec(x)))/(sqrt(2)-sqrt(-1+sec(x))+sqrt(1+sec(x))))*sqrt(1+sqrt(2)))],
// Problem //46
[x*arctan(x)^2*log(1+x^2),x,13,3*x*arctan(x)-3/2*arctan(x)^2-1/2*x^2*arctan(x)^2-3/2*log(1+x^2)-x*arctan(x)*log(1+x^2)+1/2*(1+x^2)*arctan(x)^2*log(1+x^2)+1/4*log(1+x^2)^2],
// Problem //47
[arctan(x*sqrt(1+x^2)),x,12,1/2*arctan(sqrt(3)-2*sqrt(1+x^2))+x*arctan(x*sqrt(1+x^2))-1/2*arctan(sqrt(3)+2*sqrt(1+x^2))-1/4*log(2+x^2-sqrt(3)*sqrt(1+x^2))*sqrt(3)+1/4*log(2+x^2+sqrt(3)*sqrt(1+x^2))*sqrt(3)],
// Problem //48 // normal(ratnormal())
[arctan(-sqrt(x)+sqrt(1+x)),x,6,(1+x)*arctan(-sqrt(x)+sqrt(1+x))+1/2*sqrt(x),1/4*Pi*x-1/2*arctan(sqrt(x))-1/2*x*arctan(sqrt(x))+1/2*sqrt(x)],
// Problem //49
[arcsin(x/sqrt(1-x^2)),x,0,4,x*arcsin(x/sqrt(1-x^2))+arctan(sqrt(1-2*x^2))],
// Problem //50
[arctan(x*sqrt(1-x^2)),x,6,x*arctan(x*sqrt(1-x^2))+arctanh(sqrt(1-x^2)*sqrt(1/2*(-1+sqrt(5))))*sqrt(1/2*(-1+sqrt(5)))-arctan(sqrt(1-x^2)*sqrt(1/2*(1+sqrt(5))))*sqrt(1/2*(1+sqrt(5))),x*arctan(x*sqrt(1-x^2))-arctan(sqrt(1-x^2)*sqrt(2/(-1+sqrt(5))))*sqrt(2/(-1+sqrt(5)))+arctanh(sqrt(1-x^2)*sqrt(2/(1+sqrt(5))))*sqrt(2/(1+sqrt(5)))]
]:;
auto_assume(1);
res:=[]:;
S:=182; S:=size(lst);
print("Integration independent test suites, Charlwood "+S);
file:=fopen("intindc.tst");
failint:=[]; failsimp:=[]; nock:=[]; ass:=[];
T0:=time();
for j from 0 to S-1 do
L:=eval(lst,1)[j]; print(L);
f:=L[0]; v:=L[1]; hyp:=L[2];
purge(unquote(v));
if (type(hyp)==string) expr(hyp); // eval assumption
print(j+1,f,v,hyp,about(unquote(v)));
try { g:=integrate(f,unquote(v)); } catch(err){ g:="integrate(err)"; }
Ss:=""+eval(g,1);
print(Ss);
h:=false;
fail:=size(Ss.find("integrate("))>0;
if (fail) failint.append(j+1);
if (hyp=="nock") nock.append(j+1);
if (hyp.type==string && size(hyp.find("assume("))>0) ass.append(j+1);
if (hyp!="nock" && !fail) h:=simplify(diff(g,unquote(v))-f); else print("nock");
if (eval(h,1)!=0) failsimp.append(j+1);
purge(unquote(assumptions));
fgh:=""+eval([j+1,f,g,h],1);
print(fgh);
//res.append([f,g,h]); print(res[size(res)-1]);
fprint(file,"",fgh);
od:;
fprint(file,"","Time:",time()-T0,", tests: ",S,", integration failures: ",size(failint),failint,", simplification failures: ",size(failsimp),failsimp,", not cheked: ",size(nock),nock,", assumptions: ",size(ass),ass);
fclose(file);
print("Integration independent test suites, Charlwood ","tests: ",S,", integration failures: ",size(failint),failint,", simplification failures: ",size(failsimp),failsimp,", not cheked: ",size(nock),nock,", assumptions: ",size(ass),ass);
//res;
|