text: Search All of the Math Forum:
  
  Views expressed in these public forums are not endorsed by NCTM or The Math Forum.
  
  Topic: f'[0]=0.5 is True?
  Replies: 2   Last Post: Jul 23, 2013 4:43 AM
  
   Messages: [ Previous | Next ]
   Bob Hanlon Posts: 906 Registered: 10/29/11
  Re: f'[0]=0.5 is True?
  Posted: Jul 20, 2013 5:54 AM
  
  Try starting with a fresh kernel.
  
  Clear[f, x, sol];
  
  eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
  eqn1 = f[0] == 1;
  eqn2 = f'[0] == 0.5;
  
  sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
  
  (1.*(1.*Cos[Sqrt[29]*x] + 0.2785430072655778*
  Sin[Sqrt[29]*x]))/E^x
  
  sol[0]
  
  1.
  
  sol'[0]
  
  0.5
  
  Using exact numbers
  
  eqn2 = f'[0] == 1/2;
  
  sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
  
  ((1/58)*(58*Cos[Sqrt[29]*x] + 3*Sqrt[29]*
  Sin[Sqrt[29]*x]))/E^x
  
  sol[0]
  
  1
  
  sol'[0]
  
  1/2
  
  Bob Hanlon
  
  On Thu, Jul 18, 2013 at 3:00 AM, mariusz sapinski <
  mariusz.sapinski@gmail.com> wrote:
  
  > Dear All,
  >
  > I'm trying a simple exercise:
  >
  > eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
  > Clear[f];
  > Clear[x];
  > eqn1 = f[0] == 1;
  > eqn2 = f'[0] == 0.5;
  > DSolve[{eqn, eqn1, eqn2}, f[x], x]
  >
  >
  > and I get:
  > DSolve::deqn: Equation or list of equations expected instead of True in
  > the first argument {30 f[x]+2
  > (f^\[Prime])[x]+(f^\[Prime]\[Prime])[x]==0,f[0]==1,True}. >>
  >
  > so f'[0]=0.5 is True for Mathematica?
  >
  > How can it be?
  >
  > If I remove eqn2 from DSolve then I get a solution with a parameter of
  > course.
  >
  > Cheers,
  >
  > Mariusz
  >
  >
  
  Date Subject Author
  7/20/13 Bob Hanlon
  7/23/13 mariusz sapinski
explanation: The text is a discussion thread from a math forum, specifically about solving a differential equation with initial conditions in Mathematica. The original poster (Mariusz Sapinski) asks why Mathematica returns an error when one of the initial conditions is specified as `f'[0] == 0.5`. The responder (Bob Hanlon) provides a solution, demonstrating that the issue can be resolved by starting with a fresh kernel and using exact numbers instead of approximate ones.
  
  The text contains a question and an answer.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: Search All of the Math Forum:
  
  Views expressed in these public forums are not endorsed by NCTM or The Math Forum.
  
  Topic: f'[0]=0.5 is True?
  Replies: 2   Last Post: Jul 23, 2013 4:43 AM
  
   Messages: [ Previous | Next ]
   Bob Hanlon Posts: 906 Registered: 10/29/11
  Re: f'[0]=0.5 is True?
  Posted: Jul 20, 2013 5:54 AM
  
  Try starting with a fresh kernel.
  
  Clear[f, x, sol];
  
  eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
  eqn1 = f[0] == 1;
  eqn2 = f'[0] == 0.5;
  
  sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
  
  (1.*(1.*Cos[Sqrt[29]*x] + 0.2785430072655778*
  Sin[Sqrt[29]*x]))/E^x
  
  sol[0]
  
  1.
  
  sol'[0]
  
  0.5
  
  Using exact numbers
  
  eqn2 = f'[0] == 1/2;
  
  sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
  
  ((1/58)*(58*Cos[Sqrt[29]*x] + 3*Sqrt[29]*
  Sin[Sqrt[29]*x]))/E^x
  
  sol[0]
  
  1
  
  sol'[0]
  
  1/2
  
  Bob Hanlon
  
  On Thu, Jul 18, 2013 at 3:00 AM, mariusz sapinski <
  mariusz.sapinski@gmail.com> wrote:
  
  > Dear All,
  >
  > I'm trying a simple exercise:
  >
  > eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
  > Clear[f];
  > Clear[x];
  > eqn1 = f[0] == 1;
  > eqn2 = f'[0] == 0.5;
  > DSolve[{eqn, eqn1, eqn2}, f[x], x]
  >
  >
  > and I get:
  > DSolve::deqn: Equation or list of equations expected instead of True in
  > the first argument {30 f[x]+2
  > (f^\[Prime])[x]+(f^\[Prime]\[Prime])[x]==0,f[0]==1,True}. >>
  >
  > so f'[0]=0.5 is True for Mathematica?
  >
  > How can it be?
  >
  > If I remove eqn2 from DSolve then I get a solution with a parameter of
  > course.
  >
  > Cheers,
  >
  > Mariusz
  >
  >
  
  Date Subject Author
  7/20/13 Bob Hanlon
  7/23/13 mariusz sapinski
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The text is a discussion thread from a math forum, specifically about solving a differential equation with initial conditions in Mathematica. The original poster (Mariusz Sapinski) asks why Mathematica returns an error when one of the initial conditions is specified as `f'[0] == 0.5`. The responder (Bob Hanlon) provides a solution, demonstrating that the issue can be resolved by starting with a fresh kernel and using exact numbers instead of approximate ones.
  
  The text contains a question and an answer.
  
  Label: question-and-answer