From: Robert D. <rob...@us...> - 2005-01-04 04:27:00
|
Update of /cvsroot/maxima/maxima/share/integration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13618/share/integration Modified Files: antid.dem antid.mac Log Message: Change uppercase to lowercase throughout. Index: antid.dem =================================================================== RCS file: /cvsroot/maxima/maxima/share/integration/antid.dem,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- antid.dem 8 May 2000 06:09:43 -0000 1.1.1.1 +++ antid.dem 4 Jan 2005 04:26:43 -0000 1.2 @@ -1,18 +1,18 @@ -LOAD(ANTID)$ -DERIVABBREV : TRUE$ +load(antid)$ +derivabbrev : true$ /* The demonstration functions chosen are the Nth derivatives of the product of the first M derivatives of U(x). This function, G, is then integrated once using ANTID >. */ - FOR N : 1 THRU 2 DO - FOR M : 0 THRU 3 DO ( - G : DIFF(PRODUCT(DIFF(U(X), X, I), I, 0, M), X, N), - DISPLAY(ANTIDIFF(G, X, U(X))) )$ + for n : 1 thru 2 do + for m : 0 thru 3 do ( + g : diff(product(diff(u(x), x, i), i, 0, m), x, n), + display(antidiff(g, x, u(x))) )$ /* The function need not be a polynomial, for example: */ -G : DIFF(%E^U(X)*SIN(U(X)), X, 2); -ANTIDIFF(G, X, U(X)); -ANTIDIFF(%, X, U(X)); -RATSIMP(%); +g : diff(%e^u(x)*sin(u(x)), x, 2); +antidiff(g, x, u(x)); +antidiff(%, x, u(x)); +ratsimp(%); Index: antid.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/integration/antid.mac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- antid.mac 18 Jul 2002 16:09:40 -0000 1.2 +++ antid.mac 4 Jan 2005 04:26:43 -0000 1.3 @@ -1,44 +1,44 @@ -NONZEROANDFREEOF(XARGUMENTX, EARGUMENTE) -:= IS(EARGUMENTE # 0 AND FREEOF(XARGUMENTX, EARGUMENTE))$ -MATCHDECLARE(AARGUMENTA, NONZEROANDFREEOF(XARGUMENTX), BARGUMENTB, -FREEOF(XARGUMENTX))$ -DEFMATCH(LINEAR, AARGUMENTA*XARGUMENTX+BARGUMENTB, XARGUMENTX)$ -ANTID(FN, VAR, UNK) := BLOCK( - [LCLVARIABLELCL, DVARIABLED, AARGUMENTA, BARGUMENTB, TVARIABLET, - UVARIABLEU, KILLER, lisarith:true], - DVARIABLED : DERIVDEGREE(FN, UNK, VAR), - IF DVARIABLED = 0 THEN ( - TVARIABLET : INTEGRATE(FN, VAR), - IF - NOT FREEOF(NOUNIFY(INTEGRATE), TVARIABLET) - THEN RETURN([0, FN]) ELSE - RETURN([TVARIABLET, 0]) ), - UVARIABLEU : DIFF(UNK, VAR, DVARIABLED), - KILLER(EARGUMENTE) := IF - HIPOW(EARGUMENTE, UVARIABLEU) <= 1 - THEN EARGUMENTE ELSE 0, - IF - LINEAR(FN, UVARIABLEU) = FALSE - THEN ( - TVARIABLET : EXPAND(FN), - IF - PART(TVARIABLET, 0) # "+" - THEN - RETURN([0, TVARIABLET]), - AARGUMENTA : MAP(KILLER, TVARIABLET), - RETURN(ANTID(AARGUMENTA, VAR, UNK)+[0, RATSIMP(FN-AARGUMENTA)]) +nonzeroandfreeof(xargumentx, eargumente) +:= is(eargumente # 0 and freeof(xargumentx, eargumente))$ +matchdeclare(aargumenta, nonzeroandfreeof(xargumentx), bargumentb, +freeof(xargumentx))$ +defmatch(linear, aargumenta*xargumentx+bargumentb, xargumentx)$ +antid(fn, var, unk) := block( + [lclvariablelcl, dvariabled, aargumenta, bargumentb, tvariablet, + uvariableu, killer, lisarith:true], + dvariabled : derivdegree(fn, unk, var), + if dvariabled = 0 then ( + tvariablet : integrate(fn, var), + if + not freeof(nounify(integrate), tvariablet) + then return([0, fn]) else + return([tvariablet, 0]) ), + uvariableu : diff(unk, var, dvariabled), + killer(eargumente) := if + hipow(eargumente, uvariableu) <= 1 + then eargumente else 0, + if + linear(fn, uvariableu) = false + then ( + tvariablet : expand(fn), + if + part(tvariablet, 0) # "+" + then + return([0, tvariablet]), + aargumenta : map(killer, tvariablet), + return(antid(aargumenta, var, unk)+[0, ratsimp(fn-aargumenta)]) ), - TVARIABLET : SUBST(DIFF(UNK, VAR, DVARIABLED-1), LCLVARIABLELCL, - INTEGRATE(SUBST(LCLVARIABLELCL, DIFF(UNK, VAR, DVARIABLED-1), - EXPAND(AARGUMENTA)), LCLVARIABLELCL)), - IF - NOT FREEOF(NOUNIFY(INTEGRATE), TVARIABLET) - THEN - RETURN([0, AARGUMENTA*UVARIABLEU]+ANTID(BARGUMENTB, VAR, UNK)), - RETURN([TVARIABLET, 0]+ANTID(RATSIMP(FN-DIFF(TVARIABLET, VAR)), - VAR, UNK)) )$ -ANTIDIFF(FN, VAR, UNK) := BLOCK( - [TVARIABLET], - TVARIABLET : ANTID(FN, VAR, UNK), - RETURN(PART(TVARIABLET, 1)+'INTEGRATE(PART(TVARIABLET, 2), VAR)) )$ + tvariablet : subst(diff(unk, var, dvariabled-1), lclvariablelcl, + integrate(subst(lclvariablelcl, diff(unk, var, dvariabled-1), + expand(aargumenta)), lclvariablelcl)), + if + not freeof(nounify(integrate), tvariablet) + then + return([0, aargumenta*uvariableu]+antid(bargumentb, var, unk)), + return([tvariablet, 0]+antid(ratsimp(fn-diff(tvariablet, var)), + var, unk)) )$ +antidiff(fn, var, unk) := block( + [tvariablet], + tvariablet : antid(fn, var, unk), + return(part(tvariablet, 1)+'integrate(part(tvariablet, 2), var)) )$ |