# Solving a differential equation.

**URL:** <https://community.wolfram.com/t/solving-a-differential-equation/7420>\
**Category:** Questions\
**Tags:** wolfram-alpha, equation-solving\
**Created:** [December 9, 2015, 11:27am UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420 "2015-12-09T11:27:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 9, 2015, 11:27am UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/1 "2015-12-09T11:27:14Z")

</div>

Hello,

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

y’ = m - f_y_exp(-2d/c)_exp(m_(x^2)/c) - g_x_exp(-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.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [December 9, 2015, 12:08pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/2 "2015-12-09T12:08:51Z")

</div>

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]

```

 ![rtrt.png](https://global.discourse-cdn.com/wolfram/original/3X/e/6/e64d510c357e8aff6d41b64c9bbe2867ab7c3977.png)

MMA can’t integrating this equation.

 ![ty.png](https://global.discourse-cdn.com/wolfram/original/2X/8/86acfde00d4c0c1c073b89e10a2af7edbe052303.png)

Maple also can not.

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [December 9, 2015, 12:11pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/3 "2015-12-09T12:11:33Z")

</div>

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] 

```

 ![ScreenShot2015-12-09at12.06.11.png](https://global.discourse-cdn.com/wolfram/original/3X/6/9/692b7e2d178baa5582c0dfb0fce83ec7b283e9ac.png)

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.

 ![ScreenShot2015-12-09at12.10.49.png](https://global.discourse-cdn.com/wolfram/original/3X/0/0/001cb4cb629554a0d6126db8e44f17977fd69344.png)

Cheers,

Marco

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

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 9, 2015, 12:31pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/4 "2015-12-09T12:31:19Z")

</div>

Ok.Your answer is much better than mine.

Cheers,

Mariusz.

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 9, 2015, 12:31pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/5 "2015-12-09T12:31:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [December 9, 2015, 12:47pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/6 "2015-12-09T12:47:03Z")

</div>

Hello Peter,

MMA is the abbreviated name of the Mathematica.

People use this shortcut in this [Forum](http://mathematica.stackexchange.com/)

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

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 9, 2015, 4:22pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/7 "2015-12-09T16:22:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 10, 2015, 12:52pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/8 "2015-12-10T12:52:05Z")

</div>

Hello Mariusz,

I tried inputing an approximate form of the original equation:

y = a\*(1 - (2k/c)_(y + a_x))_(1 -(2/c)_(d - (a\*(x^2)/2))

but I still do not get a solution.

Take care,

Peter.

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 10, 2015, 12:54pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/9 "2015-12-10T12:54:32Z")

</div>

Hello Marco,

I tried inputing an approximate form of the original equation:

y = a\*(1 - (2k/c)_(y + a_x))_(1 -(2/c)_(d - (a\*(x^2)/2))

but I still do not get a solution.

Take care,

Peter.

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [December 10, 2015, 3:25pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/10 "2015-12-10T15:25:05Z")

</div>

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

 ![ScreenShot2015-12-10at15.22.27.png](https://global.discourse-cdn.com/wolfram/original/1X/91a1d59a6697528681434e10f36bd9a4e6852346.png)

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

Best wishes,

Marco

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 10, 2015, 4:09pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/11 "2015-12-10T16:09:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [December 10, 2015, 6:29pm UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/12 "2015-12-10T18:29:39Z")

</div>

Hello Peter,

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

 ![tttt.png](https://global.discourse-cdn.com/wolfram/original/3X/d/0/d066dbf4fdf5d4626e1d4aaa079d65212867eeb2.png)

Cheers, Mariusz

---

<div class="post-metadata">

**Author:** ![peternolan40](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/peternolan40/32/36574_2.png) [@peternolan40](https://community.wolfram.com/u/peternolan40)\
**Post date:** [December 11, 2015, 6:26am UTC](https://community.wolfram.com/t/solving-a-differential-equation/7420/13 "2015-12-11T06:26:37Z")

</div>

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.
