Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to NDSolve the differential equation

  • To: mathgroup at
  • Subject: [mg19638] Re: How to NDSolve the differential equation
  • From: Paul Abbott <paul at>
  • Date: Tue, 7 Sep 1999 00:28:35 -0400
  • Organization: University of Western Australia
  • References: <7qulo3$>
  • Sender: owner-wri-mathgroup at

Chee Lim Cheung wrote:

> I encountered error messages with the tag Power::infy when I tried to do
> the following:
> NDSolve[{x y''[x] + Sin[x] y'[x] + 2 x y[x] == 0,y[0]==0, y'[0]==1}, y,
> {x,0,2}]
> Can anyone help me in getting Mathematica to produce an answer? I am using
> Mathematica 4.0 & Mathematica 3.0.

The error message gives a hint as to the problem -- and the solution. If you
through by x and replace Sin[x]/x with 1 if x ==0, then NDSolve works fine:

  NDSolve[{2 y[x] + If[x == 0, 1, Sin[x]/x] y'[x] + y''[x] == 0,
   y[0] == 0, y'[0] == 1}, y, {x, 0, 2}]

Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia
Nedlands WA  6907                     mailto:paul at

            God IS a weakly left-handed dice player

  • Prev by Date: Re: Re: Langford's Problem (another solution improved)
  • Next by Date: Re: Problem with the zero-term of Fourier[]
  • Previous by thread: Re: Re: How to NDSolve the differential equation
  • Next by thread: Re: How to NDSolve the differential equation