# Question:Where is error in solving for constant of integration in this ode?

## Question:Where is error in solving for constant of integration in this ode?

Maple 2024

Could someone be able to spot why I get different solution when solving for the constant of integration from this Maple dsolve solution manually than when asking Maple to do it directly?

This is the ode

```ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic:=y(1) = 1;
```

If I ask Maple to solve it with the IC all at once, it gives solution which odetest verifies OK.

If I ask Maple to solve it with no IC, then solve the constant myself and plug the constant back into the solution I get solution which does not verify any more.

I am not able to find why. Could someone spot the error in this? Please see worksheet below. I suspect the problem is when plugging back the constant of integration into the general solution, but have no idea now what it is. Clearly Maple did something much smarter than what I did by just plugging the constant back into the solution. May be need to specify what branch to use when plugging the constant back? but how do I know which one?

 > interface(version);

 > Physics:-Version()

 > ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1); ic:=y(1) = 1; sol_no_IC:=dsolve(ode);

 > sol_with_IC_direct:=dsolve([ode,ic]); odetest(sol_with_IC_direct,[ode,ic]);

 > #this verifies Maple found correct constant also:
 > solve(rhs(sol_with_IC_direct)=rhs(sol_no_IC),c__1)

 > #now solve for constant of integration manually. This gives invalid solution. Why?
 > eq:= 1=limit(rhs(sol_no_IC),x=1);

 > PDEtools:-Solve(eq,c__1);

 > sol_with_ic:=eval(sol_no_IC,%)

 > odetest(sol_with_ic,[ode,ic]);

Download why_wrong_solution.mw

﻿