Solving Initial Value Problems with Mathematica's Solver

Hopefully you recall askingÌýMathematicaÌýto give the syntax of itsÌýDSolveÌýcommand in an earlier laboratory exercise. We're going to be using the command again today, so it would be a good idea to be reminded of the details. I'll save you the trouble of askingÌýMathematicaÌýyourself—here's the result we got before:

?DSolve
DSOLVE Syntax

Notice theÌýthirdÌýform of the command shown: it describes how to solve aÌýlistÌýof equations.

Now consider a very simple initial value problem—one that you could practically solve in your head:

dy/dxÌý= 2x,ÌýÌýy(0) = 5.

Clearly, direct integration gives the general solution:

yÌý=Ìýx2Ìý+ÌýC

and the initial condition soon yieldsÌýCÌý= 5, so the solution to the initial value problem is:

yÌý=Ìýx2Ìý+Ìý5

But, look at the initial value problem again! Isn't it really just aÌýlist of two equations? (A very short list, admittedly.) So the initial value problem, in a sense, fits the second form of theÌýDSolveÌýcommand that we read above. In other words, to solve an initial value problem we simply useÌýDSolveÌýwith a list of equations, the first of which is the differential equation itself, and the remaining equations in the list being the initial conditions.

Go ahead and solve the initial value problem above, usingÌýMathematica, with the command:

DSolve[{y'[x]==2x,y[0]==5},y[x],x]


Mathematica LogoYou can switch toÌýMathematicaÌýby clicking on the button at left. This will open up a fresh notebook for you. Remember that it will take it a while to start up! Don't forget to come back here when you're done! See you in a few minutes.

Welcome back! Let'sÌýmove onÌýto discuss your result..

Ìý

Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.