MathGroup Archive 2010

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

Search the Archive

Re: Wrong ODE solution in Mathematica 7?

Remember that the constants are arbitrary and so it is possible to obtain
different looking forms depending on how you pick the constants.

DSolve[y''[x] == -Cos[x]/(1 + Sin[x])^2, y, x][[1, 1]]; 
y[x_] = y[x] /. % 

C[1] + x C[2] + (2 Sin[x/2])/(Cos[x/2] + Sin[x/2])

Check the solution:

y''[x] == -Cos[x]/(1 + Sin[x])^2 // Simplify 

Here is your second solution:

y2[x_] = C[1] + C[2] x - 2/(Tan[x/2] + 1); 

Check it:

y2''[x] == -Cos[x]/(1 + Sin[x])^2 // Simplify 

Add the constant 2, which could be absorbed into C[1], to the y2 solution
and see if it is equal to the y solution:

y2[x] + 2 == y[x] // Simplify 

How did I figure out how to add 2? By plotting and trying various constants.
Start out with zero and you can see that you need to shift the second curve

Plot[{(2 Sin[x/2])/(
  Cos[x/2] + Sin[x/2]), -(2/(Tan[x/2] + 1)) + 2}, {x, -2 \[Pi], 
  2 \[Pi]}] 

David Park
djmpark at  

From: Zsolt [mailto:phyhari at] 

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: Re: algebraic numbers
  • Next by Date: Re: Combining data from indexed lists efficiently
  • Previous by thread: Re: Wrong ODE solution in Mathematica 7?
  • Next by thread: "more kernels than you are licensed"