> # Written by Doug Hensley # # Show that the equation # dy x^2 # -- = ------- # dx 1 - y^2 # is separable, and then find an equation for its integral curves. # -------------------------------------------------------------------------------- > with(DEtools); [DEplot, DEplot1, DEplot2, Dchangevar, PDEplot, dfieldplot, phaseportrait] -------------------------------------------------------------------------------- > DEplot1(diff(y(x),x)=x^2/(1-y^2),[x,y],x=-4..4,{[0,-2],[0,-1],[0,-1/2],[0,0],[0,1/2],[0,1],[0,2]},y=-4..4); -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- # # Well! What are we to make of this? It's certainly an unlikely curve to be the solution # to a DE. # > ?DEplot1 -------------------------------------------------------------------------------- > ?DEtools[options] -------------------------------------------------------------------------------- > DEplot1(diff(y(x),x)=x^2/(1-y^2),[x,y],x=-4..4,{[0,-2],[0,-1],[0,-1/2],[0,0],[0,1/2],[0,1],[0,2]},y=-4..4,grid=[50,50],limitrange=true); -------------------------------------------------------------------------------- # # Going to higher resolution doesn't help much. Let's go to abstract thinking. # ************************************************** # OK. What do you see? # There's a division by zero sitting in the DE when y=1 or y=-1. The numerical solver # in Maple cannot cope with this. Perhaps the symbolic solver will do better? # > curve0=dsolve({diff(y(x),x)=x^2/(1-y(x)^2),y(0)=0},y(x)); / 1/3 1 1/2 / 1/3 1 \\ curve0 = |y(x) = - 1/2 %1 - ------- - 1/2 I 3 |%1 - -----|| | 1/3 | 1/3|| \ 2 %1 \ %1 // 3 6 1/2 %1 := - 1/2 x + 1/2 (- 4 + x ) # Perhaps without the %1 shortcut > interface(labelling=false);\ curve0=dsolve({diff(y(x),x)=x^2/(1-y(x)^2),y(0)=0},y(x));\ interface(labelling=true); / 1/3 1 1/2 / 1/3 1 \\ curve0 = |y(x) = - 1/2 %1 - ------- - 1/2 I 3 |%1 - -----|| | 1/3 | 1/3|| \ 2 %1 \ %1 // 3 6 1/2 %1 := - 1/2 x + 1/2 (- 4 + x ) # -------------------------------------------------------------------------------- # # Maybe not. This is perhaps correct, but it's hardly enlightening. # ********************************************** # OK. We're going to have to think. Let's do this one by hand. # ********************************************** # # y'=x^2/(1-y^2) --> (1-y^2) dy=x^2 --> y-y^3/3=x^3/3+C. # # Upshot: the solution curves are given implicitly by y-y^3/3=x^3/3. > with(plots); [animate, animate3d, conformal, contourplot, cylinderplot, densityplot, display, display3d, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, loglogplot, logplot, matrixplot, odeplot, pointplot, polarplot, polygonplot, polygonplot3d, polyhedraplot, replot, setoptions, setoptions3d, spacecurve, sparsematrixplot, sphereplot, surfdata, textplot, textplot3d, tubeplot] -------------------------------------------------------------------------------- > contourplot(y-y^3/3-x^3/3,x=-4..4,y=-4..4); # # So here we have curves that match the pretty pictures in Boyce and DiPrima. It # should be kept in mind, though, that a solution to a DE is a FUNCTION defined on # an INTERVAL. Whenever these curves cross the lines y=1 or -1, they cease to be # solutions. The slope becomes infinite, and as the curve doubles back on itself, it # violates the definition of a function: ONE x VALUE leads to ONE y VALUE. # -------------------------------------------------------------------------------- >