Solving a differential equation.

Hello,

I entered this differential equation into Wolfram Alpha but I do not get a response:

y’ = m - fyexp(-2d/c)exp(m(x^2)/c) - gxexp(-2d/c)*exp(m(x^2)/c)

Wolfram Alpha rewrites the equation but no more.
m,f,g,c are constants but d is a variable that y does not depend on. y is function of x though.

Nasty solution:

sol = DSolve[y'[x] == m - f*y[x]*Exp[-2 d/c]*Exp[m*x^2/c] - g*x*Exp[-2 d/c]*Exp[m*x^2/c], y[x], x]

MMA can’t integrating this equation.

Maple also can not.

Dear Peter,

There are several problems with the way you type the equation in, e.g. no spaces between variables/parameters etc. But even if you fix that, WolframAlpha does not seem to like this integral. Mathematica gives a solution:

DSolve[y'[x] == m - f y[x] Exp[-2 d/c] Exp[m (x^2)/c] - g x Exp[-2 d/c]*Exp[m (x^2)/c], y[x], x] 

As you see the solution still contains an integral and you will have to be more concrete to get a (perhaps numerical?) solution, such as

DSolve[y'[x] == m - f y[x] Exp[-2 d/c] Exp[m (x^2)/c] - g x Exp[-2 d/c]*Exp[m (x^2)/c] /. {m -> -1, c -> 1, g -> 1 , d -> 1, f -> 1}, y[x], x]
(*{{y[x] -> -x + E^(-((Sqrt[\[Pi]] Erf[x])/(2 E^2))) C[1]}}*)

If you do not have access to Mathematica, I would suggest using a free tier of the Wolfram Cloud, which solves the integral as well.

Cheers,

Marco

PS: Sorry Mariusz for the double posting, I must have been typing when you posted your reply.

Ok.Your answer is much better than mine.

Cheers,

Mariusz.

Hello Mariusz,

Many thanks. It will take a little time for me to digest all this. Can I ask what MMA is?

Take care,

Peter.
Templeogue
Dublin 6W

Hello Peter,

MMA is the abbreviated name of the Mathematica.

People use this shortcut in this Forum

Cheers,
Mariusz.
[1]: http://mathematica.stackexchange.com/

Hello Mariusz,

Many thanks. You can understand now that I have not one but two solutions I’m a little bit worried about which one is the correct one. I will write them out and try to see if I can interpret them. I have a very good idea of what I’m looking for and the correct solution should behave in a certain way that makes physical sense.

Take care and all the best,

Peter.

Hello Mariusz,

I tried inputing an approximate form of the original equation:

y’ = a*(1 - (2k/c)(y + ax))(1 -(2/c)(d - (a*(x^2)/2))

but I still do not get a solution.

Take care,

Peter.

Hello Marco,

I tried inputing an approximate form of the original equation:

y’ = a*(1 - (2k/c)(y + ax))(1 -(2/c)(d - (a*(x^2)/2))

but I still do not get a solution.

Take care,

Peter.

Dear Peter,

no need to double post the question to me and to Mariusz. There are some problems with the way you type in your equations. First of all, the parenthesis do not match up. I suppose there is one missing at the end. Also, Mathematica/WoflramAlpha would probably need to know what the independent variable is (it could be “a”, i.e. y could be a function of a, for example). Also, if you type ax instead of a x the Wolfram Language will take that to be the name of a variable not the product of “a” and “x”.

Even if you fix this, WolframAlpha does not provide a solution. Mathematica and the online products, however, do give you a solution:

DSolve[y'[x] == a (1 - (2 k/c) (y[x] + a x)) (1 - (2/c) (d - (a (x^2)/2))), y[x], x]

gives

I would consider moving over to the WolframCloud for this kind of application.

Best wishes,

Marco

Hello Marco,

I will heed your comments and many thanks. I’m finding it hard to attach physical meaning to this solution. Let me look into subscribing to MMA.
I’m sorry about that missing parenthesis.

Take care,

Peter.

Hello Peter,

I was able to somewhat simplify the equation,besides two of the same integrals.

Cheers, Mariusz

Hello Mariusz,

Many thanks. I had already downloaded and installed Wolfram CDF Player so I was able to open the attachment you sent me. Many thanks. I’m a bit taken aback by how complicated the answer is. The answer should be simpler. It’s difficult to attach physical significance to the answer. In the limit as x approaches infinity y should just reduce to “c” but I don’t see that happening.

Take care,

Peter.