Merge branch 'master' of ssh://git.code.sf.net/p/maxima/code
[maxima.git] / share / integration / antid.dem
bloba9eea55154ba98e9454a5b9026c4ed628c9080cd
1 /*******************************************************************************
2  * File    : antid.dem
3  * License : GNU General Public License (GPL)
4  * 
5  * A demo for the Maxima function antidiff
6  *
7  * See the Maxima reference manual for a documentation.
8  *
9  * This file is part of Maxima -- GPL CAS based on DOE-MACSYMA
10  ******************************************************************************/
12 load(antid)$
13 derivabbrev : true$
15 /* The demonstration functions chosen are the Nth derivatives of the
16  * product of the first M derivatives of U(x). This function, G, is then
17  * integrated once using ANTID >.
18  */
20  for n : 1 thru 2 do 
21   for m : 0 thru 3 do (
22     g : diff(product(diff(u(x), x, i), i, 0, m), x, n),
23       display(antidiff(g, x, u(x)))  )$
25 /* The function need not be a polynomial, for example:
26  */
28 g : diff(%e^u(x)*sin(u(x)), x, 2);
29 antidiff(g, x, u(x));
30 antidiff(%, x, u(x));
31 ratsimp(%);