Nasser M. Abbasi wrote:   
   > On 7/9/2022 1:43 AM, Dr Huang wrote:   
   > > wolfram gives   
   > > (c1-x)^2/x   
   > > is it right? did it seem wrong? what is yours?   
   > >   
   > > DrHuang.com   
   >   
   > Mathematica 13.1   
   >   
   > ClearAll[x, y]   
   > ode = x*y'[x] + y[x] == 2*(x*y[x])^(1/2);   
   > sol = DSolve[ode, y[x], x, IncludeSingularSolutions -> True]   
   >   
   > gives   
   >   
   > {{y[x] -> (E^(C[1]/2) + x)^2/x}, {y[x] -> x}}   
   >   
   > The first is the general solution and the second is singular solution.   
   >   
   > The solution you give is a particular solution which satisfies the ode   
   > under the condition x>=C[1] only. You can see this by doing   
   >   
   > sol = y -> Function[{x}, (C[1] - x)^2/x]   
   > result = ode /. sol // FullSimplify   
   >   
   > Sqrt[(x - C[1])^2] + C[1] == x   
   >   
   > The above becomes identity when x >= C[1]   
      
   Well, it depends on what Sqrt (or ^(1/2)). In general there   
   are two square roots and in complex domain you can not   
   really separate them, one will analytically continue to   
   the other.   
      
   AFAICS the (C[1] - x)^2/x is better. With complex C[1]   
   writing E^(C[1]/2) is just obscure way of saying that we   
   have arbitrary nonzero constant. This is even more obscure   
   since replacing E^(C[1]/2) leads to valid solution. With   
   real C[1] writing constat as E^(C[1]/2) excludes negative   
   values and conseqently some solutions. And if you insist   
   that argument to Sqrt must be positive, then you get   
   restrictions on x anyway.   
      
   BTW: AFAICS 0 is singular solution, not covered by   
   formulas above. You can glue it with other solutions   
   at point where other solution is 0, so starting from   
   0 initial condition you get infintely many solutions.   
      
   --   
    Waldek Hebisch   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|