/*******************************************************************************
 * File    : antid.dem
 * License : GNU General Public License (GPL)
 * 
 * A demo for the Maxima function antidiff
 *
 * See the Maxima reference manual for a documentation.
 *
 * This file is part of Maxima -- GPL CAS based on DOE-MACSYMA
 ******************************************************************************/

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)))  )$

/* 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(%);
