General solutions
[Graphics:../Images/index_gr_4.gif]
[Graphics:../Images/index_gr_5.gif]

Notice that, in addition to specifying the differential equation to solve, you must also specify the function to solve for ([Graphics:../Images/index_gr_6.gif]) and the independent variable (x).  In the solution, C[1] and C[2] are the two arbitrary constants for the general solution to this differential equation.

If all you need to do is see your answer, the above works fine.  However, normally, you want to take this solution and do other things with it (plug numbers into it, graph it, make it into small table decorations, etc.).  The form that Mathematica gives you the answer in here ([Graphics:../Images/index_gr_7.gif]) is what is called a "replacement rule".  On the one hand, this is a very powerful form; you can use it in some very fancy ways.  However, it is a little tricky to use if you aren't pretty familiar with Mathematica.  So, most of the time we will want to simply assign this solution to a function we can work with later:

[Graphics:../Images/index_gr_8.gif]

(You should get in the habit of Clear-ing all new names that you are about to use.  Otherwise, old definitions you have forgotten about could really screw things up...)

[Graphics:../Images/index_gr_9.gif]
[Graphics:../Images/index_gr_10.gif]
[Graphics:../Images/index_gr_11.gif]
[Graphics:../Images/index_gr_12.gif]

This defines a function [Graphics:../Images/index_gr_13.gif] to be our solution function. (The /. is an operator that says "replace all the y[x]'s to the left of this using the rule that follows", which in this case is the solution to the differential equation, which said [Graphics:../Images/index_gr_14.gif].  The First command strips out the extra {}'s in the solution.)

Now, we check our answer:

[Graphics:../Images/index_gr_15.gif]
[Graphics:../Images/index_gr_16.gif]

The above line says "Take the original diffEqn, replace all the y's in it with ySol (our solution) and then simplify the result." If the answer is "True" then the solution satisfies the differential equation.


Converted by Mathematica      July 20, 2003