MATHEMATICA TUTORIAL

# Linear IVPs and BVPs

To begin, consider an initial value problem for a linear first-order ODE.

This is a linear first-order ODE.
Notice that the general solution is a linear function of the arbitrary constant C[1].
 Out[2]=
This finds a particular solution for the initial condition .
 Out[3]=
This verifies that the solution satisfies both the equation and the initial condition.
 Out[4]=
 Out[5]=
Here is the solution to the same problem with the general initial condition .
 Out[6]=
This plots several integral curves of the equation for different values of . The plot shows that the solutions have an inflection point if the parameter lies between and , while a global maximum or minimum arises for other values of .
 Out[7]=
Here is the solution to a linear second-order equation with initial values prescribed for and at .
 Out[9]=
 Out[10]=
This verifies that the solution satisfies the equation and the initial conditions.
 Out[11]=
 Out[12]=
 Out[13]=
Here is a plot of the solution.
 Out[14]=
 Out[15]=
Here is a plot of the solutions for different initial directions. The solution approaches or as according to whether the value of is less than or greater than , which is the largest root of the auxiliary equation for the ODE.
 Out[16]=
Here is a BVP for an inhomogeneous linear second-order equation.
 Out[18]=
 Out[19]=

It should be noted that, in contrast to initial value problems, there are no general existence or uniqueness theorems when boundary values are prescribed, and there may be no solution in some cases.

This problem has no solution because the term with C[2] in the general solution vanishes at both and . Hence there are two inconsistent conditions for the parameter C[1] and the solution is an empty set.
 Out[20]=

The previous discussion of linear equations generalizes to the case of higher-order linear ODEs and linear systems of ODEs.

Here is the solution to an Initial Value Problem (IVP) for a linear ODE of order four.
 Out[22]=
This verifies the solution and the initial conditions.
 Out[23]=
Since this is a fourth-order ODE, four independent conditions must be specified to find a particular solution for an IVP. If there is an insufficient number of conditions, the solution returned by DSolve may contain some of the arbitrary parameters, as follows.
 Out[24]=
Finally, here is the solution of an IVP for a linear system of ODEs.
 Out[28]=
This verifies that the solution satisfies the system and the initial conditions.
 Out[29]=
The solutions , , and are parametrized by the variable and can be plotted separately in the plane or as a curve in space.
 Out[30]=
 Out[31]=

## Tutorial CollectionTutorial Collection

New to Mathematica? Find your learning path »
Have a question? Ask support »