% matlab demo to illustrate the use of Maple's dsolve to obtain analytical
% solutions to ODEs
% we also illustrate the dramatic effect on the analytical solution to
% small changes in the problem

clear all
close all

% find a symbolic solution to y' = y^2
y = dsolve('Dy = y^2')
% comments: C1 is an arbitrary constant
%           Nice insight into the behaviour of solutions

% slightly change the ODE to y' = y^2 + 1
y = dsolve('Dy = y^2+1')
% comments: Solution given in terms of a special function
%           (at least it is a familiar one!)

% another slight change: y' = y^2 + t
y = dsolve('Dy = y^2+t')
% comments: Solution given in terms of (the not-so-familiar) Airy functions

% yet another slight change: y' = y^2 + t^2
y = dsolve('Dy = y^2+t^2')
% comments: Solution given in terms of Bessel functions of fractional order

% finally, solve y' = y^3 + t^2
y = dsolve('Dy = y^3+t^2')
% comments: No analytical solution could be found