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
An exponential solution \( y = C\, e^{\lambda\,t} , \) where C is an arbitrary real number and λ is a complex or real number, to the homogeneous constant coefficient
linear differential equation
is called a modal solution and \( C\, e^{\lambda\,t} \) is called a
mode of the system. If we assign to the left-hand side a linear differential operator
then the exponential function/mode is a solution to the homogeneous linear equation \( L\left[ \texttt{D} \right] y = 0 \) exactly when
λ is a root of the characteristic equation
If the above polynomial equation has a simple complex root \( \lambda = \alpha + {\bf j} \beta , \)
then its complex conjugate \( \overline{\lambda} = \alpha - {\bf j} \beta \) also must be a root because
we consider only real-valued differential equations and all coefficients \( a_0 , a_1 , \cdots , a_n \)
are assumed to be real numbers. In this case, the characteristic polynomial can be factored:
In the above equation, \( L\left( \lambda \right) \) is the real-valued polynomial of degree n
and \( M\left( \lambda \right) \) is the real-valued polynomial of degree n-2. If
the characteristic polynomial has complex pair roots \( \lambda = \alpha \pm {\bf j} \beta \)
of multiplicity m, then it can be factored:
we see that the characteristic equation \( a\,\lambda^2 + b\,\lambda + c =0 \) has two complex conjugate roots
\( \lambda = \alpha \pm {\bf j} \beta . \) So the differential equation
\( L\left[ \texttt{D} \right] y = 0 \) has two exponential solutions
But, because the differential equation \( L\left[ \texttt{D} \right] y = 0 \) has real
coefficients, we were expecting real-valued solutions. This could be achieved only when one arbitrary constant
\( C_2 = \overline{C_1} \) is complex conjugate of another one. So upon introducing two
real arbitrary constants A and B such that \( 2\,C_1 = A + {\bf j} B , \quad
2\,C_2 = A - {\bf j} B , \) we get
that involve only real-valued functions. Here A and B are arbitrary real constants and the real number
β is referred to as pseudo-frequency.
Theorem: If \( z(t) \) is a complex-valued solution to
\[
L\left[ \texttt{D} \right] z = a_n \texttt{D}^n z + a_{n-1} \texttt{D}^{n-1} z + \cdots + a_1 \,\texttt{D} \,z+ a_0 \, z =0 ,
\qquad \texttt{D} = \frac{{\text d}}{{\text d}t} ,
\]
where all coefficients \( a_0 , a_1 , \ldots , a_n \) are real numbers, then the real
and imaginary parts of z are also solutions. ■
Example:
Consider second order differential equation
\[
y'' + a^2 y =0 , \qquad a>0.
\]
The corresponding characteristic equation, \( \lambda^2 + a^2 =0 \)
has two complex conjugate roots \( \lambda = \pm a{\bf j} , \) where j is the unit vector on the complex plane in positive vertical direction.
We use Mathematica to show that the fundamental set of solutions consists of sine and cosine functions.
In this syntax, you define cosine and sine functions by Cos[ ] and Sin[ ].
When you enter the general solution, you can verify that this is indeed the solution.
Example: We verify that the function \( y(x) = C_1 \,\cos 2x + C_2 \,\sin 2x + x^3 -3x/2 \) is a solution of the differential equation
\( y'' + 4\,y = 4\,x^3 .\)
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)