Opened 3 years ago

# Incorrect choice of roots in solving ODEs with initial conditions.

Reported by: Owned by: charpent major symbolics desolve differential_equations boundary_values Not yet reported upstream; Will do shortly.

### Description

Sources : initial constatation, formal question, formal report in `sage-devel`.

```y=function('y')(x)
desolve(diff(y)==4*y/x+x*sqrt(y),y,ics=[1,1]).factor()
```

returns

```1/4*x^4*(log(x) - 2)^2
```

```1/4*x^4*(log(x) + 2)^2
```

A bit of exploration (see sources) shows that:

• `sympy` and {{{giac}} both can find the correct solution
• `Mathematica` returns both the "righr" and the "wrong" solution
• The bug is an infortunate choice of roots :
```y=function('y')(x)
Sol=desolve(diff(y)==4*y/x+x*sqrt(y),y).factor()
print Sol
var("_C")
(Sol.subs(x==1)==1).solve(_C)
```

returns :

```1/4*(2*_C + log(x))^2*x^4
[_C == -1, _C == 1]
```

It turns out that the same problem occurs in `maxima` :

```eq:'diff(y,x)=4*y/x+x*sqrt(y);
SG:factor(ode2(eq,y,x));
print(eq);
print(SG);
SP:factor(ic1(SG,x=1,y=1));
print(SP);
D1:subst([x=1],diff(rhs(SP),x));
print(D1);
D2:subst([x=1,y=1],rhs(eq));
print(D2);
```

returns :

```dy   4 y
-- = --- + x sqrt(y)
dx    x
4                2
x  (log(x) + 2 %c)
y = -------------------
4
4             2
x  (log(x) - 2)
y = ----------------
4
3
5
```

Therefore, I'm inclined to attribute this bug to `maxima`'s one. I intend to report it upstream ASAP (more precisely, as soon I'll have recovered a way to log onto the damn `sourceforge` site. Grrrr...).

### comment:1 Changed 3 years ago by charpent

• Keywords desolve added

### comment:2 Changed 3 years ago by embray

• Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

### comment:3 Changed 3 years ago by embray

• Milestone sage-8.8 deleted

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

Note: See TracTickets for help on using tickets.