# Thread: Differential equations in Mathematica

1. ## Differential equations in Mathematica

I attached a screen shot of my notebook. I'm using the DSolve function for a few simple diff eq to familiarize myself with the software. The first equation I entered worked fine. For some reason any other diff eqs I try to solve in the same notebook won't work. I tried changing the assignment of variables to (t,u) instead of (x,y) for the second diff eq to see if it had anything to do with previous use of (x,y) in the first equation. It still didn't work. What am I missing here?

2. ## Re: Differential equations in Mathematica

You used = instead of == when defining the equation

= is the set operation

== is the equals query

3. ## Re: Differential equations in Mathematica

Originally Posted by romsek
You used = instead of == when defining the equation

= is the set operation

== is the equals query
Thanks for your response. I thought of that and tried it before and something's still wrong, I attached it. Also, when I use == and hit space bar it always combines them into one. I avoided that to leave it as == this time. It's still giving this weird error that I can't make any sense out of.

Edit: Actually, in the screen shot I'm using (t,y) symbols (same is the first diff eq). It thinks I'm trying to call that first function. However, when I use (t,u) instead it still doesn't work. That's the second attachment.

4. ## Re: Differential equations in Mathematica

Did you fix the use of parens rather than brackets in the first line?

It looks like that is royally confusing Mathematica.

5. ## Re: Differential equations in Mathematica

Originally Posted by romsek
Did you fix the use of parens rather than brackets in the first line?

It looks like that is royally confusing Mathematica.
I use brackets for the DSolve function. Strangely, it seems the issue may be the use of "u" as the function. If I replace "u" with "f," it works, which is puzzling.

6. ## Re: Differential equations in Mathematica

Look at the parens you are using for the Cos function. They are highlighted in red. That can't be what you meant to do.

Also looking at this further you must have had u[x] defined at some earlier point. That's why Mathematica is able to
evaluate 1-u'[x]==0 to False.

Try putting Clear[u] above the DSolve line.