Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6171
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Simple DSolve equation |
| Date | 2011-11-04 10:59 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j90ghv$se0$1@smc.vnet.net> (permalink) |
| References | <j8tkpb$f14$1@smc.vnet.net> |
"Rui" <rui.rojo@gmail.com> schrieb im Newsbeitrag
news:j8tkpb$f14$1@smc.vnet.net...
> Why does something like this not give the correct answer with
> restrictions over k?
> How would you go about getting the right general solutions in these
> kind of basic differential equations?
>
> Thanks
>
> DSolve[{y''[x] == k y[x], y[0] == 0, y[10] == 0}, y[x], x]
> Out={{y[x] -> 0}}
>
Interesting question. Because I always had in mind to put down the
procedure I'll do it here though the elaborated version might be a
little lengthy. I have deleted the Ins and Outs and the error messages
for ease of reading.
We will find all solutions (the trivial and he non-trivial ones) in the
following way.
First we DSolve the differential equation with just one condition (at
x= 0, say), and then impose the second condition as a Solve requirement
on the set of solutions thus obtained.
We shall see that Solve does all the fine "quantization" we expect, i.e
it gives us the possible values of the parameter k.
For better transparency we shall first apply Reduce, and Solve
afterwards.
The code is found below
Best regards,
Wolfgang
Begin of code
f[x_] = y[x] /. DSolve[{Derivative[2][y][x] == k*y[x], y[0] == 0},
y[x], x][[1]]
(-E^((-Sqrt[k])*x))*(-1 + E^(2*Sqrt[k]*x))*C[2]
First Reduce,
r = Reduce[Simplify[f[10]] == 0]
(E^Sqrt[k] == -1 - E^(2*Sqrt[k]) - E^(3*Sqrt[k]) - E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) + E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0) ||
(E^Sqrt[k] == 1 + E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0) ||
(E^(2*Sqrt[k]) == -1 && E^Sqrt[k] != 0) || (E^(2*Sqrt[k]) == 1 +
E^(4*Sqrt[k]) - E^(6*Sqrt[k]) + E^(8*Sqrt[k]) && E^Sqrt[k] != 0) ||
(C[2] == 0 && E^Sqrt[k] != 0) || E^Sqrt[k] == -1 || E^Sqrt[k] == 1
Length[r]
7
now Solve, one by one
n = 1;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == -1 - E^(2*Sqrt[k]) - E^(3*Sqrt[k]) - E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) + E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0
{{k -> -((16*Pi^2)/25)}, {k -> -((4*Pi^2)/25)}, {k ->
Log[-(-1)^(1/5)]^2}, {k -> Log[-(-1)^(3/5)]^2}}
{-2*I*C[2]*Sin[(4*Pi*x)/5], -2*I*C[2]*Sin[(2*Pi*x)/5], -2*I*C[2]*Sin[(4*Pi*x)/5],
-2*I*C[2]*Sin[(2*Pi*x)/5]}
n = 2;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == 1 + E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0
{{k -> -((9*Pi^2)/25)}, {k -> -(Pi^2/25)}, {k -> Log[-(-1)^(2/5)]^2},
{k -> Log[-(-1)^(4/5)]^2}}
{-2*I*C[2]*Sin[(3*Pi*x)/5], -2*I*C[2]*Sin[(Pi*x)/5], -2*I*C[2]*Sin[(3*Pi*x)/5],
-2*I*C[2]*Sin[(Pi*x)/5]}
n = 3;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^(2*Sqrt[k]) == -1 && E^Sqrt[k] != 0
{{k -> -(Pi^2/4)}}
{-2*I*C[2]*Sin[(Pi*x)/2]}
n = 4;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^(2*Sqrt[k]) == 1 + E^(4*Sqrt[k]) - E^(6*Sqrt[k]) + E^(8*Sqrt[k]) &&
E^Sqrt[k] != 0
{{k -> -((81*Pi^2)/100)}, {k -> -((49*Pi^2)/100)},
{k -> -((9*Pi^2)/100)}, {k -> -(Pi^2/100)}, {k -> Log[-(-1)^(1/10)]^2},
{k -> Log[-(-1)^(3/10)]^2}, {k -> Log[-(-1)^(7/10)]^2}, {k ->
Log[-(-1)^(9/10)]^2}}
{-2*I*C[2]*Sin[(9*Pi*x)/10], -2*I*C[2]*Sin[(7*Pi*x)/10], -2*I*C[2]*Sin[(3*Pi*x)/10],
-2*I*C[2]*Sin[(Pi*x)/10], -2*I*C[2]*Sin[(9*Pi*x)/10], -2*I*C[2]*Sin[(7*Pi*x)/10],
-2*I*C[2]*Sin[(3*Pi*x)/10], -2*I*C[2]*Sin[(Pi*x)/10]}
n = 5;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
C[2] == 0 && E^Sqrt[k] != 0
{0}
n = 6;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == -1
{{k -> -Pi^2}}
{-2*I*C[2]*Sin[Pi*x]}
n = 7;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == 1
{{k -> 0}}
{0}
Finally, we put everything together (and letting C[2] -> 1/(-2*I) which
gives the list a nicer appeal)
Union[Flatten[Table[fs[i], {i, 1, 7}]]] /. C[2] -> 1/(-2*I)
{0, Sin[(Pi*x)/10], Sin[(Pi*x)/5], Sin[(3*Pi*x)/10], Sin[(2*Pi*x)/5],
Sin[(Pi*x)/2], Sin[(3*Pi*x)/5], Sin[(7*Pi*x)/10], Sin[(4*Pi*x)/5],
Sin[(9*Pi*x)/10], Sin[Pi*x]}
End of code
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Simple DSolve equation Rui <rui.rojo@gmail.com> - 2011-11-03 08:52 +0000
Re: Simple DSolve equation "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-11-04 10:59 +0000
Re: Simple DSolve equation Rui <rui.rojo@gmail.com> - 2011-11-06 10:58 +0000
Re: Simple DSolve equation "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-11-12 12:41 +0000
csiph-web