       Re: newbie: diff equation

• To: mathgroup at smc.vnet.net
• Subject: [mg96907] Re: [mg96886] newbie: diff equation
• From: DrMajorBob <btreat1 at austin.rr.com>
• Date: Fri, 27 Feb 2009 06:10:53 -0500 (EST)
• References: <200902261301.IAA26650@smc.vnet.net>

```You're asking DSolve to do its own work and the work of Solve, at the same
time. Try it with fewer conditions:

DSolve[f''[x] == -m^2 f[x], f, x]

{{f -> Function[{x}, C Cos[m x] + C Sin[m x]]}}

or

Clear[f]
f[x_] = f[x] /. Last@DSolve[f''[x] == -m^2 f[x], f, x];
Reduce[{f == 0, f[Pi] == 0}, {C, C, m}]

(C \[Element]
Integers && ((C != 0 && C == 0 &&
m == 2 C) || (C == 0 && m == 1 + 2 C))) || ((-\[Pi] +
m \[Pi])/(2 \[Pi]) \[NotElement] Integers && C == 0 &&
C == 0)

or

Clear[f]
f[x_] = f[x] /.
Last@DSolve[{f''[x] == -m^2 f[x], f == 0}, f[x], x]
Reduce[f[Pi] == 0, {m}] // Simplify

C Sin[m x]

(C \[Element] Integers && (m == 2 C || m == 1 + 2 C)) ||
C == 0

Unless C == 0, that works out to mean "m is an integer", but... as you
can see... Mathematica somehow isn't able to straightforwardly say so.

Bobby

On Thu, 26 Feb 2009 07:01:18 -0600, Mike <atkins1976 at yahoo.com> wrote:

> My problem is very simple, I'm sure someone can help me out quickly. I
> am trying to solve some systems of differential equations a bit like a
> particle in a box (QM) so I started with this basic problem which I know
> how to solve just to make sure I am entering everything ok, but I can't
> even get it to work.
>
> I want to solve f''[x]= - m^2 f[x]
>
> with f = 0 and f[Pi] = 0
>
> this is obviously only solvable with the condition on m being integer
> but if I do DSolve on the above with the boundary conditions I just get
> f=0. How can I get mathematica to solve this and give me the conditions
> on m? I need to solve much more general problems of this type. I hope
> someone can help.
> Many thanks
>

--
DrMajorBob at bigfoot.com

```

• Prev by Date: Re: Re: Exporting data into a file, OpenWrite
• Next by Date: Re: Galois resolvent
• Previous by thread: Re: newbie: diff equation
• Next by thread: Re: newbie: diff equation