MathGroup Archive 2010

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

Search the Archive

Re: Wrong ODE solution in Mathematica 7?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106227] Re: [mg106177] Wrong ODE solution in Mathematica 7?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 5 Jan 2010 01:48:40 -0500 (EST)
  • Reply-to: hanlonr at cox.net

The arbitrary constants between the two are different.

eqn = D[y[x], x, x] == -Cos[x]/(1 + Sin[x])^2;

soln1 = DSolve[eqn, y[x], x][[1, 1]]

y[x] -> C[2]*x + C[1] + (2*Sin[x/2])/(Sin[x/2] + Cos[x/2])

D[y[x] /. soln1, x, x] == (eqn // Last) // Simplify

True

The solution satisfies the equation.

soln2 = (y[x] -> -2/(Tan[(1/2)*x] + 1) + C[4]*x + C[3]);

Series[Evaluate[y[x] /. soln1], {x, 0, 1}] // Normal

(C[2] + 1)*x + C[1]

Series[Evaluate[y[x] /. soln2], {x, 0, 1}] // Normal

(C[4] + 1)*x + C[3] - 2

(y[x] /. soln1) == (y[x] /. soln2 /.
    {C[3] -> C[1] + 2, 
     C[4] -> C[2]}) // Simplify

True

The solutions are equivalent.


Bob Hanlon

---- Zsolt <phyhari at gmail.com> wrote: 

=============
Hi!
I tried solve the ODE:
DSolve[D[y[x], x, x] == -Cos[x]/(1 + Sin[x])^2, y[x], x]

The solution what M7 (and Wolfram Alpha) gives is:
y[x] -> C[1] + x C[2] + (2 Sin[x/2])/(Cos[x/2] + Sin[x/2])

I think, it's wrong! (Does anybody know how to check?) Another system gives
for the same diff.eq:
y(x) = -2/(tan((1/2)*x)+1)+_C1*x+_C2
(similar, but not the same->ctan vs tan...)
I found the problem in one of my math books, and the solution there
concours with the other system.
How can I trust Mathematica, if it makes mistakes in such simple
things?? :(
Thank you for your answer! :)





  • Prev by Date: Re: Export Dynamic Matrix to XLS
  • Next by Date: Re: bar chart ticks not placed well?
  • Previous by thread: Re: Wrong ODE solution in Mathematica 7?
  • Next by thread: Re: Wrong ODE solution in Mathematica 7?