I do not think the current API for dsolve when asking for series solution is done right. If one wants to obtain a series solution for an ODE, but wants different order than the default 6, now one must set this value using a global setting before making the call, like this:

eq:=diff(y(x),x$2)+y(x)=0;
Order:=10;
dsolve({eq,y(0)=1,D(y)(0)=0},y(x),type='series');

It would be better if options to calls are passed along with the other parameters in the call itself. Something like

dsolve({eq,y(0)=1,D(y)(0)=0},y(x),type='series',order=10);

This should also apply to any command that takes Order, such as series(cos(x),x=0,order=10);

Passing options and values to functions using global and environment variables is not safe and not a good way to go about it as it can cause programming errors.


Please Wait...