Symbolic Math Toolbox    

Several Differential Equations

The function dsolve can also handle several ordinary differential equations in several variables, with or without initial conditions. For example, here is a pair of linear, first-order equations.

The computed solutions are returned in the structure S. You can determine the values of f and g by typing

If you prefer to recover f and g directly as well as include initial conditions, type

This table details some examples and Symbolic Math Toolbox syntax. Note that the final entry in the table is the Airy differential equation whose solution is referred to as the Airy function.

Differential Equation
MATLAB Command


y = dsolve('Dy+4*y = exp(-t)', 'y(0) = 1')


y = dsolve('D2y+4*y = exp(-2*x)', 'y(0)=0', 'y(pi) = 0', 'x')




(The Airy equation)
y = dsolve('D2y = x*y','y(0) = 0', 'y(3) = besselk(1/3, 2*sqrt(3))/pi', 'x')

The Airy function plays an important role in the mathematical modeling of the dispersion of water waves. It is a nontrivial exercise to show that the Fourier transform of the Airy function is exp(iw3/3).


  Single Differential Equation Special Mathematical Functions