Differential equations in Mathematica

Jun 2009
696
170
United States
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?
 

Attachments

romsek

MHF Helper
Nov 2013
6,664
3,000
California
You used = instead of == when defining the equation

= is the set operation

== is the equals query
 
  • Like
Reactions: 1 person
Jun 2009
696
170
United States
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.
 

Attachments

Last edited:

romsek

MHF Helper
Nov 2013
6,664
3,000
California
Did you fix the use of parens rather than brackets in the first line?

It looks like that is royally confusing Mathematica.
 
Jun 2009
696
170
United States
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.
 

Attachments

romsek

MHF Helper
Nov 2013
6,664
3,000
California
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 above the DSolve line.

Clipboard01.jpg
 
Last edited: