Differential Equations
Second Order Differential Equations
Sharan Sajiv Menon - September 7th, 2021
Second order differential equations are differential equations that have a second-derivative () in it.
Example: Solve the following Differential Equation:
Solution: The solution is to simply solve for by integrating to find first and then integrating again to find .
Now, integrate again to solve for .
Since we already have a constant C, we have to add another constant D. We can now move on to solving constant-coefficient homogenous equations, to conclude the introduction to Second Order Differential Equations
Constant Coefficent Homogenous Equations
Constant Coefficent Homogenous Equations are of the type
These are one of the easiest type of 2nd order ODEs to solve. The solution is of the form .
The general solution can be found by taking the characteristic polynomial, like this:
Solve the above equation for and you get your solutions. The solutions come in 3 different forms, depending on the discriminant .
- :
- :
- : We get 2 complex roots, .
The solution of made up of 2 parts, and . You get the general solution by combining both parts together: .
For non-homogenous second order ODE’s, where the DE looks like this:
The general solution is of the form .
is the solution to the homogenous DE and is the particular solution. Finding is more complicated, and there are multiple methods. Two of which are the method of undetermined coefficents and variation of parameters, both of which are discussed in later articles.
Example: Solve the following second order differential equation: .
Solution: This is a constant coefficent second order differential equation. Find the characteristic polynomial . Solve for to get . We have 2 real solutions, therefore our solution is . And that’s it, its as simple as that.
Python
Sympy Code: Solve the following Differential Equation
import numpy as np
from sympy import *
x, y = symbols('x y')
f = Function("f")
diffeq = Eq(f(x).diff(x, x) - 3*f(x).diff(x), -9*exp(3*x))
# y''- 3y' = -9e^{3x}
general_solution = dsolve(diffeq, f(x))
# f(x) = C1 + (C1 - 3x)e^{3x}
Sympy gives which you will see is correct as we solve this problem in the “Variation of parameters” section.