Question: How to find a symbolic solution for this piecewise-defined ODE?

I can derive a symbolic solution by hand for the following ODE, but cannot get Maple to do it for me.  Any tricks?

restart;

Velocity field, -infinity < x and x < infinity,  t > 0.

v := (x,t) -> piecewise(x <= -t, 0, x < t, 1 - 1/2*(1 - x/t));

v := proc (x, t) options operator, arrow; piecewise(x <= -t, 0, x < t, 1/2+(1/2)*x/t) end proc

Position x(t):

de := diff(x(t),t) = v(x(t),t);

de := diff(x(t), t) = piecewise(x(t) <= -t, 0, x(t) < t, 1/2+x(t)/(2*t))

Initial condition, assuming a > 0

ic := x(0) = -a;

x(0) = -a

Symbolic solution, calculated by hand:

x__exact := t -> piecewise(t < a, -a, t - 2*sqrt(t)*sqrt(a));

x__exact := proc (t) options operator, arrow; piecewise(t < a, -a, t-2*sqrt(t)*sqrt(a)) end proc

Verify exact solution by comparing it against the numeric solution for some a > 0:

a := 3;  # any a>0 should do
dsol := dsolve({de,ic}, numeric):
plots:-odeplot(dsol, t=0..5);   # dsolve solution
plot(x__exact(t), t=0..5);      # symbolic solution (calculated by hand)
a := 'a';

3

a

Can Maple's dsolve find the exact solution?  This one returns empty in Maple 2022:

dsolve({de, ic}) assuming a > 0, t > 0;

Download ode-piecewise.mw

 

Please Wait...