Symbolic Parameters and Inexact Quantities

The differential equations that arise in practice are of two types.

  • Equations in which the only variables are the independent and dependent variables. Thus, all the variables that appear in the first argument to DSolve are also in the second or third arguments.
    • Equations in which there are other symbolic quantities, such as mass or the spring constant. The solution in this case depends on the independent variables, the dependent variables, and the additional symbolic parameters.
    Here is an example of the first type.
    In[1]:=
    Click for copyable input
    Out[1]=
    Here is an example of the second type. This equation has a symbolic parameter .
    In[2]:=
    Click for copyable input
    Out[2]=

    DSolve is equipped to deal with both types of equations. It is extremely useful to have the solution available for all possible values of the parameters in the second type of equation.

    Here is a plot of the previous solution for different values of the parameter .
    In[3]:=
    Click for copyable input
    Out[3]=

    It should be noted that the presence of symbolic parameters can lead to fairly complicated output.

    This is seen in the following example (equation 2.14, page 401 of [K59]).
    In[4]:=
    Click for copyable input
    In[5]:=
    Click for copyable input
    Out[5]=

    However, for some special values of the parameters, the solution might be significantly simpler.

    For these values of and , the solution is much more simple.
    In[6]:=
    Click for copyable input
    Out[6]=

    Occasionally, a solution is valid for most, but not all, values of the parameters.

    Since the input in this example is not valid at , the solution has the same limitation.
    In[7]:=
    Click for copyable input
    Out[7]=
    Of course, there is a simple remedy in this case: setting .
    In[8]:=
    Click for copyable input
    Out[8]=

    In summary, the ability to solve differential equations with symbolic parameters is a powerful and essential feature of any symbolic solver such as DSolve. However, the following points should be noted.

  • The solution might be complicated, and such calculations often require significant time and memory.
  • The answer might not be valid for certain exceptional values of the parameters.
    • The solution might be easy to verify symbolically for some special values of the parameters, but in the general case a numerical verification method is preferable.

    Numerical quantities in the Wolfram Language can be of three types: infinite precision, machine precision, or arbitrary precision. The first type of number is referred to as "exact", while the remaining two types represent incomplete information and are therefore called "inexact".

    Here is a simple example showing all three kinds of numbers.
    In[9]:=
    Click for copyable input
    In[10]:=
    Click for copyable input
    Out[10]=
    In[12]:=
    Click for copyable input
    Out[12]=
    In[13]:=
    Click for copyable input
    Out[13]=
    In[14]:=
    Click for copyable input
    Out[14]=

    Since DSolve is a symbolic solver, the algorithms used by it are primarily based on the assumption of exact input. However, equations that contain inexact quantities are handled by DSolve in the usual way.

    These equations contain the inexact number 3. and 3.`40, respectively.
    In[15]:=
    Click for copyable input
    Out[15]=
    In[16]:=
    Click for copyable input
    Out[16]=

    Inexact input could arise, for example, when the coefficients in the equations are derived from a previous calculation and are known only approximately. In such cases, it might not be practical to convert the equations to exact form, as this could slow down the calculation significantly.

    Here is a system of linear ODEs that all have exact coefficients. Note that even with a fairly small value of , the calculation takes a long time to finish.
    In[17]:=
    Click for copyable input
    Out[17]=
    In[18]:=
    Click for copyable input
    Out[18]=
    This verifies the solution. Since the solution is complicated, a numerical verification method is used.
    In[19]:=
    Click for copyable input
    Out[19]=
    If a single inexact quantity is introduced (in the function ), the solution is returned more quickly.
    In[20]:=
    Click for copyable input
    Out[20]=
    In[21]:=
    Click for copyable input
    Out[21]=
    In[22]:=
    Click for copyable input
    Out[22]=

    Thus, it is often desirable to continue working with inexact quantities even within a symbolic function such as DSolve. However, it should be noted that the solution obtained in such cases could have a certain amount of numerical error and should be checked carefully. It is therefore recommended that if the problem size is not too large (for instance, if there are fewer than five equations), the input should be converted to exact form using the Rationalize function.

    This equation contains inexact quantities.
    In[23]:=
    Click for copyable input
    Out[23]=
    Here the equation is converted to exact form before being solved.
    In[24]:=
    Click for copyable input
    Out[24]=