1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | itab = [
|
14 |
|
15 | "f(a,a*x)",
|
16 |
|
17 | "f(1/x,log(x))",
|
18 |
|
19 | "f(x^a,x^(a+1)/(a+1))",
|
20 |
|
21 | "f(exp(a*x),1/a*exp(a*x))",
|
22 | "f(exp(a*x+b),1/a*exp(a*x+b))",
|
23 | "f(x*exp(a*x^2),exp(a*x^2)/(2*a))",
|
24 | "f(x*exp(a*x^2+b),exp(a*x^2+b)/(2*a))",
|
25 |
|
26 | "f(log(a*x),x*log(a*x)-x)",
|
27 |
|
28 | "f(a^x,a^x/log(a),or(not(number(a)),a>0))",
|
29 |
|
30 | "f(1/(a+x^2),1/sqrt(a)*arctan(x/sqrt(a)),or(not(number(a)),a>0))",
|
31 |
|
32 | "f(1/(a-x^2),1/sqrt(a)*arctanh(x/sqrt(a)))",
|
33 |
|
34 | "f(1/sqrt(a-x^2),arcsin(x/(sqrt(a))))",
|
35 |
|
36 | "f(1/sqrt(a+x^2),log(x+sqrt(a+x^2)))",
|
37 |
|
38 | "f(1/(a+b*x),1/b*log(a+b*x))",
|
39 |
|
40 | "f(1/(a+b*x)^2,-1/(b*(a+b*x)))",
|
41 |
|
42 | "f(1/(a+b*x)^3,-1/(2*b)*1/(a+b*x)^2)",
|
43 |
|
44 | "f(x/(a+b*x),x/b-a*log(a+b*x)/b/b)",
|
45 |
|
46 | "f(x/(a+b*x)^2,1/b^2*(log(a+b*x)+a/(a+b*x)))",
|
47 |
|
48 | "f(x^2/(a+b*x),1/b^2*(1/2*(a+b*x)^2-2*a*(a+b*x)+a^2*log(a+b*x)))",
|
49 |
|
50 | "f(x^2/(a+b*x)^2,1/b^3*(a+b*x-2*a*log(a+b*x)-a^2/(a+b*x)))",
|
51 |
|
52 | "f(x^2/(a+b*x)^3,1/b^3*(log(a+b*x)+2*a/(a+b*x)-1/2*a^2/(a+b*x)^2))",
|
53 |
|
54 | "f(1/x*1/(a+b*x),-1/a*log((a+b*x)/x))",
|
55 |
|
56 | "f(1/x*1/(a+b*x)^2,1/a*1/(a+b*x)-1/a^2*log((a+b*x)/x))",
|
57 |
|
58 | "f(1/x*1/(a+b*x)^3,1/a^3*(1/2*((2*a+b*x)/(a+b*x))^2+log(x/(a+b*x))))",
|
59 |
|
60 | "f(1/x^2*1/(a+b*x),-1/(a*x)+b/a^2*log((a+b*x)/x))",
|
61 |
|
62 | "f(1/x^3*1/(a+b*x),(2*b*x-a)/(2*a^2*x^2)+b^2/a^3*log(x/(a+b*x)))",
|
63 |
|
64 | "f(1/x^2*1/(a+b*x)^2,-(a+2*b*x)/(a^2*x*(a+b*x))+2*b/a^3*log((a+b*x)/x))",
|
65 |
|
66 | "f(1/(a+b*x^2),1/sqrt(a*b)*arctan(x*sqrt(a*b)/a),or(not(number(a*b)),a*b>0))",
|
67 |
|
68 | "f(1/(a+b*x^2),1/(2*sqrt(-a*b))*log((a+x*sqrt(-a*b))/(a-x*sqrt(-a*b))),or(not(number(a*b)),a*b<0))",
|
69 |
|
70 |
|
71 | "f(x/(a+b*x^2),1/2*1/b*log(a+b*x^2))",
|
72 |
|
73 | "f(x^2/(a+b*x^2),x/b-a/b*integral(1/(a+b*x^2),x))",
|
74 |
|
75 | "f(1/(a+b*x^2)^2,x/(2*a*(a+b*x^2))+1/2*1/a*integral(1/(a+b*x^2),x))",
|
76 |
|
77 |
|
78 | "f(1/x*1/(a+b*x^2),1/2*1/a*log(x^2/(a+b*x^2)))",
|
79 |
|
80 | "f(1/x^2*1/(a+b*x^2),-1/(a*x)-b/a*integral(1/(a+b*x^2),x))",
|
81 |
|
82 | "f(1/(a+b*x^3),1/3*1/a*(a/b)^(1/3)*(1/2*log(((a/b)^(1/3)+x)^3/(a+b*x^3))+sqrt(3)*arctan((2*x-(a/b)^(1/3))*(a/b)^(-1/3)/sqrt(3))))",
|
83 |
|
84 | "f(x^2/(a+b*x^3),1/3*1/b*log(a+b*x^3))",
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | "f(x/(a+b*x^4),1/2*sqrt(b/a)/b*arctan(x^2*sqrt(b/a)),or(not(number(a*b)),a*b>0))",
|
96 |
|
97 | "f(x/(a+b*x^4),1/4*sqrt(-b/a)/b*log((x^2-sqrt(-a/b))/(x^2+sqrt(-a/b))),or(not(number(a*b)),a*b<0))",
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | "f(x^3/(a+b*x^4),1/4*1/b*log(a+b*x^4))",
|
110 |
|
111 | "f(sqrt(a+b*x),2/3*1/b*sqrt((a+b*x)^3))",
|
112 |
|
113 | "f(x*sqrt(a+b*x),-2*(2*a-3*b*x)*sqrt((a+b*x)^3)/15/b^2)",
|
114 |
|
115 | "f(x^2*sqrt(a+b*x),2*(8*a^2-12*a*b*x+15*b^2*x^2)*sqrt((a+b*x)^3)/105/b^3)",
|
116 |
|
117 | "f(sqrt(a+b*x)/x,2*sqrt(a+b*x)+a*integral(1/x*1/sqrt(a+b*x),x))",
|
118 |
|
119 | "f(sqrt(a+b*x)/x^2,-sqrt(a+b*x)/x+b/2*integral(1/x*1/sqrt(a+b*x),x))",
|
120 |
|
121 | "f(1/sqrt(a+b*x),2*sqrt(a+b*x)/b)",
|
122 |
|
123 | "f(x/sqrt(a+b*x),-2/3*(2*a-b*x)*sqrt(a+b*x)/b^2)",
|
124 |
|
125 | "f(x^2/sqrt(a+b*x),2/15*(8*a^2-4*a*b*x+3*b^2*x^2)*sqrt(a+b*x)/b^3)",
|
126 |
|
127 | "f(1/x*1/sqrt(a+b*x),1/sqrt(a)*log((sqrt(a+b*x)-sqrt(a))/(sqrt(a+b*x)+sqrt(a))),or(not(number(a)),a>0))",
|
128 |
|
129 | "f(1/x*1/sqrt(a+b*x),2/sqrt(-a)*arctan(sqrt(-(a+b*x)/a)),or(not(number(a)),a<0))",
|
130 |
|
131 | "f(1/x^2*1/sqrt(a+b*x),-sqrt(a+b*x)/a/x-1/2*b/a*integral(1/x*1/sqrt(a+b*x),x))",
|
132 |
|
133 | "f(sqrt(x^2+a),1/2*(x*sqrt(x^2+a)+a*log(x+sqrt(x^2+a))))",
|
134 |
|
135 | "f(1/sqrt(x^2+a),log(x+sqrt(x^2+a)))",
|
136 |
|
137 | "f(1/x*1/sqrt(x^2+a),arcsec(x/sqrt(-a))/sqrt(-a),or(not(number(a)),a<0))",
|
138 |
|
139 | "f(1/x*1/sqrt(x^2+a),-1/sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))",
|
140 |
|
141 | "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))",
|
142 |
|
143 | "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(-a)*arcsec(x/sqrt(-a)),or(not(number(a)),a<0))",
|
144 |
|
145 | "f(x/sqrt(x^2+a),sqrt(x^2+a))",
|
146 |
|
147 | "f(x*sqrt(x^2+a),1/3*sqrt((x^2+a)^3))",
|
148 |
|
149 | "f(sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2+a^(1/3))^3)+3/2*a^(1/3)*x*sqrt(x^2+a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2+a^(1/3)))))",
|
150 |
|
151 | "f(sqrt(-a+x^6-3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2-a^(1/3))^3)-3/2*a^(1/3)*x*sqrt(x^2-a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2-a^(1/3)))))",
|
152 |
|
153 | "f(1/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),x/a^(1/3)/sqrt(x^2+a^(1/3)))",
|
154 |
|
155 | "f(x/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),-1/sqrt(x^2+a^(1/3)))",
|
156 |
|
157 | "f(x*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/5*sqrt((x^2+a^(1/3))^5))",
|
158 |
|
159 | "f(x^2*sqrt(x^2+a),1/4*x*sqrt((x^2+a)^3)-1/8*a*x*sqrt(x^2+a)-1/8*a^2*log(x+sqrt(x^2+a)))",
|
160 |
|
161 | "f(x^3*sqrt(x^2+a),(1/5*x^2-2/15*a)*sqrt((x^2+a)^3),and(number(a),a>0))",
|
162 |
|
163 | "f(x^3*sqrt(x^2+a),sqrt((x^2+a)^5)/5-a*sqrt((x^2+a)^3)/3,and(number(a),a<0))",
|
164 |
|
165 | "f(x^2/sqrt(x^2+a),1/2*x*sqrt(x^2+a)-1/2*a*log(x+sqrt(x^2+a)))",
|
166 |
|
167 | "f(x^3/sqrt(x^2+a),1/3*sqrt((x^2+a)^3)-a*sqrt(x^2+a))",
|
168 |
|
169 | "f(1/x^2*1/sqrt(x^2+a),-sqrt(x^2+a)/a/x)",
|
170 |
|
171 | "f(1/x^3*1/sqrt(x^2+a),-1/2*sqrt(x^2+a)/a/x^2+1/2*log((sqrt(a)+sqrt(x^2+a))/x)/a^(3/2),or(not(number(a)),a>0))",
|
172 |
|
173 | "f(1/x^3*1/sqrt(x^2-a),1/2*sqrt(x^2-a)/a/x^2+1/2*1/(a^(3/2))*arcsec(x/(a^(1/2))),or(not(number(a)),a>0))",
|
174 |
|
175 | "f(x^2*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/6*x*sqrt((x^2+a^(1/3))^5)-1/24*a^(1/3)*x*sqrt((x^2+a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2+a^(1/3))-1/16*a*log(x+sqrt(x^2+a^(1/3))),or(not(number(a)),a>0))",
|
176 |
|
177 | "f(x^2*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/6*x*sqrt((x^2-a^(1/3))^5)+1/24*a^(1/3)*x*sqrt((x^2-a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2-a^(1/3))+1/16*a*log(x+sqrt(x^2-a^(1/3))),or(not(number(a)),a>0))",
|
178 |
|
179 | "f(x^3*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/7*sqrt((x^2+a^(1/3))^7)-1/5*a^(1/3)*sqrt((x^2+a^(1/3))^5),or(not(number(a)),a>0))",
|
180 |
|
181 | "f(x^3*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/7*sqrt((x^2-a^(1/3))^7)+1/5*a^(1/3)*sqrt((x^2-a^(1/3))^5),or(not(number(a)),a>0))",
|
182 |
|
183 | "f(1/(x-a)/sqrt(x^2-a^2),-sqrt(x^2-a^2)/a/(x-a))",
|
184 |
|
185 | "f(1/(x+a)/sqrt(x^2-a^2),sqrt(x^2-a^2)/a/(x+a))",
|
186 |
|
187 | "f(sqrt(a-x^2),1/2*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(abs(a)))))",
|
188 |
|
189 |
|
190 | "f(1/x*1/sqrt(a-x^2),-1/sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))",
|
191 |
|
192 | "f(sqrt(a-x^2)/x,sqrt(a-x^2)-sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))",
|
193 |
|
194 | "f(x/sqrt(a-x^2),-sqrt(a-x^2))",
|
195 |
|
196 | "f(x*sqrt(a-x^2),-1/3*sqrt((a-x^2)^3))",
|
197 |
|
198 | "f(x^2*sqrt(a-x^2),-x/4*sqrt((a-x^2)^3)+1/8*a*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(a))),or(not(number(a)),a>0))",
|
199 |
|
200 | "f(x^3*sqrt(a-x^2),(-1/5*x^2-2/15*a)*sqrt((a-x^2)^3),or(not(number(a)),a>0))",
|
201 |
|
202 | "f(x^2/sqrt(a-x^2),-x/2*sqrt(a-x^2)+a/2*arcsin(x/sqrt(a)),or(not(number(a)),a>0))",
|
203 |
|
204 | "f(1/x^2*1/sqrt(a-x^2),-sqrt(a-x^2)/a/x,or(not(number(a)),a>0))",
|
205 |
|
206 | "f(sqrt(a-x^2)/x^2,-sqrt(a-x^2)/x-arcsin(x/sqrt(a)),or(not(number(a)),a>0))",
|
207 |
|
208 | "f(sqrt(a-x^2)/x^3,-1/2*sqrt(a-x^2)/x^2+1/2*log((sqrt(a)+sqrt(a-x^2))/x)/sqrt(a),or(not(number(a)),a>0))",
|
209 |
|
210 | "f(sqrt(a-x^2)/x^4,-1/3*sqrt((a-x^2)^3)/a/x^3,or(not(number(a)),a>0))",
|
211 |
|
212 | "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*log(x*sqrt(a)+sqrt(a*x^2+b))/2/sqrt(a),and(number(a),a>0))",
|
213 |
|
214 | "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*arcsin(x*sqrt(-a/b))/2/sqrt(-a),and(number(a),a<0))",
|
215 |
|
216 | "f(sin(a*x),-cos(a*x)/a)",
|
217 |
|
218 | "f(cos(a*x),sin(a*x)/a)",
|
219 |
|
220 | "f(tan(a*x),-log(cos(a*x))/a)",
|
221 |
|
222 | "f(1/tan(a*x),log(sin(a*x))/a)",
|
223 |
|
224 | "f(1/cos(a*x),log(tan(pi/4+a*x/2))/a)",
|
225 |
|
226 | "f(1/sin(a*x),log(tan(a*x/2))/a)",
|
227 |
|
228 | "f(sin(a*x)^2,x/2-sin(2*a*x)/(4*a))",
|
229 |
|
230 | "f(sin(a*x)^3,-cos(a*x)*(sin(a*x)^2+2)/(3*a))",
|
231 |
|
232 | "f(sin(a*x)^4,3/8*x-sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))",
|
233 |
|
234 | "f(cos(a*x)^2,x/2+sin(2*a*x)/(4*a))",
|
235 |
|
236 | "f(cos(a*x)^3,sin(a*x)*(cos(a*x)^2+2)/(3*a))",
|
237 |
|
238 | "f(cos(a*x)^4,3/8*x+sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))",
|
239 |
|
240 | "f(1/sin(a*x)^2,-1/(a*tan(a*x)))",
|
241 |
|
242 | "f(1/cos(a*x)^2,tan(a*x)/a)",
|
243 |
|
244 | "f(sin(a*x)*cos(a*x),sin(a*x)^2/(2*a))",
|
245 |
|
246 | "f(sin(a*x)^2*cos(a*x)^2,-sin(4*a*x)/(32*a)+x/8)",
|
247 |
|
248 | "f(sin(a*x)/cos(a*x)^2,1/(a*cos(a*x)))",
|
249 |
|
250 | "f(sin(a*x)^2/cos(a*x),(log(tan(pi/4+a*x/2))-sin(a*x))/a)",
|
251 |
|
252 | "f(cos(a*x)/sin(a*x)^2,-1/(a*sin(a*x)))",
|
253 |
|
254 | "f(1/(sin(a*x)*cos(a*x)),log(tan(a*x))/a)",
|
255 |
|
256 | "f(1/(sin(a*x)*cos(a*x)^2),(1/cos(a*x)+log(tan(a*x/2)))/a)",
|
257 |
|
258 | "f(1/(sin(a*x)^2*cos(a*x)),(log(tan(pi/4+a*x/2))-1/sin(a*x))/a)",
|
259 |
|
260 | "f(1/(sin(a*x)^2*cos(a*x)^2),-2/(a*tan(2*a*x)))",
|
261 |
|
262 | "f(sin(a+b*x),-cos(a+b*x)/b)",
|
263 |
|
264 | "f(cos(a+b*x),sin(a+b*x)/b)",
|
265 |
|
266 | "f(1/(b+b*sin(a*x)),-tan(pi/4-a*x/2)/a/b)",
|
267 |
|
268 | "f(1/(b-b*sin(a*x)),tan(pi/4+a*x/2)/a/b)",
|
269 |
|
270 | "f(1/(b+b*cos(a*x)),tan(a*x/2)/a/b)",
|
271 |
|
272 | "f(1/(b-b*cos(a*x)),-1/tan(a*x/2)/a/b)",
|
273 |
|
274 | "f(1/(a+b*sin(x)),1/sqrt(b^2-a^2)*log((a*tan(x/2)+b-sqrt(b^2-a^2))/(a*tan(x/2)+b+sqrt(b^2-a^2))),b^2-a^2)",
|
275 |
|
276 | "f(1/(a+b*cos(x)),1/sqrt(b^2-a^2)*log((sqrt(b^2-a^2)*tan(x/2)+a+b)/(sqrt(b^2-a^2)*tan(x/2)-a-b)),b^2-a^2)",
|
277 |
|
278 | "f(x*sin(a*x),sin(a*x)/a^2-x*cos(a*x)/a)",
|
279 |
|
280 | "f(x^2*sin(a*x),2*x*sin(a*x)/a^2-(a^2*x^2-2)*cos(a*x)/a^3)",
|
281 |
|
282 | "f(x*cos(a*x),cos(a*x)/a^2+x*sin(a*x)/a)",
|
283 |
|
284 | "f(x^2*cos(a*x),2*x*cos(a*x)/a^2+(a^2*x^2-2)*sin(a*x)/a^3)",
|
285 |
|
286 | "f(arcsin(a*x),x*arcsin(a*x)+sqrt(1-a^2*x^2)/a)",
|
287 |
|
288 | "f(arccos(a*x),x*arccos(a*x)-sqrt(1-a^2*x^2)/a)",
|
289 |
|
290 | "f(arctan(a*x),x*arctan(a*x)-1/2*log(1+a^2*x^2)/a)",
|
291 |
|
292 | "f(log(a*x),x*log(a*x)-x)",
|
293 |
|
294 | "f(x*log(a*x),x^2*log(a*x)/2-x^2/4)",
|
295 |
|
296 | "f(x^2*log(a*x),x^3*log(a*x)/3-1/9*x^3)",
|
297 |
|
298 | "f(log(x)^2,x*log(x)^2-2*x*log(x)+2*x)",
|
299 |
|
300 | "f(1/x*1/(a+log(x)),log(a+log(x)))",
|
301 |
|
302 | "f(log(a*x+b),(a*x+b)*log(a*x+b)/a-x)",
|
303 |
|
304 | "f(log(a*x+b)/x^2,a/b*log(x)-(a*x+b)*log(a*x+b)/b/x)",
|
305 |
|
306 | "f(sinh(x),cosh(x))",
|
307 |
|
308 | "f(cosh(x),sinh(x))",
|
309 |
|
310 | "f(tanh(x),log(cosh(x)))",
|
311 |
|
312 | "f(x*sinh(x),x*cosh(x)-sinh(x))",
|
313 |
|
314 | "f(x*cosh(x),x*sinh(x)-cosh(x))",
|
315 |
|
316 | "f(sinh(x)^2,sinh(2*x)/4-x/2)",
|
317 |
|
318 | "f(tanh(x)^2,x-tanh(x))",
|
319 |
|
320 | "f(cosh(x)^2,sinh(2*x)/4+x/2)",
|
321 |
|
322 | "f(x^3*exp(a*x^2),exp(a*x^2)*(x^2/a-1/(a^2))/2)",
|
323 |
|
324 | "f(x^3*exp(a*x^2+b),exp(a*x^2)*exp(b)*(x^2/a-1/(a^2))/2)",
|
325 |
|
326 | "f(exp(a*x^2),-i*sqrt(pi)*erf(i*sqrt(a)*x)/sqrt(a)/2)",
|
327 |
|
328 | "f(erf(a*x),x*erf(a*x)+exp(-a^2*x^2)/a/sqrt(pi))",
|
329 |
|
330 |
|
331 |
|
332 | "f(x^2*(1-x^2)^(3/2),(x*sqrt(1-x^2)*(-8*x^4+14*x^2-3)+3*arcsin(x))/48)",
|
333 | "f(x^2*(1-x^2)^(5/2),(x*sqrt(1-x^2)*(48*x^6-136*x^4+118*x^2-15)+15*arcsin(x))/384)",
|
334 | "f(x^4*(1-x^2)^(3/2),(-x*sqrt(1-x^2)*(16*x^6-24*x^4+2*x^2+3)+3*arcsin(x))/128)",
|
335 |
|
336 | "f(x*exp(a*x),exp(a*x)*(a*x-1)/(a^2))",
|
337 | "f(x*exp(a*x+b),exp(a*x+b)*(a*x-1)/(a^2))",
|
338 |
|
339 | "f(x^2*exp(a*x),exp(a*x)*(a^2*x^2-2*a*x+2)/(a^3))",
|
340 | "f(x^2*exp(a*x+b),exp(a*x+b)*(a^2*x^2-2*a*x+2)/(a^3))",
|
341 |
|
342 | "f(x^3*exp(a*x),exp(a*x)*x^3/a-3/a*integral(x^2*exp(a*x),x))",
|
343 | "f(x^3*exp(a*x+b),exp(a*x+b)*x^3/a-3/a*integral(x^2*exp(a*x+b),x))",
|
344 | 0
|
345 |
|
346 | ]
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | Eval_integral = ->
|
354 | i = 0
|
355 | n = 0
|
356 |
|
357 |
|
358 |
|
359 | p1 = cdr(p1)
|
360 | push(car(p1))
|
361 | Eval()
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 | p1 = cdr(p1)
|
374 | push(car(p1))
|
375 | Eval()
|
376 |
|
377 | p2 = pop()
|
378 | if (p2 == symbol(NIL))
|
379 | guess()
|
380 | push(symbol(NIL))
|
381 | else if (isnum(p2))
|
382 | guess()
|
383 | push(p2)
|
384 | else
|
385 | push(p2)
|
386 | p1 = cdr(p1)
|
387 | push(car(p1))
|
388 | Eval()
|
389 |
|
390 | p5 = pop()
|
391 | p4 = pop()
|
392 | p3 = pop()
|
393 |
|
394 | while (1)
|
395 |
|
396 |
|
397 |
|
398 | if (isnum(p5))
|
399 | push(p5)
|
400 | n = pop_integer()
|
401 | if (isNaN(n))
|
402 | stop("nth integral: check n")
|
403 | else
|
404 | n = 1
|
405 |
|
406 | push(p3)
|
407 |
|
408 | if (n >= 0)
|
409 | for i in [0...n]
|
410 | push(p4)
|
411 | integral()
|
412 | else
|
413 | n = -n
|
414 | for i in [0...n]
|
415 | push(p4)
|
416 | derivative()
|
417 |
|
418 | p3 = pop()
|
419 |
|
420 |
|
421 |
|
422 | if (p5 == symbol(NIL))
|
423 | break
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 | if (isnum(p5))
|
438 | p1 = cdr(p1)
|
439 | push(car(p1))
|
440 | Eval()
|
441 | p5 = pop()
|
442 | if (p5 == symbol(NIL))
|
443 | break;
|
444 | if (isnum(p5))
|
445 | doNothing = 1
|
446 | else
|
447 | p4 = p5;
|
448 | p1 = cdr(p1)
|
449 | push(car(p1))
|
450 | Eval()
|
451 | p5 = pop();
|
452 | else
|
453 | p4 = p5;
|
454 | p1 = cdr(p1)
|
455 | push(car(p1))
|
456 | Eval()
|
457 | p5 = pop();
|
458 |
|
459 | push(p3);
|
460 |
|
461 | integral = ->
|
462 | save()
|
463 | p2 = pop()
|
464 | p1 = pop()
|
465 | if (car(p1) == symbol(ADD))
|
466 | integral_of_sum()
|
467 | else if (car(p1) == symbol(MULTIPLY))
|
468 | integral_of_product()
|
469 | else
|
470 | integral_of_form()
|
471 | p1 = pop()
|
472 | if (Find(p1, symbol(INTEGRAL)))
|
473 | stop("integral: sorry, could not find a solution")
|
474 | push(p1)
|
475 | simplify();
|
476 | Eval();
|
477 | restore()
|
478 |
|
479 | integral_of_sum = ->
|
480 | p1 = cdr(p1)
|
481 | push(car(p1))
|
482 | push(p2)
|
483 | integral()
|
484 | p1 = cdr(p1)
|
485 | while (iscons(p1))
|
486 | push(car(p1))
|
487 | push(p2)
|
488 | integral()
|
489 | add()
|
490 | p1 = cdr(p1)
|
491 |
|
492 | integral_of_product = ->
|
493 | push(p1)
|
494 | push(p2)
|
495 | partition()
|
496 | p1 = pop();
|
497 | integral_of_form()
|
498 | multiply();
|
499 |
|
500 | integral_of_form = ->
|
501 | push(p1)
|
502 | push(p2)
|
503 | transform(itab, false)
|
504 | p3 = pop()
|
505 | if (p3 == symbol(NIL))
|
506 | push_symbol(INTEGRAL)
|
507 | push(p1)
|
508 | push(p2)
|
509 | list(3)
|
510 | else
|
511 | push(p3)
|
512 |
|
513 |
|