|
workaholic <liuauto@gmail.com> wrote in message <a91a6a92-9a27-43ba-a25d-aa2b62a834b2@g18g2000yqk.googlegroups.com>...
> consider the differential equation:
>
> dsolve('Dx = x^2 -x')
>
> ans =
>
> 0
> 1
> -1/(exp(C3 + t) - 1)
>
> I think it neglects another solution that is 1/( 1 + exp(t +c)), which
> requires the value of x lies within [0,1]. Is there something wrong
> with the algorithm?
- - - - - - - - - - -
Yes, 'dsolve' neglected the possibility that x could lie in the interval [0,1]. At the step
int(1/(x-1) - 1/x) = t + C
it gave the solution
log(x-1) - log(x) = t + C .
In reality there are three cases: 1) x > 1, 2) 0 < x < 1, and 3) x < 0. The three respective integrations should yield;
log(x-1) - log(x) = log((x-1)/x) = t + C
log(1-x) - log(x) = log((1-x)/x) = t + C
log(1-x) - log(-x) = log((x-1)/x) = t + C
Thus cases 1) and 3) give rise to the same expression but case 2) is different. 1) and 3) lead to
x = 1/(1-exp(t+C))
while 2) yields
x = 1/(1+exp(t+C))
which, as you say, 'dsolve' missed. Both solutions as well as the x = 1 solution are subsumed in the single expression x = 1/(1+K*exp(t)). The x = 0 solution comes from letting K approach infinity.
The reality is that for each of the separate ranges of x, there is only one family of solutions as described above, obtained by shifts left or right along the t axis. The two constant solutions are derived from extreme shifts left or right.
Congratulations to 'dsolve' for providing for the extremes; raspberries for missing the entire solution family between 0 and 1. Take comfort - there is still a need for us mere human beings to straighten out the machines' errors.
Roger Stafford
|