List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] dsolve does not find second solution
| [MUG] dsolve does not find second solution |
|
Author: Helmut Kahovec
Posted: Mon, 16 Dec 2002 12:26:41 +0100
|
>> From: Helmut Kahovec />
Dear Maple users,
One of my students found a bug in dsolve(). It behaves the same in
Maple7 and Maple8. The following Maple7 session shows that bug.
> restart;
> infolevel[dsolve]:=10;
infolevel[dsolve] := 10
> ode1:=diff(y(x),x)+(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
/d \ 4 x + 3 y(x) + 1
ode1 := |-- y(x)| + ----------------
\dx / 3 x + 2 y(x) + 1
> sol1:=dsolve(ode1,y(x));
Methods for first order ODEs:
Trying to isolate the derivative dy/dx...
Successful isolation of dy/dx
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying homogeneous C
trying homogeneous types:
trying homogeneous D
<- homogeneous successful
<- homogeneous successful
2 2
3/2 (x + 1) _C1 - 1/2 sqrt((x + 1) _C1 + 4)
sol1 := y(x) = 1 - ---------------------------------------------
_C1
There should be a second solution, which is missing:
> sol2:=y(x)=1-(3/2*(x+1)*_C1+1/2*((x+1)^2*_C1^2+4)^(1/2))/_C1;
2 2
3/2 (x + 1) _C1 + 1/2 sqrt((x + 1) _C1 + 4)
sol2 := y(x) = 1 - ---------------------------------------------
_C1
> odetest(sol1,ode1);
0
> odetest(sol2,ode1);
0
We can produce both solutions if we first change coordinates
appropriately:
> with(PDEtools):
> T:={x=t-1,y(x)=z(t)+1};
T := {y(x) = z(t) + 1, x = t - 1}
> ode2:=dchange(T,ode1);
/d \ 4 t + 3 z(t)
ode2 := |-- z(t)| + ------------
\dt / 3 t + 2 z(t)
> dsolve(ode2,z(t));
Methods for first order ODEs:
Trying to isolate the derivative dz/dt...
Successful isolation of dz/dt
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying homogeneous D
<- homogeneous successful
2 2
- 3/2 t _C1 - 1/2 sqrt(t _C1 + 4)
z(t) = -----------------------------------,
_C1
2 2
- 3/2 t _C1 + 1/2 sqrt(t _C1 + 4)
z(t) = -----------------------------------
_C1
The inverse transformation gives the same two solutions as before:
> Tinv:={t=x+1,z(t)=y(x)-1};
Tinv := {z(t) = y(x) - 1, t = x + 1}
> sol12:=op(map(isolate,subs(Tinv,[%%]),y(x)));
sol12 :=
2 2
- 3/2 (x + 1) _C1 - 1/2 sqrt((x + 1) _C1 + 4)
y(x) = ----------------------------------------------- + 1,
_C1
2 2
- 3/2 (x + 1) _C1 + 1/2 sqrt((x + 1) _C1 + 4)
y(x) = ----------------------------------------------- + 1
_C1
> map(
normal,
zip(
`-`,
map(subs,[sol2,sol1],y(x)), # you may have to use [sol1,sol2],
map(subs,[sol12],y(x)) # instead
)
);
[0, 0]
Kind regards,
Helmut
|
| [MUG] Re: dsolve does not find second solution |
|
Author: Maple User Group
Posted: Tue, 17 Dec 2002 13:07:28 -0500
|
>> From: Maple User Group />
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 16 Dec 2002 08:23:00 -0500 (EST)
From: Stephen Forrest />
To: />
Subject: dsolve does not find second solution
On Mon, 16 Dec 2002, Helmut Kahovec wrote:
[snip]
> 2 2
> 3/2 (x + 1) _C1 - 1/2 sqrt((x + 1) _C1 + 4)
> sol1 := y(x) = 1 - ---------------------------------------------
> _C1
>
> There should be a second solution, which is missing:
>
> > sol2:=y(x)=1-(3/2*(x+1)*_C1+1/2*((x+1)^2*_C1^2+4)^(1/2))/_C1;
>
> 2 2
> 3/2 (x + 1) _C1 + 1/2 sqrt((x + 1) _C1 + 4)
> sol2 := y(x) = 1 - ---------------------------------------------
> _C1
Observe that sol2 is equal to sol1 after the substitution _C1 -> -_C1,
thus since _C1 can be any real, sol2 is contained in dsolve's solution.
Steve
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Edgardo S. Cheb-Terrab" />
To: />
Subject: [maple-expert] dsolve does not find second solution
Date: Mon, 16 Dec 2002 16:01:17 -0800
Hi,
I see no solutions missing in dsolve's output - no bug.
Given two general solutions S1(y, x, _C1) and S2(y, x, _C1), we say "these
solutions are the same" (so there is only one) whenever
S2(y, x, _C1) = S1(y,x, F(_C1) )
for some F. In simpler words: whenever S2 can be obtained from S1 by
redefining the arbitrary constant _C1~ = F(_C1), then S2 is not a solution
different than S1.
For example, I can always change _C1 -> F(_C1), in the solution sol1 you show,
with whatever F of my choice, and obtain as many different forms of the
solution as I want - they are all"the same solution.
In particular, if I change _C1 = -_C1 in the sol1 you show I obtain your sol2,
from where sol2 is not another solution and therefore it is not the case that
dsolve is missing one solution.
Edgardo
|
| [MUG] Re: dsolve does not find second solution |
|
Author: Zijlstra
Posted: Thu, 19 Dec 2002 09:41:15 -0600
|
>> From: zijlstra />
Dear Dr. Kahovec,
The solutions are indeed (explicit) branches of one (implicit) solution. MAPLE
should return either both (explicit) branches or stop at the implicit
solution. The reason it omits one branch is in the method of solution: rather
than realizing that the problem is exact (which makes for a very
straightforward dtermination of the implicit solution), MAPLE
first arrives at the type homogeneousD. Solutions of this type are generated
in 'RootOf' form. But MAPLE does not stop there. Rather, it returns an
closed form solution using 'allvalues' - the probable source of omission of
the second branch.
The bigger problem here is: why does MAPLE not recognize this ODE as exact?
>ode1:=diff(y(x),x)=-(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
>with(DEtools):
>odeadvisor(ode1,y(x),[exact]);
[NONE]
Hope this narrows down the problem some,
Jan Zijlstra, Dept. Math. Sci., MTSU
|
| [MUG] Re: dsolve does not find second solution |
|
Author: Edgardo S Cheb-Terrab
Posted: Thu, 02 Jan 2003 15:52:03 -0800
|
>> From: "Edgardo S. Cheb-Terrab" />
> ... (regarding)
> >ode1:=diff(y(x),x)=-(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
>..
> The solutions are indeed (explicit) branches of one (implicit) solution. MAPLE
> should return either both (explicit) branches or stop at the implicit
> solution.
Due to the arbitrary character of the integration constants, what seems to be
two solutions are actually only one and the same - Maple is not missing a
solution or a branch of it (there were previous replies to this).
> ...
> The bigger problem here is: why does MAPLE not recognize this ODE as exact?
> >ode1:=diff(y(x),x)=-(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
> >with(DEtools):
> >odeadvisor(ode1,y(x),[exact]);
> [NONE]
This is a different thing. The ode1 you show,
> ode1:=diff(y(x),x)=-(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
4 x + 3 y + 1
ode1 := y' = - -------------
3 x + 2 y + 1
is not an exact differential equation. When the coefficient of y' is a constant,
as in the above, the ODE is exact if and only if the right hand side does not
depend on y(x), which is not the case.
For an arbitrary ODE, one rapid way to check exactness in Maple (regardless of
the ODE differential order) is to check whether a constant is an integrating
factor. Let's see:
# Verify whether "the number one" (a constant) is an integrating factor
> DEtools[mutest]( 1, ode1); # Note zero, hence ode1 is not exact.
x 1
---------------- + ----------------
2 2
(3 x + 2 y + 1) (3 x + 2 y + 1)
For that reason, odeadvisor is telling ode1 is not exact.
What perhaps is in your mind is that ode1 "becomes exact" if you multiply it
(both sides) by the denominator of its right-hand-side, which in this example
happens to be an integrating factor:
# two integrating factors, the first one is just the denom of the rhs
> DEtools[intfactor]( ode1) ;
3 x + 2 y + 1
3 x + 2 y + 1, ---------------------
(x + y) (2 x + y + 1)
So, multiplying by denom@rhs
> denom(rhs(ode1)) * ode1; # <- this ODE is exact
(3 x + 2 y + 1) y' = -4 x - 3 y - 1
> DEtools[mutest]( 1, %);
0
> odeadvisor( %%, y(x), [exact]);
[_exact]
Despite the apparent 'simplicity' of "just multiply by the denominator of the
rhs" to make the ODE exact, in truth the denom@rhs is not a better or worse
candidate than any other possible multiplying factor candidate and odeadvisor
does not make any guess when testing: will tell the ODE is exact if an only if
it is "as given".
Regarding tackling an ODE using methods for homogeneous ODEs or for exact ones,
Maple's dsolve has its default ordering of methods (first 'this' then 'that' one
etc.) but you can always make it work as you prefer: just give the methods to be
tried and in the order you want as second argument - see ?dsolve.
Anyway, making the ODE exact by multiplying it by an integrating factor and then
solving it as an exact equation you still see there is only one solution - the
one returned when you try dsolve(ode1) - regardless of how many solutions dsolve
outputs when you use optional arguments.
Edgardo
----- Original Message -----
From: "zijlstra" />
To: "maple-list" />
Sent: Thursday, December 19, 2002 7:41 AM
Subject: [MUG] Re: dsolve does not find second solution
>> From: zijlstra />
Dear Dr. Kahovec,
The solutions are indeed (explicit) branches of one (implicit) solution. MAPLE
should return either both (explicit) branches or stop at the implicit
solution. The reason it omits one branch is in the method of solution: rather
than realizing that the problem is exact (which makes for a very
straightforward dtermination of the implicit solution), MAPLE
first arrives at the type homogeneousD. Solutions of this type are generated
in 'RootOf' form. But MAPLE does not stop there. Rather, it returns an
closed form solution using 'allvalues' - the probable source of omission of
the second branch.
The bigger problem here is: why does MAPLE not recognize this ODE as exact?
>ode1:=diff(y(x),x)=-(4*x+3*y(x)+1)/(3*x+2*y(x)+1);
>with(DEtools):
>odeadvisor(ode1,y(x),[exact]);
[NONE]
Hope this narrows down the problem some,
Jan Zijlstra, Dept. Math. Sci., MTSU
|
Previous by date: [MUG] Re: Forcing Maple Output with Simplifying, Maple User Group
Next by date: [MUG] Nargs, PierLuigi Zezza
Previous thread: [MUG] Two bugs in evalapply(), Helmut Kahovec
Next thread: [MUG] Nargs, PierLuigi Zezza
|