Group Abstract Group Abstract

Message Boards Message Boards

1
|
9.2K Views
|
7 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How entering the following differential equation in mathematica

Posted 11 years ago

Hello to all, my doubts I have is like entering the following differential equation in mathematica, I already is that I use the DSolve command but I do not understand how enter dx, thanks in advance. Here is the equation

(5x + 4y) dx +(4x + 8y^3) dy =0

POSTED BY: Luis Ledesma
7 Replies
Posted 11 years ago

Many thanks Udo,for helping me and patience to explain,thanks again

POSTED BY: Luis Ledesma
Posted 11 years ago
POSTED BY: Luis Ledesma

Hi Luis, just take a step back and consider $x$ and $y$ as independent variables (i.e. not $y=y(x)$). Then search for a new function $f=f(x,y)$, the so-called potential function with the property that the total differential of $f$ gives the differential equation back: $\begin{equation}df=\frac{\partial f}{\partial x} dx+\frac{\partial f}{\partial y} dy = (5x+4y)dx+(4x-8y^3)dy\end{equation}=0$. To do this one solves a partial differential equation system for $f$ in $x$ and $y$

In[1]:= DSolve[{D[f[x, y], x] == 5 x + 4 y, D[f[x , y], y] == 4 x - 8 y^3}, f, {x, y}]
Out[1]= {{f -> Function[{x, y}, (5 x^2)/2 + 4 x y - 2 y^4 + C[1]]}}

which gives clearly your lecturer's solution.

The constant C[1] does not matter, because it disappears under the total differential of $f$.

POSTED BY: Udo Krause
Posted 11 years ago

Hello again, I am still having problems with Mathematica to solve my differential equation, the problem is that I get a solution very complex and long, on the other hand, the solution that i get to do this by hand is shorter, my question is, i'm very bad in the version made by hand, or i am inserting bad parameters in Mathematica, i hope someone can give me clarify these points, greetings to all of the communitysteps for the solution

POSTED BY: Luis Ledesma

My Spanish is zero, but the ordinary differential equation is exact. Your lecturer did not solve for $y(x)$ but for the potential function $f(x,y)$. The ordinary differential equation is the total differential of $f$:

In[4]:= (D[#, x] DifferentialD[x] + D[#, y] DifferentialD[y]) &[5 x^2/2 + 4 x y - 2 y^4]
Out[4]= (5 x + 4 y) \[DifferentialD]x + (4 x - 8 y^3) \[DifferentialD]y

Please note that differentiation for $x$ did not produce terms $\frac{dy}{dx}$. By the way, you committed a mistake citing it as

(5x + 4y) dx +(4x + 8y^3) dy =0

POSTED BY: Udo Krause
Posted 11 years ago

Thank you very much Nasser by your very detailed explanation, the second option is my case ,where x is the independent variable, is just what i needed. Thanks again.

POSTED BY: Luis Ledesma

(5x + 4y) dx +(4x + 8y^3) dy =0

If you divide by $dy$ it becomes $(5 x(y) + 4 y) \frac{dx}{dy}+(4 x(y)+ 8 y^3) = 0$. So the dependent variable is $x$ and the independent variable is $y$, hence

ode = (5 x[y] + 4 y) x'[y] + (4 x[y] + 8 y^3) == 0;
DSolve[ode, x[y], y]

enter image description here

If $y$ was the dependent variable and $x$ is the independent variable, then dividing by $dx$ gives the ode $(5 x + 4 y(x))+(4 x+ 8 y^3(x)) \frac{dy}{dx} = 0$ and now you write

ode = (5 x + 4 y[x]) + (4 x + 8 y[x]^3) y'[x] == 0;
DSolve[ode, y[x], x]
POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard