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 first course APMA0330
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
We recall the definition of a root multiplicity. A real or complex number α is called a root of multiplicity k of the
polynomial p(x) if there is a polynomial s(x) such that \( s(\alpha ) \ne 0 \)
and \( p(x) = \left( x- \alpha \right)^k s(x) . \) If k=1, then α is called a simple root.
If \( k \ge 2, \) then α is called a multiple root.
We start with constant coefficient linear homogeneous differential equations. Suppose that in a constant coefficient
linear differential operator
\[
L \left[ \texttt{D} \right] y =0 ,
\]
the operator \( L \left[ \texttt{D} \right] = a_n \texttt{D}^n + a_{n-1} \texttt{D}^{n-1} + \cdots
+ a_1 \texttt{D} + a_0 ,\) with \( \texttt{D} = {\text d}/{\text d}x \quad\mbox{and} \quad a_n \ne 0, \) has repeated factors.
That is, the characteristic polynomial \( L \left( \lambda \right) = a_n \lambda^n + a_{n-1} \lambda^{n-1} + \cdots + a_0 \) has repeated roots.
For example, the second order constant coefficient linear differential operator
\( L \left[ \texttt{D} \right] = a\,\texttt{D}^2 + b\,\texttt{D} +c \) has a repeated factor
if and only if the corresponding characteristic equation \( a\,\lambda^2 + b\,\lambda + c =0 \)
has a double root:
\[
\lambda_1 = \lambda_2 = -b/(2a) .
\]
In other words, the quadratic polynomial can be factored \( a\,\lambda^2 + b\,\lambda + c = a \left( \lambda - \lambda_1 \right)^2 \)
if and only if its discriminant \( b^2 - 4ac \) is zero. In this case we have only one solution of exponential form:
To find another linearly independent solution to the above homogeneous equation, we use the method of reduction of
order, credited to Jacob Bernoulli (1655--1705). Setting
The latter can be divided by nonzero term \( a\,y_1 (x) = a\,e^{-bx/(2a)} . \) This yields
\( v'' (x) =0, \) and after integration, we obtain
\( v (x) = C_1 + C_2 x, \) with arbitrary constants C1 and C2.
Finally, substituting for v(x), we define the general solution
Therefore, these two functions form a fundamental set of solutions whenever γ is. ■
This method can be extended for arbitrary case when a linear constant coefficient differential operator has
a multiple \( \left( \texttt{D} - \gamma \right)^m \) of multiplicity m.
Then to such multiple correspond m linearly independent solutions:
The strict derivation of the above statement is made in annihilation section.
Theorem: Let \( a_0 , a_1 , \ldots , a_n \) be n+1 real
(or complex) numbers with \( a_n \ne 0 , \) and y(x) be a n times
continuously differentiable function on some interval |a,b|. Then y(x) is a solution of the n-th order
linear differential equation with constant coefficients
\[
L \left[ \texttt{D} \right] y \equiv a_n \texttt{D}^n y + a_{n-1} \texttt{D}^{n-1} y + \cdots
+ a_1 \texttt{D} \, y+ a_0 \, y =0 , \qquad \texttt{D} = {\text d}/{\text d} x ,
\]
where \( \lambda_1 , \lambda_2 , \ldots , \lambda_m \) are distinct roots of the characteristic polynomial
\( \sum_{k=1}^n a_k \lambda^k \) with multiplicities \( m_1 , m_2 , \ldots , m_m , \)
respectively, and \( P_k (x) \) is a polynomial of degree \( m_k -1 . \)
■
We consider a partcular case of second order differential equation---the motion for
undriven damped harmonic oscillator (coefficients μ and ω0 > 0 are assumed constants):
\[
\ddot{y} + 2\mu\,\dot{y} + \omega_0^2 y =0 ,
\]
subject to the initial conditions
\[
y(0) = y_0 , \qquad \dot{y}(0) = v_0 .
\]
We show that its solution can be obtained from the solution
are two distinct roots of the characteristic equation \( \lambda^2 + 2\mu\,\lambda + \omega_0^2 =0 . \)
Let assume, for simplicity, that \( \eta = \left( \mu^2 - \omega_0^2 \right)^{1/2} \ge 0 , \) that is
\( \mu \ge \omega_0 . \) Then rewriting the solution in the equivalent form:
Example: Let us consider the differential equation
\[
y'' -4\,y' +4\,y =0 .
\]
The characteristic equation \( \lambda^2 - 4\,\lambda +4 = \left( \lambda -2 \right)^2 =0 \)
has a double root \( \lambda =2 . \) Hence we get one exponential solution
\( y_1 (x) = e^{2x} \) and another one is a multiple of the latter:
\( y_2 (x) = x\,e^{2x} . \) So the general solution becomes
The characteristic polynomial \( \lambda^2 + 6\,\lambda +9 = = \left( \lambda +3 \right)^2 \)
has one double root \( \lambda =-3 . \) Therefore, the general solution of the given homogeneous differential equation becomes
\[
y(x) = C_1 e^{-3x} + C_2 x\, e^{-3x} .
\]
To satisfy the initial conditions, we have to choose arbitrary constants that are solutions of the system of equations:
Example: Let us consider the fourth order linear differential operator:
\[
L \left[ \texttt{D} \right] y \equiv \texttt{D}^4 y - 8\, \texttt{D}^{3} y + 18\,
\texttt{D}^2 \, y -27 \, y =0 , \qquad \texttt{D} = {\text d}/{\text d} x .
\]
has one simple root \( \lambda =-1 \0 and one triple root \( \lambda =3 . \)
Therefore, the general solution to the fourth order differential equation \( L \left[ \texttt{D} \right] y =0 \)
is
The reduction of order technique, which applies to
arbitrary linear differential equations, allows us to go
beyond equations with constant coefficients,
provided that we
already know one solution. For sake of clarity, we start with a second order linear differential equation with
variable coefficients:
\[
y'' +p(x)\,y' +q(x)\,y =0 ,
\]
where p(x) and q(x) are some continuous functions on some interval |a,b|. Suppose that we know one
its solution \( y = y_1 (x) \ne 0. \) This means that
Then we seek another linearly independent solution in the form \( y(x) = v(x)\, y_1 (x) , \)
where unknown function v(x) s determined upon substitution of this form into the given differential equation.
First, we use the product rule to obtain
This is a second order differential equation where dependent function is missing. If we set \( u= v' , \)
we reduce it to a first order differential equation:
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)