Bug introduced in 13.1 or earlier and persisting through 13.1.0 or later
I have a first-order ODE that I want to solve:
$$\frac{dy}{dt}=\frac{1}{2t}+\frac{y^2}{2}$$.
The result I get back from
DSolve[y'[t] == 1/(2 t) + 1/2 (y[t])^2, y, t]
is, in TeX form,
$$\frac{c_1 J_1(\sqrt{t})+\frac{\sqrt{t}}{2}\left[c_1 \left(J_0(\sqrt{t})-J_2(\sqrt{t})\right)-2J_0(\sqrt{t})\right]}{t \left(1-c_1\right)J_1(\sqrt{t})}$$
This includes the arbitrary constant of integration $c_1$, as is right and proper for a first-order ODE.
However, using FullSimplify
, or indeed the recurrence relation for Bessel functions $x(J_{\nu+1}(x)+J_{\nu-1}(x))=2\nu J_{\nu}$, this can be reduced to
$$-\frac{J_0(\sqrt{t})}{\sqrt{t}\ J_1(\sqrt{t})}$$
Somehow the constant $c_1$ has disappeared from the problem. What this appears to be saying is that the solution to my ODE is somehow "rigid", in the sense that I can't solve it from an arbitrary initial condition. This contradicts my entire intuition about differential equations!
This leads me to think that what DSolve
returns may not be the general solution to a differential equation.
So my question is: what does DSolve
actually return? If it's not the general solution, then how might I find the general solution for my problem?
If it does return the general solution, then it would appear that my problem is pathological in some sense. In what sense though? Where can I find out more about this?
DSolve
then gives the answer (after aFullSimplify
): $$y=-\frac{1}{x}\frac{Y_0(x)+J_0(x)c_1}{Y_1(x)+J_1(x)c_1}$$ Not only does $c_1$ remain here (as I believe it should), but I also can't find a way to make this equivalent to the solution in terms of $\sqrt{t}$, which it should since they are linked by a simple change of variable! This system is strange. Any help would be very welcome! $\endgroup$FullSimplify
is the one who made mistake because the solution actually verifies the ode according to Mathematica when substituted back into the ode. Any way, I give below derivation which gives solution that do not cancel the constant when simplified. If you report this to WRI they will know if it is FullSimplify the cause or not. $\endgroup$DSolve[{y'[t] == b/t + c (y[t])^2}, y[t], t] // FullSimplify
has the same problem. -- Actually, the problem arises for negative powers of $t$. $\endgroup$y[t] -> ReplaceAll[t -> t - 1]@ DSolveValue[{y'[t] == 1/(2 (1 + t)) + 1/2 (y[t])^2}, y[t], t] // FullSimplify
-- basically it seems these workarounds kick the execution path out of the buggy Ricatti solver. Please report the bug to WRI. $\endgroup$