Notebook created 14 May, 2009 in Mathematica 5.0.  HomotopyIntegrator will run in version 5, 6, and 7.

SetDirectory["d:\\poole\\07-20-09\\HomotopyIntegrator"]

Get["HomotopyIntegrator.m"]

HomotopyIntegrator[ f, {independent variables} ] integrates by parts an exact expression, f,  involving unspecified functions of one independent variable or inverts the divergence of an exact expression with two or three indepdentent variables.  {independent variables}  can have up to three variables.

HomotopyIntegrator[ f, {independent variables} , {parameters} ] will evaluate a nonexact expression, f, with parameters for condidtions on the parameters that may make the expression exact.  HomotopyIntegrator will evaluate only parameters given in {parameters}.

HomotopyIntegrator[ f, {independent variables} , {parameters}, Options ] allows certain options.
Options for Homotopy Integrator:
Verbose -> True will provide a running dialog of the progress as a function is evaluated by HomotopyIntegrator.
printStandAloneOutput -> False suppresses all intermediate output, including the final result.

Examples:

Example 1 integrates a one-dimensional expression by parts.

exampleExpression[1]=f'[x] g'[x]+Cos[f[x]] f'[x] g'[x]+f[x] g''[x]+Sin[f[x]] g''[x]-2 g[x] g'[x] Derivative[3][f][x]-g[x]^2 Derivative[4][f][x]

HomotopyIntegrator[exampleExpression[1], x]

Example 2 inverts a two-dimensional divergence.

exampleExpression[2]=((Derivative[1, 0][u][s, t])^2)+2 v[s, t] Derivative[0, 4][u][s, t] Derivative[1, 0][v][s, t]-3 (Sqrt[2]) alpha ((Derivative[1, 0][u][s, t])^2) Derivative[1, 1][u][s, t]-Sin[u[s, t]] Derivative[0, 1][u][s, t] Derivative[1, 1][v][s, t]+Cos[u[s, t]] Derivative[1, 2][v][s, t]+v[s, t]^2 Derivative[1, 4][u][s, t]+u[s, t] Derivative[2, 0][u][s, t]

HomotopyIntegrator[exampleExpression[2], {s, t}]

Example 3 inverts a three-dimensional divergence.

exampleExpression[3]=-((2 Derivative[0, 0, 1][v][x, y, z] Derivative[0, 1, 0][u][x, y, z])/(u[x, y, z]^3))+((Derivative[0, 1, 1][v][x, y, z])/(u[x, y, z]^2))+Derivative[1, 0, 0][u][x, y, z]+2 (v[x, y, z]-Derivative[1, 0, 1][u][x, y, z]) (Derivative[0, 0, 1][v][x, y, z]-Derivative[1, 0, 2][u][x, y, z])-2 Derivative[1, 1, 0][v][x, y, z] Derivative[2, 1, 0][v][x, y, z]

HomotopyIntegrator[exampleExpression[3], {x, y, z},  
      Verbose -> True]

Example 4 evaluates parameters, then returns values with will make the expression integrable. If the user chooses to use the suggested values, the expression is integrated.

exampleExpression[4] = 2 ((u'[x])^2) u''[x]+2 u[x] ((u''[x])^2)+alpha u'[x] Derivative[3][u][x]+2 u[x] u'[x] Derivative[3][u][x]+beta u''[x] Derivative[3][u][x]-3 u[x] Derivative[4][u][x]

HomotopyIntegrator[exampleExpression[4], x]

HomotopyIntegrator[exampleExpression[4], x, {alpha, beta}]

Options[HomotopyIntegrator]