How to correctly use Dsolve?

how can I Plot these Equations?

1)

(x-y[x])y'[x]== x+y[x]

2)

Sol = DSolve[{1/r^2*D[r^2*ψ[r], r] + Subscript[ν, ct] ψ[r] == 0, ψ[r0] == ψ0/(r0^2 Ω)},
ψ[r], r] /. r0 -> 0 /. Subscript[ν, ct] -> 1/λct;

=================

1

 

Please write your first expression in Mathematica format. Also, if you wish to plot an expression, you must define all constants. Please include their values in your question.
– bbgodfrey
Oct 2 at 14:19

  

 

Welcome! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Louis
Oct 2 at 15:07

  

 

See How to copy code from Mathematica so it looks good on this site and Hints and help on using the site efficiently and How do I format my posts using Markdown or HTML? and read the FAQ
– Louis
Oct 2 at 15:07

  

 

how did you figure out dsolve and not the even simpler Plot? Plot[ψ[r]/.First@sol /. ψ0->1/.Ω->1/.λct->1,{r,0,1}]
– george2079
Oct 2 at 15:44

  

 

the first one is a bit more challenging as the solution is given in implicit form. You can use ContourPlot to plot the result
– george2079
Oct 2 at 15:54

=================

1 Answer
1

=================

sol=DSolve[(x-y[x])y'[x]== x+y[x],y[x],x]

ContourPlot [ Evaluate@(First@sol/.C[1]->0/.y[x]->y) ,{x,0,2}, {y,-1,5}]

ContourPlot [ Evaluate@Table[First@sol/.C[1]->i/.y[x]->y,{i,-2,2 }] ,{x,0,2}, {y,-1,5}]

incidentally, this throws a spurious unable to solve warning.. (yet shows the plot just fine anyway ).

Edit: here is how to do it cleanly..

sol = DSolve[(x – y[x]) y'[x] == x + y[x], y[x], x]
sol = (List @@ sol)[[1]] /. y[x] -> y /. C[1] -> i
ContourPlot[Evaluate[Table[sol, {i, -2, 2}]], {x, 0, 2}, {y, -1, 5}]