Re: {mg4091] ODE
- To: mathgroup at smc.vnet.net
- Subject: [mg4154] Re: {mg4091] ODE
- From: hagai at helix.nih.gov (Hagai Agmon-Snir)
- Date: Sat, 8 Jun 1996 13:23:30 -0400
- Sender: owner-wri-mathgroup at wolfram.com
At 1:16 4/6/96, Robert Zimmerman wrote: > While lectureing with Mathematica I noticed that the following ODE >does not return the correct initial conditions. > Is this an error or standard procedure? > > eq1= { x y'[x]+(x+2) y[x]==2 Exp[-x], y[0]==y0}; > > sol= y[x]/.(eq1// DSolve[#,y[x] ,x]&//Flatten) > > > sol/.x->0 (*Should equal to y0 and not 1*) > >Out[64]= E^(-x) >Out[67]= 1 (*Should equal to y0 and not 1*) In[19]:= gensol=DSolve[x y'[x]+(x+2) y[x]==2 Exp[-x],y[x],x] Out[19]= -x -x - 2 Log[x] {{y[x] -> E + E C[1]}} At x=0, y[0] is infinity or -infinity, unless C[1]=0. I suppose that Mathematica assumes that y0 is finite (initial conditions that you write should be finite). Then Mathematica is correct about its answer. Hagai >>>>>>>>>>>>>>>>>> ================================ <<<<<<<<<<<<<<<<< Hagai Agmon-Snir Tel: (301) 496-9972 (301) 496-4325 Surface mail: Fax: (301) 402-0535 Mathematical Research Branch, NIDDK 9190 Rockville Pike - Suite 350 Bethesda, MD 20814-3800 USA E-mail: hagai at helix.nih.gov WWW: http://mrb.niddk.nih.gov/hagai <<<<<<<<<<<<<<<<< ================================ >>>>>>>>>>>>>>>>>> ==== [MESSAGE SEPARATOR] ====