Re: New to mathematica: Question about solving differential eqs
- To: mathgroup at smc.vnet.net
- Subject: [mg74675] Re: New to mathematica: Question about solving differential eqs
- From: Roger Bagula <rlbagula at sbcglobal.net>
- Date: Sat, 31 Mar 2007 01:27:14 -0500 (EST)
- References: <euig8p$otm$1@smc.vnet.net>
traz wrote: >Whenever I try to solve differential equations in mathematica, I get a solution with an imaginary part different from the solution in a text book. For example: > >DSolve[{y'[x] == y[x] + y[x]^3}, y, x] > >will give me a solution that has an imaginary part and not the one I expect here from the text book: > >{+(Ce^(-2x)-1)^(-1/2), -(Ce^(-2x)-1)^(-1/2)} > >Can anyone give me a tip on how to do this? Also does anyone know of an online tuttorial that goes into details a little bit? > > > dy/dx=y+y^3 rearranging: dx=dy/(y+y^3) Solving for x in terms of y ( instead of y in terms of x): x=Integrate[1/(y + y^3), {y, a, ya}] You'll see that give two alternative solutions for the variable x which are dependent on the actual value of y. If you chose the one solution: x=-(2*Log[a]-Log[1+a^2]-2*Log[y]+Log[1+y^2])/2 Solve[x == -(2*Log[a] - Log[1 + a^2] - 2*Log[y] + Log[1 + y^2])/2, y] gives the answers that I think you are looking for. The two solutions seem to be the same depending on the values of the constants.