Differential Equations Day 13 -- Second Order Differential Equations

Overview
Up to this point we've only studied first order differential equations. This means that the highest derivative of the unknown function we've been on the hunt for is the first derivative. [br][br]In this lesson we'll begin studying [b]second order differential equations[/b]. Thus there will now be a second derivative in the differential equation, and our job will be to find a function that satisfies the differential equation.
Second Order, Homogeneous, Constant Coefficient Differential Equations
The first type of second order differential equation we will encounter is called [b]homogeneous with[/b] [b]constant coefficients[/b]. For example, this is a second order differential equation which is homogeneous with constant coefficients:[br][br][math]\frac{d^2y}{dx^2}=3\frac{dy}{dx}-2y[/math][br][br]The adjective [b]homogeneous[/b] means that if we put every summand involving the unknown function [i]y[/i] on the left hand side of the differential equation, and every summand not involving [i]y[/i] on the right hand side, then the right hand side is 0. [br][br]For instance, the above differential equation has three summands involving [i]y[/i]:[br][br][math]\frac{d^2y}{dx^2},3\frac{dy}{dx},-2y[/math][br][br]After moving these three summands to the left side of the differential equation[br][br][math]\frac{d^2y}{dx^2}-3\frac{dy}{dx}+2y=0[/math][br][br]then the right hand side is 0, and so it is homogeneous. Putting the differential equation in this form is known as the [b]standard form[/b] (for second order homogeneous constant coefficient differential equations). [br][br]If there were a constant or a function of [i]x[/i] (the independent variable) remaining on the right hand side, then the differential equation would be called [b]non-homogeneous[/b], and we will see a bit about how to handle these in a later lesson. [br][br]The adjective [b]constant coefficients[/b] means that the coefficients of the summands on the left hand side are constants, or numbers. We won't see much if anything about how to handle second order homogeneous equations without constant coefficients. [br][br]
Checking If a Function is a Solution
Just as was the case in first order differential equations, you only need Algebra and Calculus 1 knowledge to check if a function is a solution of a second order differential equation.[br][br]For instance, let's check that [br][br][math]f\left(x\right)=e^x+e^{2x}[/math][br][br]is a solution of the differential equation[br][br][math]\frac{d^2y}{dx^2}-3\frac{dy}{dx}+2y=0[/math][br][br]First we must calculate the derivative of the function using the monkey rules from calculus 1.[br][br][math]f'\left(x\right)=e^x+2e^{2x}[/math][br][br]Now we must also calculate the second derivative [br][br][math]f''\left(x\right)=e^x+4e^{4x}[/math][br][br]It must be the case that if we substitute the function, [i]f(x)[/i], it's derivative [i]f'(x)[/i], and its second derivative [i]f''(x)[/i] into the differential equation, that equality must be maintained. Let's see:[br][br][math]\frac{d^2y}{dx^2}-3\frac{dy}{dx}+2y=0[/math][br][br][math]\left(e^x+4e^{2x}\right)-3\left(e^x+2e^{2x}\right)+2\left(e^x+e^{2x}\right)=0[/math][br][br][math]e^x+4e^{2x}-3e^x-6e^{2x}+2e^x+2e^{2x}=0[/math][br][br][math]3e^x-3e^x+6e^{2x}-6e^{2x}=0[/math][br][br][math]0=0[/math][br][br]If we had not arrived at a true equation (such as 0=0), then the function [i]f[/i] would NOT have been a solution. On your own, check that the following is a solution of the differential equation no matter what the constants [i][math]c_1[/math][/i] and [i][math]c_2[/math][/i] are. [br][br][math]f\left(x\right)=c_1\cdot e^x+c_2\cdot e^{2x}[/math]
The Algebraic Method for Solving Second Order Homogeneous Constant Coefficient Differential Equations
[list=1][*]Put the equation in standard form [math]a\cdot\frac{d^2y}{dx^2}+b\cdot\frac{dy}{dx}+c\cdot y=0[/math][br][/*][*]Set up the [b]auxiliary equation[/b] [math]ar^2+br+c=0[/math] (note: this is sometimes also called the [b]characteristic equation[/b])[/*][*]Solve the auxiliary (AKA characteristic) equation to obtain two roots [math]r_1[/math] and [math]r_2[/math] using methods from Algebra 1 or the GeoGebra CAS. [/*][*]If [math]r_1\ne r_2[/math] and if the roots are both real numbers, then the [b]general solution[/b] of the differential equation is [math]f(x)=c_1e^{r_1x}+c_2e^{r_2x}[/math][br][/*][*]If [math]r_1=a+bi[/math] and [math]r_2=a-bi[/math] are complex conjugates, then use [b][url=https://en.wikipedia.org/wiki/Euler%27s_formula]Euler's Formula[/url][/b] [math]e^{a+bi}=e^a\left(\cos\left(b\right)+i\cdot\sin\left(b\right)\right)[/math] to obtain the real part of the general solution [math]f(x)=c_1e^{ax}\cos\left(bx\right)+c_2e^{ax}\sin\left(bx\right)[/math]. We will see more about how to handle this in a later lesson. [br][/*][*]If [math]r_1=r_2[/math], then we will see how to handle this in a later lesson. [/*][*]If initial conditions on [i]y[/i] and [i]y[/i]' are present, then use them to obtain a [b]specific solution[/b]. This requires solving a system of equations; use Algebra 1 or the GeoGebra CAS.[/*][*](optional) Check your work by calculating the first and second derivatives and substituting to check for equality. [/*][/list]
Example 1
Let's use the algebraic method to solve the equation from above[br][br][math]\frac{d^2y}{dx^2}-3\frac{dy}{dx}+2y=0;y'\left(0\right)=2;y\left(0\right)=1[/math][br][br][list=1][*]It's already in standard form. [/*][*]The auxiliary (characteristic) equation is [math]r^2-3r+2=0[/math] which we factor [math](r-1)(r-2)=0[/math].[/*][*]The roots are [math]r_1=1[/math] and [math]r_2=2[/math].[/*][*]Since the roots are distinct the general solution is [math]f(x)=c_1e^{1\cdot x}+c_2e^{2\cdot x}=c_1e^x+c_2e^{2x}[/math] which is what we saw above[/*][*]The roots are not complex, so this step is not needed.[/*][*]The roots are not repeated, so this step is not needed. [/*][*]See below.[/*][*]Do this on your own.[/*][/list]To find the specific solution, we need to solve the system of equations[br][br][math]y(0)=1=c_1e^0+c_2e^{2\cdot0}=c_1+c_2[/math][br][math]y'\left(0\right)=2=c_1e^0+2c_2e^{2\cdot0}=c_1+2c_2[/math][br][br]Focusing on the key bits, we need to solve[br][br][math]1=c_1+c_2[/math][br][math]2=c_1+2c_2[/math][br][br]for [math]c_1[/math] and [math]c_2[/math]. [br][br]This is a task from Algebra 1, but also you learn how to solve systems like this in Linear Algebra. [br][br]In this course however, we'll use GeoGebra's CAS to solve systems of linear equations. See the documentation [url=https://wiki.geogebra.org/en/Solve_Command]here[/url]. To solve this system, open the CAS perspective in GeoGebra, and enter this code in a new line:[br][br][code]Solve({1=c_1+c_2, 2=c_1+2c_2},{c_1,c_2})[/code][br][br]I've done this below:
Therefore the specific solution for the differential equation that solves the initial condition as well is[br][br][math]f(x)=0\cdot e^x+1\cdot e^{2x}[/math][br][br]or simply[br][br][math]f\left(x\right)=e^{2x}[/math][br][br]Take a moment, and verify that [math]f(0)=1[/math] and [math]f'(0)=2[/math] to confirm to yourself that the initial condition is in fact satisfied.
Example 2 (on your own)
Try solving this second order homogeneous constant coefficient differential equation with an initial condition:[br][br][math]y''+2y'-8y=0;y\left(0\right)=1;y'\left(0\right)=4[/math]
A Word on Visualizing Second Order Differential Equations
Now that we've seen the algebraic method for solving these equations, you may be wondering if there is something like a slope field that can be used to visualize second order (or higher) differential equations. [br][br]The short answer is: yes. [br][br]The long answer is: it's a bit more complicated than you may be expecting. [br][br]We'll see how to visualize second order and higher order differential equations with higher dimensional slope fields via a method called [b]systemification[/b] in a later lesson. Unfortunately, for now, learning about systemification is more than we should try to chew at the moment. So we'll have to agree to look forward to seeing this in a later lesson.

Information: Differential Equations Day 13 -- Second Order Differential Equations