Solving a linear autonomous ODE

Hello;

What is the recommended way to solve a linear autonomous ODE’s in Mathematica?

I am familiar with solving non-autonomous ODE which is pretty simple using the DSolve command. You just place the independent variable immediately after the dependent variable, enclosing it in brackets, where ever it appears in the equation. However, with an autonomous ODE the independent variable is different on both sides of the equal sign, which makes me question even being able to use the DSolve[] function to solve the equation. Additionally, the dependent variable on the left hand side of the equal sign is the independent variable on the right hand side of the equation which further complicates finding a Mathematica solution.

I have reviewed all my documentation and have been unable to locate the answer, so any help would be greatly appreciated.

Thanks,

Mitch Sandlin

Can you give an example?

Please see attached notebook, and thanks so much for helping. The last time I worked with autonomous ODE’s, I found them somewhat difficult and was hoping to get some help using the power of Mathematica at least to check my work.

Mitch Sandlin

AutonomousQuestion.nb (3.31 KB)

You make the independent variable t explicit, while the dependent variable is a function:

DSolve[x'[t] == k*x[t] (M - x[t]), x, t]

Thanks, but it seems like you are treating the autonomous equation exactly as if it is a non-autonomous equation, which does not give the correct answer that can be verified by plugging your answer back into the original equation. Granted, you can plug t in as the independent variable of x, but that is not correct because in an autonomous equation x is an independent variable of f as in f [x]. Additionally, I don’t believe that you can even solve an autonomous equation using the DSolve function. You may be able to solve the autonomous equation with an NDSolve function but I am not sure exactly how to set-up the function with an autonomous equation.

It seems perfectly correct to me:

In[7]:= eq = (x'[t] == k*x[t] (M - x[t]));
sol = DSolve[eq, x, t];
Simplify[eq /. sol]

Out[9]= {True}

I view t as the independent variable (even if it is frequently omitted from the notation), and x as a dependent variable.

Hi Gianluca;

The problem is that t cannot be viewed as the independent variable because it is not. In an autonomous ODE, the x on the right hand side of the equation is the independent variable, and that is why it is more difficult to solve autonomous ODE than it is non-autonomous ODE.

The examples that I sent you were from the text book: Elementary Differential Equations with boundary value problems - Sixth Edition by C. Henry Edwards and David E. Penny, Page 481. The text also give solutions to the examples that I sent which do not match the DSolve[] solutions that use t as an independent variable.

Again, these autonomous ODE’s need to be solved using different techniques than non-autonomous ODE’s much like you need to use different techniques to solve explicit and implicit differential equations.

Thanks again,

Mitch Sandlin

The solutions from the textbook are in the form x = expression containing t, right?

Hi Gianluca;

Please see the attached notebook for the solution. For comparison, I also included the solution from the DSolve function.

I really appreciate your effort on this.

AutonomousQuestion2.nb (4.37 KB)

Mitchell,

The answers are the same. The difference is you did not ask Mathematica to solve for the initial condition.

Type:

DSolve[{x'[t] == k*x[t] (M - x[t]), x[0] == x0}, x, t]

and you get the same answer for both.

Regards

Neil

Your textbook solution is a function of t. The differential equation omits t in the right-hand side, but when you solve it you must think x as a function of t. When you apply the separation of variables method, you often express t as a function of x, but that is an intermediate step, not the goal.

Hi Gianluca;

I have done quite a bit of research today and believe that you are exactly right.

Thanks so much for your help,

Mitchell Sandlin

Hi Neil;

Thanks so much for your input.

Mitchell Sandlin