> with(DEtools); [DEnormal, DEplot, DEplot3d, Dchangevar, PDEchangecoords, PDEplot, autonomous, convertAlg, convertsys, dfieldplot, indicialeq, phaseportrait, reduceOrder, regularsp, translate, untranslate, varparam] > dsolve({sin(x)*diff(y(x),x)+y*cos(x)=x*sin(x),y(Pi/2)=2},y(x)); -sin(x) + x cos(x) - 1 y(x) = - ---------------------- sin(x) > dsolve({diff(y(x),x)+y*cos(x)/sin(x)=x,y(Pi/2)=2},y(x)); -sin(x) + x cos(x) - 1 y(x) = - ---------------------- sin(x) > yofx:=rhs("); -sin(x) + x cos(x) - 1 yofx := - ---------------------- sin(x) > plot(yofx,x=1/2..5/2); # Why not plot it from 0 to 10? Because there is a singularity in the # original differential equation corresponding to x=0 or x=Pi, and there # is also a singularity in the solution, division by zero, at those # values of x. So a prudent plot command will stand back from those # points. # # Now let's see what happens when we call upon DEplot to give us some # more insight. > DEplot(diff(y(x),x)+y*cos(x)/sin(x)=x,y(x),x=1/4..3,y=0..4); # What?! This is nothing like the down-then-up behavior of the formal # solution. > DEplot(diff(y(x),x)+y*cos(x)/sin(x)=x,y(x),x=1/4..3,[[y(Pi/2)=2]],y=0. > .4); # The solution does not run parallel to the arrows of the direction # field here, either. # # This simply cannot be right. Your OWN insight must tell you that this # is wrong. > ?DEplot # It seems that although the form in which we've been stating the task # does not provoke outright rebellion from the machine, it provokes the # subtler and more dangerous false compliance. That is, you get a plot # but it's wrong. > DEplot(diff(y(x),x)=-y*cos(x)/sin(x)+x,y(x),x=1/4..3,[[y(Pi/2)=2]],y=0 > ..4); # Ah, that's much better. # # "STANDARD FORM" for DEplot, requires that the differential equation be # put in the form # # diff(y(x),x)=formula in terms of x and y. # # This is a different standard form, than the form we use to work with # first order linear differential equations, for instance.