# Preface

This is a
tutorial made solely for the purpose of education and it was designed
for students taking Applied Math 0330. It is primarily for students who
have very little experience or have never used
*Mathematica* before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font,
while *Mathematica* output is in normal font. This means that you can
copy and paste all commands into *Mathematica*, change the parameters and
run them. You, as the user, are free to use the scripts for your needs to learn the *Mathematica* program, and have
the right to distribute this tutorial and refer to this tutorial as long as
this tutorial is accredited appropriately.

Return to computing page for the second course APMA0340

Return to Mathematica tutorial for the second course APMA0330

Return to Mathematica tutorial for the first course APMA0340

Return to the main page for the course APMA0340

Return to the main page for the course APMA0330

Return to Part IV of the course APMA0330

# Differential Equations of higher order

Recall from calculus that derivatives of functions *u(x)* and *y(t)* are
denoted as \( u'(x) \quad \mbox{or} \quad {\text d}u /{\text d}x \) and
\( y' (t) = {\text d}y/ {\text d}t \quad \mbox{or} \quad \dot{y} , \) respectively.
Newton's dot notation (\( \dot{y} \) ) is usually used to represent the
derivative with respect to time. The notation *x* or *t* stands for the
independent variable and will be widely used.
Higher order derivatives have similar notation; for example, *f''* or
\( {\text d}^2 f/{\text d}x^2 \) denotes the second derivatives.

A second order differential equation in the normal form is as follows:
\begin{equation} \label{E41.1}
\frac{{\text d}^2 y}{{\text d} x^2} = F\left( x,y,\frac{{\text
d}y}{{\text d}x} \right) \qquad
\mbox{or} \qquad y'' = F\left( x,y,y' \right) ,
\end{equation}
where *F(x,y,p)* is some given function of three variables. If the
function *F(x,y,p)* is linear in variables *y* and *p* (that is,
\( F(x,ay_1 + by_2 , p) = a\,F(x,y_1 , p) + b\,F(x, y_2 , p) \) for any
constants *a*, *b*, and similar for variable *p*), then
\( y'' = F\left( x,y, y' \right) \) is called linear.

For example, the equation \( y'' = \sin x + 3 y^2 + 2 \left( y' \right)^2 \) is a second order nonlinear differential equation, while the equation \( y'' = (\cos x)\,y \) is a linear one.

A function \( y=\phi (x) \) is a solution of
\( y'' = F\left( x,y, y' \right) \) in some interval
\( a < x < b \) (perhaps infinite), having derivatives up to the second order
throughout the interval, if φ*(x)* satisfies the
differential equation in the interval (a,b), that is,

For many of the differential equations to be considered, it will be found that solutions of \( y'' = F\left( x,y, y' \right) \) can be included in one formula, either explicit

*C*

_{1}and

*C*

_{2}are arbitrary constants. Such a solution is referred to as the

**general solution**of the differential equation of the second order in either explicit or implicit form. Choosing specific values of the constants

*C*

_{1}and

*C*

_{2}, we obtain a particular solution of \( y'' = F\left( x,y, y' \right) . \) All solutions can be so found except, possibly, singular and/or equilibrium solutions.

Second order differential equations are widely used in science and
engineering to model real world problems. The most famous second
order differential equation is Newton's second law of motion,
\( m\,\ddot{y} = F\left( t, y, \dot{y} \right) ,\) which describes a
one-dimensional motion of a particle of mass *m* moving under the
influence of a force *F*. In this equation, *y=y(t)* is the position
of a particle at a time *t*, \( \dot{y} = {\text d}y/{\text d}t \) is its
velocity, \( \ddot{y} = {\text d}^2 y/{\text d}t^2 \) is its acceleration,
and *F* is the total force acting on the particle.

For given two numbers *y*_{0} and *y*_{1}, we impose the
**initial conditions** on *y(x)* in the form

**initial value problem**(IVP for short).

Theorem:
Suppose that *F*, \( \partial F/\partial y, \) and \( \partial F/\partial
y' \) are continuous in a closed 3-dimensional domain Ω in
*xyy'*-space, and the point \( (x_0 ,y_0 , y'_0 ) \) belongs to
Ω. Then the initial value problem \( y'' = F\left( x,y, y' \right) , \quad y( x_0 )=y_0, \quad y' ( x_0 ) = y_1 \)
has a unique solution \( y=\phi (x) \) on an *x*-interval
in Ω containing *x*_{0}. ■

**linear differential equation of the second order**is an equation that can be written as

*g(x)*is a given function, known as driving term, forcing term, or nonhomogeneous term; they all are assumed to be independent of dependent variable

*y*. We will denote by

*x*and/or

*t*the independent variables. Derivatives are usually also denoted by primes (

*y'*or

*y''*); however, it is a custom to use Newton's notation and denote derivatives with respect to time (denoted by

*t*) with dots, so instead of

*y'*we will use \( \dot{y} . \) When a differential equation cannot be written in the above form, then it is called

**nonlinear**. If the function \( a_2 (x) \) has no zeroes on some interval, then we can divide both sides of the equation by \( a_2 (x) \) to obtain its normalized form:

The points where the coefficients
of \( y'' (x) + p (x) \,y' (x) + q (x)\, y(x) = f(x) \) are discontinuous or undefined are
called the **singular points** of the equation. These points are
usually not used in the initial conditions except some cases. For example, the equation \( (x^2 -1)\,y'' +
y=1 \) has two singular points *x=1* and *x=-1* that must be excluded.
If in opposite, the initial condition \( y(1) =y_0 \) is imposed, then the
differential equation dictates that \( y_0 =1 ; \) otherwise, it has no
solution.

Theorem:
Let *p(x)*, *q(x)*, and *f(x)* be continuous functions on an open
interval \( a < x < b. \) Then, for each \( x_0 \in (a,b), \) the initial value
problem

*y*

_{0},

*y*

_{1}.

Equation \( y'' + p(x)y' + q(x) y =f(x) \) is a particular case of the general linear
differential equation of the *n*-th order

*g(x)*is identically zero, the above equations are said to be

**homogeneous**(the accent is on the syllable ``ge''); if

*g(x)*is not identically zero, equations are called

**nonhomogeneous**(or inhomogeneous or driven) and the function

*g(x)*is referred to as the

*nonhomogeneous term*, which is also called the

*input function*or

*forcing function*.

Theorem:
Let functions \( a_0 (x), a_1 (x), \ldots , a_n (x) \) and *f(x)* be
defined and continuous on the closed interval \( a\leq x\leq b \) with
\( a_n (x) \neq 0 \) for \( x\in [a,b] . \) Let
*x*_{0} be such that
\( a\leq x_0 \leq b \) and let y_{0}, y'_{0}, \( \ldots ,\
y^{(n-1)}_0 \) be any
constant. Then in the closed interval [a,b],
there exists a unique solution *y(x)* satisfying the initial value problem:

Example: Let us consider the initial value problem

Solution: To determine the validity interval (= the longest interval in which the given initial value problem is certain to have a unique twice-differentiable solution), we divide both sides of the differential equation by \( x(x^2 -4)=x(x-2)(x+2) \) to obtain \( y'' + p(x)y' + q(x)y =f(x) \) or

*x=0*and

*x=2*. Similarly, the functions \( q (x) = x/(x^2 -4) \) and \( f(x) = \frac{\sin x}{x} \cdot\frac{1}{(x-2)(x+2)} \) fail to be continuous at singular points \( x=\pm 2. \) So we don't want to choose the initial point

*x*

_{0}as 0 or \( \pm 2. \) For example, if x

_{0}= 1, the given initial value problem has a unique solution in the open interval (0,2). If x

_{0}= 3, the given initial value problem has a unique solution in the interval \( 2 < x < \infty . \) The behavior of a solution at these singularities requires additional analysis.

Return to Mathematica page

Return to the main page (APMA0330)

Return to the Part 1 (Plotting)

Return to the Part 2 (First Order ODEs)

Return to the Part 3 (Numerical Methods)

Return to the Part 4 (Second and Higher Order ODEs)

Return to the Part 5 (Series and Recurrences)

Return to the Part 6 (Laplace Transform)

Return to the Part 7 (Boundary Value Problems)