How can I input the syntax of this Differential Equation (2*x + y^2 + 2*x*y*y' = 0)?

1 Ansicht (letzte 30 Tage)
Hi. How can I input the syntax of this Differential Equation (2*x + y^2 + 2*x*y*y' = 0) in MATLAB? Using hand calculation with Exact Equation Method the answer is x^2+x*y^2 = C. I used this syntax, ode = diff(y,x) == (-2*x-y^2)/(2*x*y) but got different solution which was (-x*(x^2 + C1))^(1/2)/x -(-x*(x^2 + C1))^(1/2)/x .
Note that I followed the example problem (dydt+y)^2 = 1 in https://au.mathworks.com/help/symbolic/solve-a-single-differential-equation.html#d118e24819 help documentation.
Thanks.
  1 Kommentar
Lawrence Galvez
Lawrence Galvez am 27 Feb. 2020
I got it. I failed to simplify my solution in terms of y. The hand calculation and MATLAB output is the same.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by