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
General Solutions
Consider linear differential operator of order n:
Theorem: If coefficients \( a_n (x), a_{n-1} (x), \ldots , a_0 (x) \) are continuous functions on some interval |a,b| and \( a_n (x) \ne 0 , \) then the homogeneous linear differential equation \( L \left[ x, \texttt{D} \right] y =0 , \) which can be written as
Theorem: Let yp be any particular solution of the nonhomogeneous linear n-th order differential equation
As we see from the previous Theorem, the general solution of a nonhomogeneous linear equation consists of the sum of two functions:
If all coefficients of the linear differential operator \( L \left[ \texttt{D} \right] \) are constants, then the general solution of the corresponding homogeneous equation \( L \left[ x, \texttt{D} \right] y = 0 \) exist for all x on real axis. In this case, it is [possible to find the fundamental set of solutions explicitly. Following Leonhard Euler, we seek solutions to the homogeneous linear constant coefficient equation
Example: We consider the second order linear differential operator:
first = s /. roots[[1]]
second = s /. roots[[2]]
root = {first, second}
Soln = Map[Exp[# x] &, root]
Example: We consider the third order linear differential operator:
char[lambda_] =Coefficient[L[x,Function[t,Exp[lambda t]]],Exp[lambda x]]
roots = r /. Solve[char[r] == 0, r]
solns = Map[Function[k, Exp[k x]], roots]
y[x_] = solns.{c2,c1,c3} (
L[x_,y_] =y''[x] -y'[x]- 6y[x]
CharPoly[lambda_] =Coefficient[L[x,Exp[lambda #]&], Exp[lambda x]]
roots =lambda/.Solve[CharPoly[lambda]==0,lambda]
Clear[x,y];
L[x_, y_] = y'''[x] - 2 y''[x] - 5 y'[x] + 6 y[x]
DSolve[L[x, y] == 0, y[x], x]
y[x_] = Expand[y[x] /. %[[1]] ]
basis = Table[Coefficient[y[x], C[i]], {i, 1, 3}]
Factor[Coefficient[L[x, Function[t, Exp[r t]]], Exp[r x]]]
W[x_] = NestList[Function[t, D[t, x]], basis, 2]
Det[W[x]]
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)