# dsolve2 is meant to return the function produced by solving an # ode. Here is an example: # # de := {diff(y(x),x) = 1, y(0) = 1}; # f := dsolve2( de ); # the solution is f(x) = x + 1 # f(0) = 1; # # Here is the definition: dsolve2 := proc( de ) local expr; fexpr := de[2]; # first part of de is the ode, second part is init cond. fexpr := op(1,fexpr); fexpr := op(1,fexpr); # now we have the functional expr, e.g y(x) var := op(1,fexpr); # this gives the variable, e.g., x, needed by unapply unapply( rhs( dsolve( de, fexpr )), var ); end; # dsolve2 := (de, expr, var) -> unapply( rhs( dsolve( de, expr )), var );