1
|
6991 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# New user needs help with a differential equation

Posted 11 years ago
 Hello ppl,I'm newly using Mathematica for my master thesis at my university and I'm simply trying to guess how to solve this simple differential equation and Plot it! Please if you can help me I will appreciate it!  It is very difficult to study all my myself .   I'm not a genius after all :-/ (3*x^2*y+8*x*y^2)dx+(x^3+8*x^2*y+12*y^2)dy=0
8 Replies
Sort By:
Posted 11 years ago
 In thinking on this a little further, I would solve this on paper for the solution F[x,y] ==C, and then use CountourPlot to plot the family of curves associated with C, unless of course initial conditions provide a single value for C. This will allow mathematica to represent the solution set even though neither y nor x is one-to-one.
Posted 11 years ago
 Hi Dani,Then there are perhaps 2 ways to do this.1) Solve it manually for F=C , where this is the integral of the exact differential. (The fact that the exact differential = 0 implies it's integral is a constant.) Then plot a family of curves depending on C, perhps by solving for y.2) Solve the original equation for dy/dx=y' = f[x,y] and solve that using Mathematica. Best,David
Posted 11 years ago
 Thank you so much. (BTW I'm a lady) I know that is much easier to solve it manualy but I need to use Mathematica for my master thesis .... and it looks more representative ;)
Posted 11 years ago
 The equation given can be easily solved with pencil and paper in far less time than required to put it into Mathematica.(Hint: the left hand side is an Exact Differential.)Best regards,David
Posted 11 years ago
 No problem Seokin!That is the advantage of a forum with members that advise and teach each other.
Posted 11 years ago
 Ah, I guess I had been mistaken.I hope my answer had not been misleading. I should've guessed the complexity when he said it was for his mater's degree.Thank you.
Posted 11 years ago
 Actually Seokin, I believe that the equation that Dani is writing out is the following (in Mathematica)(3*x^2*y[x] + 8*x*y[x]^2) + (x^3 + 8*x^2*y[x] + 12*y[x]^2) D[y[x], x] == 0 And it appears that DSolve can handle this  In[1]:= DSolve[(3*x^2*y[x] +       8*x*y[x]^2) + (x^3 + 8*x^2*y[x] + 12*y[x]^2) D[y[x], x] == 0,   y[x], x]   Out[1]= {{y[x] -> -(x^2/3) - (12 x^3 - 16 x^4)/(     24 (9 x^5 - 8 x^6 + 27 C[1] +         3 Sqrt[3] Sqrt[         x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(1/3)) +     1/6 (9 x^5 - 8 x^6 + 27 C[1] +        3 Sqrt[3] Sqrt[        x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(     1/3)}, {y[x] -> -(x^2/3) + ((1 + I Sqrt[3]) (12 x^3 - 16 x^4))/(    48 (9 x^5 - 8 x^6 + 27 C[1] +        3 Sqrt[3] Sqrt[        x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(1/3)) -     1/12 (1 - I Sqrt[3]) (9 x^5 - 8 x^6 + 27 C[1] +        3 Sqrt[3] Sqrt[        x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(     1/3)}, {y[x] -> -(x^2/3) + ((1 - I Sqrt[3]) (12 x^3 - 16 x^4))/(    48 (9 x^5 - 8 x^6 + 27 C[1] +        3 Sqrt[3] Sqrt[        x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(1/3)) -     1/12 (1 + I Sqrt[3]) (9 x^5 - 8 x^6 + 27 C[1] +        3 Sqrt[3] Sqrt[        x^9 - x^10 + 18 x^5 C[1] - 16 x^6 C[1] + 27 C[1]^2])^(1/3)}}Note that the C[1] are the unknown arbitrary constants that would be determined by the initial condition (which were not supplied). Alson note that there are 3 solutions but that two of them are non-real generally. If, say, the initial condition was that y[0]==1 then the process process would read  In[13]:= DSolve[{(3*x^2*y[x] + 8*x*y[x]^2) + (x^3 + 8*x^2*y[x] + 12*y[x]^2) D[y[x], x] == 0, y[0] == 1}, y[x], x]   Out[13]= {{y[x] -> (-3 x^3 + 4 x^4 -        2 x^2 (108 + 9 x^5 - 8 x^6 +           3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(        1/3) + (108 + 9 x^5 - 8 x^6 +          3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(       2/3))/(6 (108 + 9 x^5 - 8 x^6 +         3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(1/3))}}Which yields a single (generally real) solution.If you wanted to plot this then you might do something like Plot[(-3 x^3 + 4 x^4 -     2 x^2 (108 + 9 x^5 - 8 x^6 +        3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(     1/3) + (108 + 9 x^5 - 8 x^6 +       3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(    2/3))/(6 (108 + 9 x^5 - 8 x^6 +       3 Sqrt[3] Sqrt[432 + 72 x^5 - 64 x^6 + x^9 - x^10])^(1/3)), {x,   1, 10}, PlotRange -> All]
Posted 11 years ago
 Hello DaniI am also a beginner at Mathematica, but I believe I can give you some aid. As a high school student in Calculus class, I have utilized Mathematica for such purposes.I would use D[] and ContourPlot to work your problem.This is how I worked your problem:In[17]:= D[3*x^2*y + 8*x*y^2, x] + D[x^3 + 8*x^2*y + 12*y^2, y] == 0Out[17]= 8 x^2 + 24 y + 6 x y + 8 y^2 == 0This should solve the derivatives.ContourPlot[8 x^2 + 24 y + 6 x y + 8 y^2 == 0, {x, -2, 3}, {y, -4, 0}]This should give the plot of the equation which is an ellipse.Of course, I am not a college mathematician, and my knowledge of mathematics is limited. I hope that this helped your problemAlso, as a tip, whenever you want to know how a function works in Mathematica, you can type in ? and the function. For example,?ContourPlotShould tell you how and what the ContourPlot does.If my explanation is unclear, do feel free to criticize me.