Differential Equations Day 14 -- Complex Roots of Homogeneous Constant Coefficient Second Order Differential Equations & Introduction to Systemification

Overview
In the last lesson we saw how to solve homogeneous constant coefficient second order differential equations. We only covered the case that the roots [math]r_1[/math] and [math]r_2[/math] of the auxiliary (AKA characteristic) equation were distinct and real. In this lesson we'll see how to handle the case in which the roots are complex conjugates. We'll also get a first look at the process of systemification for visualizing and numerically estimating second order and higher order differential equations.
Review
Here is the method from the previous lesson for your convenience:[br][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][/*][*]Set up the [b]auxiliary equation[/b] [math]ar^2+br+c=0[/math] (note: this is sometimes 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 or [url=https://www.wolframalpha.com/]wolframalpha.com[/url].[/*][*]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]. [b]This is what we'll be focusing on in this lesson![/b][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]. You will need to solve a system of equations using Algebra 1 or GeoGebra CAS.[/*][*](optional) Check your work by calculating the first and second derivatives and substituting to check for equality. [/*][/list]We'll be focusing on step 5 in which we handle the case of complex roots.
Complex Roots of the Auxiliary (AKA Characteristic) Equation in Practice
In practice, this is no harder than using a template. [br][br]If a pair of complex conjugate roots is obtained from the auxiliary (AKA characteristic) equation, [math]r_1=a+bi[/math] and [math]r_2=a-bi[/math] then the general solution is gotten by simply filling in the template[br][br][math]f(x)=c_1e^{ax}\cos\left(bx\right)+c_2e^{ax}\sin\left(bx\right)[/math][br][br]Let's see this in an example[br][br][math]\frac{d^2y}{dx^2}-4\cdot\frac{dy}{dx}+13y=0[/math][br][br][list=1][*]It's already in standard form.[/*][*][math]r^2-4r+13=0[/math][/*][*]Use the quadratic formula: [math]r_1=2-3i[/math] and [math]r_2=2+3i[/math][br][/*][*]Does not apply[/*][*]The template says the general solution is [math]f(x)=c_1e^{2x}\cos\left(3x\right)+c_2e^{2x}\sin\left(3x\right)[/math][br][/*][*]The roots are distinct, so this does not apply.[/*][*]No initial condition, so this does not apply.[/*][*]Check out the GeoGebra applet below in which [code]f[/code] has been declared, GeoGebra was used to calculate [code]f'[/code] and [code]f''[/code] with [code]derivative(f)[/code] and [code]derivative(f,2)[/code], and the differential equation was checked to be solved with [code]simplify(f''-4f'+13f)[/code][/*][/list]As we can see, [code]g=simplify(f''-4f'+13f)[/code]is equal to 0, the right hand side of the second order differential equation in standard form, meaning that [code]f[/code] is in fact a solution of the second order differential equation we started with. This is good!
If the last function in the algebra pane, [code]g(x)=simplify(f''-4f'+13f)[/code], was [i]not[/i] equal to 0, then this would mean that we made a mistake, and that the function [code]f[/code] was [b]not[/b] a solution of the differential equation. We'd need to go back and take a close look at our work, and find where our mistake was.
Complex Roots of the Auxiliary (AKA Characteristic) Equation in Principle
A very good question would be: but [i]WHY[/i] does this work?[br][br]The answer has to do with something called [url=https://en.wikipedia.org/wiki/Euler%27s_formula]Euler's Formula[/url] which is a well-known tool for resolving complex exponents. It's the formula that provides the explanation for all those tattoos you see that [math]e^{i\pi}=-1[/math]. I encourage you to read about it at the above link, but all you really need to know is that it provides a way of resolving the case where [i]e [/i]is raised to a complex number:[br][br][math]e^{a+bi}=e^a\left(\cos\left(b\right)+i\cdot\sin\left(b\right)\right)[/math][br][br]So how does this work in the case of generating a general solution of a second order homogeneous constant coefficient differential equation? [br][br]Answer: In step 4 of the algebraic method for homogeneous constant coefficient second order differential equations, you were told that if the roots [math]r_1[/math] and [math]r_2[/math] are not equal, then you should form the general solution [br][br][math]f(x)=c_1e^{r_1x}+c_2e^{r_2x}[/math][br][br]It turns out that you just use this formula even if the roots are complex conjugates. Just put the roots in place of [math]r_1[/math] and [math]r_2[/math], apply Euler's Formula, and then simplify using the complex number rules you may have learned in Algebra 2. The only real "tricks" you need to know about working with complex numbers is that [math]i^2=-1[/math] and otherwise just treat [math]i[/math] like any old variable such as [i]x[/i], [i]y[/i], or [i]z[/i], and combine like terms when you can.[br][br]To spell it out a bit more, if [math]r_1=a+bi[/math] and [math]r_2=a-bi[/math], then:[br][br][math]f(x)=c_1e^{r_1x}+c_2e^{r_2x}[/math][br][br][math]f(x)=c_1e^{\left(a_{ }+bi\right)x}+c_2e^{\left(a-bi\right)x}[/math][br][br][math]f(x)=c_1e^{ax+bix}+c_2e^{ax-bix}[/math][br][br][math]f(x)=c_1e^{ax+bxi}+c_2e^{ax-bxi}[/math][br][br][math]f(x)=c_1e^{ax}e^{bxi}+c_2e^{ax}e^{-bxi}[/math][br][br][math]f(x)=c_1e^{ax}\left(\cos\left(bx\right)+i\sin\left(bx\right)\right)+c_2e^{ax}\left(\cos\left(-bx\right)+i\sin\left(-bx\right)\right)[/math][br][br][math]f(x)=c_1e^{ax}\left(\cos\left(bx\right)+i\sin\left(bx\right)\right)+c_2e^{ax}\left(\cos\left(bx\right)-i\sin\left(bx\right)\right)[/math] This is true because cos() is an even funtion, and sin() is an odd function.[br][br][math]f(x)=\left(c_1+c_2\right)e^{ax}\left(\cos\left(bx\right)\right)+i\left(c_1-c_2\right)e^{ax}\left(\sin\left(bx\right)\right)[/math][br][br]Thus if we carefully select these values: [math]c_1=1/2[/math], [math]c_2=1/2[/math], then[br][br][math]f(x)=e^a\cos\left(bx\right)[/math][br][br]is seen to be one solution of the second order homogeneous constant coefficient differential equation. [br][br]And furthermore, if we carefully select [math]c_1=-\frac{1}{2}i[/math] and [math]c_2=\frac{1}{2}i[/math] then [br][br][math]f(x)=e^a\sin\left(bx\right)[/math][br][br]is seen to be another solution of the second order homogeneous constant coefficient differential equation. [br][br]Thus any combination of these two functions is a solution, and so[br][br][math]f(x)=c_3e^{ax}\cos\left(bx\right)+c_4e^{ax}\sin\left(bx\right)[/math][br][br]is also a solution. [br][br]But hey! This is effectively what the template was that you were given (except with [math]c_3[/math] instead of [math]c_1[/math] and [math]c_4[/math] instead of [math]c_2[/math]), and so, this little calculation proves that the template provided in the algebraic method is a solution of the differential equation. [br][br][b]Note: you DO NOT need to repeat this calculation; just use the template from the steps when you're working on solving one of these. [br][/b]
An Introduction to Systemification
A common method for visualizing and numerically estimating solutions to second order differential equations is a process called [b]systemification[/b]. It's a little tricky, so bear with it. It's normal to not quite get it at first. The process involves a rather odd set of steps renaming variables to transform the higher order differential equation into a system of first order differential equations. We'll get a first look at it today, but come back to it in future lessons to gain additional familiarity.[br][br]In this process, one introduces new variables, [math]x_1=y[/math]and [math]x_2=y'[/math] to turn the second order differential equation into a system of first order differential equations. The mathematically correct way to think of these two new variables is that each of them is a function of a single independent variable. In particular, it's true that that [math]x_1(x)=y(x)[/math] and [math]x_2(x)=y'(x)[/math]. However, in practice many people simply think of them as new variables. Note: for third order differential equations one must introduce another variable [math]x_3=y''[/math], but we'll worry about that later.[br][br]This process is exceedingly tricky to get one's head around in the abstract, so let's look at a specific differential equation where we can see what's going on a little bit more easily. Let's use the differential equation from above which we already found the general solution of:[br][br][math]y''-4\cdot y'+13y=0[/math][br][br]The first step is to introduce the new variables: [math]x_1=y[/math]and [math]x_2=y'[/math]. Remember: you can think of each [math]x_1[/math] and [math]x_2[/math] as a new function of an independent variable, and so what we're saying is that [math]x_1(x)=y(x)[/math] and [math]x_2(x)=y'(x)[/math] if it helps you![br][br]Now differentiate [math]x_1[/math]:[br][br][math]x_1'=y'[/math][br][br]But hey! [math]y'[/math] was [math]x_2[/math], so really[br][br][math]x_1'=x_2[/math][br][br]This is the first equation of the system of first order differential equations we will be producing. [br][br]To produce the second equation of the system of first order differential equations, differentiate [math]x_2[/math]:[br][br][math]x_2'=y''[/math][br][br]But hey! We have an equation for [math]y''[/math]: the second order differential equation we're studying, [math]y''-4y'+13y=0[/math]. If we solve our second order equation for [math]y''[/math], and introduce the other side into [math]x_2'=y''[/math], then:[br][br][math]x_2'=4y'-13y[/math][br][br]But hey! Using our new variables, [math]y'=x_2[/math] and [math]y=x_1[/math], so[br][br][math]x_2'=4x_2-13x_1[/math][br][br]Reordering the summands so the [math]x_1[/math] term is first yields:[br][br][math]x_2'=-13x_1+4x_2[/math][br][br]Putting the above equations in [math]x_1[/math] and [math]x_2[/math] together we get the following system of first order differential equations:[br][br][math]x_1'=0x_1+1x_2[/math][br][math]x_2'=-13x_1+4x_2[/math][br][br]This system is the [b]systemification[/b] of the second order differential equation we started with.[br][br]This systemification might seem like a pointless renaming of the variables and a recasting of the second order differential equation into two first order differential equations, but it turns out this is [i]the unique way[/i] to both visualize and numerically estimate higher order differential equations. It's tremendously important in a wide variety of fields, including meteorology and physics.[br][br]To visualize the systemification, replace [math]x_1[/math] with [math]x[/math], and replace [math]x_2[/math] with [math]y[/math] and generate the slope field of [math]x_2'/x_1'[/math]. In the case of our specific differential equation, this would be:[br][br][code]slopefield((-13x+4y)/(0x+1y))[br][/code][br]Check it out below![br]
Now you're probably wondering: how do I check my solution by visualizing that it matches this slope field? The answer is that we need to plot a parametric curve whose [i]x[/i] coordinate is [math]x_1=y=f\left(x\right)[/math], our solution function, and whose [i]y[/i] coordinate is [math]x_2=y'=f'\left(x\right)[/math], our solution functions' derivative. The independent variable [i]x [/i]of the solution function[i] y[/i] can be thought of as time, and moves the parametric curve forward. [br][br]This can be accomplished by typing the solution function into GeoGebra as [code]f(x)[/code], using GeoGebra to calculate its derivative, [code]f'(x)[/code], and then using the following code to plot the parametric curve:[br][code][br]curve(f(t),f'(t),t,0,10)[/code][br][br]You can read more about the [url=https://wiki.geogebra.org/en/Curve_Command]curve command at this link[/url]. [br][br]I've gone ahead and created the parametric curve with the code from above in the applet below for you to inspect. Try adjusting the constants to explore other elements of the general solution. Note how ALL the elements of the general solution match the slope field! This is much like we saw in first order differential equations, but with a new twist!
The function f is a solution to the second order differential equation if and only if the parametric curve is an exact match of the slope field.[br][br]We'll return to this in the next lesson, to gain more familiarity with this unusual process and concept, and also to see how to incorporate the concept of initial conditions on [i]y[/i] and [i]y[/i]' into this process as well!

Information: Differential Equations Day 14 -- Complex Roots of Homogeneous Constant Coefficient Second Order Differential Equations & Introduction to Systemification