Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Initial condition with DSolve in Mathematica 8 doesn't work

1,341 views
Skip to first unread message

Bert RAM Aerts

unread,
Jan 28, 2011, 6:14:41 AM1/28/11
to
When I enter the following in Mathematica 8.0.0 Home Edition:
DSolve[{y'[x] + y[x] == a Sin[x], y[0] == 0}, y[x], x]
I get
DSolve::deqn: Equation or list of equations expected instead of True
in the first argument {y[x]+(y^\[Prime])[x]==a Sin[x],True}. >>

The initial condition becomes a "True"...

In Mathematica 7.0.1 Home Edition, this same input gives the expected
output:
{{y[x] -> -(1/2) a E^-x (-1 + E^x Cos[x] - E^x Sin[x])}}

What am I missing?

Bert RAM Aerts

unread,
Jan 29, 2011, 5:24:02 AM1/29/11
to
After restarting Mathematica 8.0.0 Home Edition (on Mandriva Linux
2010.2 x86_64) the command suddenly started working just fine.
I have no clue why it at first did not work...

Murray Eisenberg

unread,
Jan 29, 2011, 5:41:31 AM1/29/11
to
The "Home Edition" has nothing to do with such a question. In (any
edition of) Mathematica 8.0.0:

DSolve[{y'[x] + y[x] == a Sin[x], y[0] == 0}, y[x], x] // InputForm
{{y[x] -> -(a*(-1 + E^x*Cos[x] - E^x*Sin[x]))/(2*E^x)}}

This is equivalent to what you obtained with Mathematica 7.0.1.

I suspect that before evaluating the DSolve expression in your 8.0.0
session, you had set y[x] to be the solution, or something like that.


On 1/28/2011 6:14 AM, Bert RAM Aerts wrote:
> When I enter the following in Mathematica 8.0.0 Home Edition:
> DSolve[{y'[x] + y[x] == a Sin[x], y[0] == 0}, y[x], x]
> I get
> DSolve::deqn: Equation or list of equations expected instead of True
> in the first argument {y[x]+(y^\[Prime])[x]==a Sin[x],True}.>>
>
> The initial condition becomes a "True"...
>
> In Mathematica 7.0.1 Home Edition, this same input gives the expected
> output:
> {{y[x] -> -(1/2) a E^-x (-1 + E^x Cos[x] - E^x Sin[x])}}
>
> What am I missing?
>

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Nasser M. Abbasi

unread,
Jan 29, 2011, 5:41:42 AM1/29/11
to

It works here:

In[4]:= $Version
8.0 for Microsoft Windows (64-bit) (November 13, 2010)


In[6]:= DSolve[{y'[x]+y[x]==a Sin[x],y[0]==0},y[x],x]
Out[6]= {{y[x]->-(1/2) a E^-x (-1+E^x Cos[x]-E^x Sin[x])}}


May be you can post the InputForm? may be your ' is not really a ' ?

--Nasser

DrMajorBob

unread,
Jan 29, 2011, 5:42:35 AM1/29/11
to
I thought the Home Version would be the same as any other, but:

DSolve[{y'[x] + y[x] == a Sin[x], y[0] == 0}, y[x], x]

{{y[x] -> -(1/2) a E^-x (-1 + E^x Cos[x] - E^x Sin[x])}}

$Version

"8.0 for Mac OS X x86 (64-bit) (November 6, 2010)"

Bobby

On Fri, 28 Jan 2011 05:14:21 -0600, Bert RAM Aerts
<bert.ra...@gmail.com> wrote:

> When I enter the following in Mathematica 8.0.0 Home Edition:
> DSolve[{y'[x] + y[x] == a Sin[x], y[0] == 0}, y[x], x]
> I get
> DSolve::deqn: Equation or list of equations expected instead of True
> in the first argument {y[x]+(y^\[Prime])[x]==a Sin[x],True}. >>
>
> The initial condition becomes a "True"...
>
> In Mathematica 7.0.1 Home Edition, this same input gives the expected
> output:
> {{y[x] -> -(1/2) a E^-x (-1 + E^x Cos[x] - E^x Sin[x])}}
>
> What am I missing?
>


--
DrMaj...@yahoo.com

Helen Read

unread,
Jan 29, 2011, 7:42:40 PM1/29/11
to


Most likely you originally had set y[0]=0 or something like that.
Clear[y] would have fixed it. Quitting Mathematica clears everything, so
that also fixed the problem.

--
Helen Read
University of Vermont

0 new messages