Mathematica Solutions for First Order Differential Equation

  • Thread starter Thread starter pat666
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Homework Help Overview

The discussion revolves around solving a first-order differential equation given by (2xy-5)dx+(x^2+y^2)dy=0 with the initial condition y(3)=1. The original poster expresses confusion regarding the output from Mathematica compared to their own hand-solved solution.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to verify their hand-solved solution against Mathematica's output, questioning the correctness of their code and the software's response. Other participants discuss the validity of the initial condition and the nature of the solutions provided by Mathematica.

Discussion Status

Participants have provided some guidance on verifying the correctness of the original poster's solution and have noted that Mathematica's output appears to be valid. There is ongoing exploration of the differences between implicit and explicit solutions, as well as the behavior of Mathematica in this context.

Contextual Notes

There are mentions of potential discrepancies in the output of Mathematica regarding the initial condition and the nature of the solutions, including the presence of arbitrary constants in the results. The discussion reflects uncertainty about the expected output format from Mathematica.

pat666
Messages
703
Reaction score
0
Mathematica Disagrees with ME!

Homework Statement


(2xy-5)dx+(x^2+y^2)dy=0 y(3)=1


Homework Equations





The Attempt at a Solution


Ive solved this by hand and now where required to get Mathematica to solve to.
My solution: [tex]-17/3=x^2y-5x+y^3/3[/tex]
I've attached what mathematica has done. Now the question
Am I wrong ?
Is my code wrong?
Is mathematica wrong?

Thanks

P.S I rearranged to this form to sick in mathematica:
dy/dx=(-2xy+5)/(x^2+y^2)
 

Attachments

  • mathematica.png
    mathematica.png
    38.5 KB · Views: 510
Physics news on Phys.org


Your thumbnail is too small for me to be able to read. In any case, your work is correct. You can verify it by doing two things:
1) Checking that the initial condition is satisfied; i.e., that when x = 3 and y = 1, then x2y - 5x + y3/3 = -17/3 is a true statement.
2) Differentiating the equation x2y - 5x + y3/3 = -17/3 implicitly to arrive at the differential equation dy/dx = (5 - 2xy)/(x2 + y2).

Checking a solution to a differential equation is something you should do as a matter of course. You've already done all the hard work. It's only a little more work to verify that your work is correct.
 


good to know that I did it right by hand, do you know the correct mathematica code so that it will do it.

Thanks
 


No. I don't have mathematica.
 


That mathematica output looks correct. The cubic in y has been factored, what kind of output were you expecting?
 


one the same as mine---- is that not possible here?
 


pat666 said:

Homework Statement


(2xy-5)dx+(x^2+y^2)dy=0 y(3)=1


Homework Equations





The Attempt at a Solution


Ive solved this by hand and now where required to get Mathematica to solve to.
My solution: [tex]-17/3=x^2y-5x+y^3/3[/tex]
I've attached what mathematica has done. Now the question
Am I wrong ?
Is my code wrong?
Is mathematica wrong?

Thanks

P.S I rearranged to this form to sick in mathematica:
dy/dx=(-2xy+5)/(x^2+y^2)

Mathematica did a little more work than you did.

What you have is a third order equation of y.
Mathematica solved it to be of the form y = f(x).
I haven't checked it, but it looks about right: 1 real solution and 2 imaginary ones.
Presumably you can rewrite the first solution to match your solution.

I'm not a Mathematica specialist, but I suspect it is not equipped to output the kind of solution you gave.
 


pat666: your solution from sec. 3 of the OP does not satisfy the initial condition y(3)=1
 
  • #10


pat666: Delete previous post. The initial condition is satisfied.
 
  • #11


At least with the version of Mathematica I'm using, I believe it returns exactly the same result with or without the initial condition y(3)=1, containing an arbitrary constant denoted by C[1] by Mathematica. That is odd. If I'm not mistaken then usually with a first order differential equation and a single initial condition it is sufficient to eliminate the arbitrary constants. And I've never seen another differential equation behave like this when given to DSolve, but I obviously haven't seen everything DSolve can do. As others have pointed out, you found an implicit solution for y(x) where Mathematica factored the cubic to find three explicit solutions. Two of those when I attempt to solve for C[1] using your initial condition have no solution. The third does does satisfy your differential equation and your initial condition, so it isn't clear why Mathematica didn't return only that solution with arbitrary constant solved for. If I experiment with changing your initial condition I can provoke error messages in some cases and get it to return a single solution with no arbitrary constant in some others. I don't know what it is about your example that makes it do this. And I have no answer for your final question, how to turn an explicit solution into the implicit form that you found by hand.
 

Similar threads

Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
3
Views
2K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K