Differential EquationsIntroduction to Systems1 of 3
Introduction to Systems · 1
First-Order Systems
When two or more quantities change at the same time and affect each other, a single differential equation can no longer track them on its own, and we need a system of differential equations.
1
Systems of First-Order Equations and Arrow Fields
A system of first-order equations gives the first derivatives x′ and y′ in terms of the current state (x,y):
x′y′=x−2y=3x+y
Because y appears in the x′ equation and x appears in the y′ equation, the two rates of change depend on each other, and we track (x,y) as a single point moving across a 2D grid.
Systems of First-Order Equations and Arrow Fields
Text solution
Find the horizontal velocity x′ at (2,1)Substitute x=2 and y=1 into the first equation to see how fast the point moves left or right at this instant.
x′=2−2(1)=0
Find the vertical velocity y′ at (2,1)Substitute x=2 and y=1 into the second equation to see how fast the point moves up or down at the same instant.
y′=3(2)+1=7
At the point (2,1), the point is not moving horizontally (x′=0) and is moving straight up at a speed of 7 (y′=7).
For the system x′=x−2y,y′=3x+y, every point (x,y) on the grid has its own velocity arrow (x′,y′) and a path that follows the arrows from that point.
Where the point sits right now sets its velocity arrow from the two equations, and the solution path simply follows those arrows forward.
2
Checking a Solution to a System
As a point follows the arrows across the 2D grid over time t, its coordinates trace out a pair of functions, x(t) and y(t). Let's check whether the pair of functions
x(t)=e−3t,y(t)=−2e−3t
is a solution to the system
x′y′=x+2y=4x−y
Checking a Solution to a System
{x′y′=x+2y=4x−y
x(t)y(t)=e−3t=−2e−3t
a solution?
Text solution
Differentiate x(t) and y(t)Find the first derivative of each function so we can compare them with the right-hand sides of the system.
x′(t)=−3e−3t,y′(t)=6e−3t
Substitute into the x′ equationPlug x(t) and y(t) into x+2y to check that the right side matches x′(t)=−3e−3t.
x+2y=e−3t+2(−2e−3t)=e−3t−4e−3t=−3e−3t
Substitute into the y′ equationPlug x(t) and y(t) into 4x−y to check that the second equation also matches y′(t)=6e−3t.
4x−y=4e−3t−(−2e−3t)=4e−3t+2e−3t=6e−3t
Because x′=x+2y and y′=4x−y both hold at the same time, the pair x(t)=e−3t,y(t)=−2e−3t is a solution to the system.
3
Turning a Second-Order Equation into a First-Order System
Following arrows works on a first-order system because the current state tells us where to go next, but that doesn't work on a single second-order equation like the damped spring initial value problem
x′′+3x′+2x=0,x(0)=1,x′(0)=0
Knowing only the position x=1 on a 1D line does not tell us which way the weight is moving or what its acceleration x′′ is. To get an arrow field back, we rewrite this single second-order equation in First-Order Form by making the velocity v=x′ its own state variable alongside position x.
Turning a Second-Order Equation into a First-Order System
Text solution
Isolate the highest derivative x′′Move the lower-order terms to the right side so acceleration is written in terms of position and velocity.
x′′=−2x−3x′
Make the first derivative a new variable vTrack both position x and velocity v=x′ as the two coordinates of our state.
x=position,v=x′
Write the first derivative of each state variableThe rate of change of x is v by definition, and the rate of change of v is x′′, where we replace x′ with v in our isolated equation.
x′x′′v′=v=−2x−3x′v
Rewrite the initial conditions as a starting point (x(0),v(0))Replace x′(0)=0 with v(0)=0 to get the starting coordinates on the 2D position-velocity grid.
x(0)=1,v(0)=0
In First-Order Form, the spring problem becomes the system x′=v,v′=−2x−3v starting at (1,0), where the starting arrow (x′,v′)=(0,−2) makes the velocity negative (v<0) right after the start, and following the arrows from there, the path approaches (0,0): the weight comes back toward rest at position 0 without passing it.
For the damped spring x′′+3x′+2x=0, starting at the same position x=1 with different initial velocities v traces out different paths on the (x,v) grid, with the weight moving right whenever the path is in the upper half of the grid (v>0) and left whenever it is in the lower half (v<0).
From the same starting position, each starting velocity traces a different path on the grid, moving the weight right in the upper half and left in the lower half.
4
Converting Higher-Order Equations into First-Order Form
For equations with third or higher derivatives, we use numbered state variables x1,x2,x3,… for the function and each of its derivatives up to one order below the highest derivative. Let's convert the third-order initial value problem
Isolate the highest derivative y′′′Move the lower-order terms to the right side in order from y up to y′′, and divide every term by the leading coefficient 2.
Name the state variables up to one order below y′′′Set x1,x2,x3 equal to y,y′,y′′.
x1=y,x2=y′,x3=y′′
Write the derivative of each state variableThe derivative of each variable is simply the next variable on the list until x3′=y′′′, where we substitute x1,x2,x3 into the isolated equation for y′′′.
Match the initial conditions to x1(0),x2(0),x3(0)Copy the starting values of y,y′,y′′ directly to their new variable names.
x1(0)=3,x2(0)=−1,x3(0)=5
The third-order equation is now a system of three first-order equations starting at (3,−1,5), where the first two equations just set each derivative equal to the next variable on the list and only the last equation uses the rearranged differential equation.
5
Packing and Unpacking Matrix Form
To avoid writing the variable names x1,x2,x3 over and over, we can pack a linear first-order system into Matrix Form, or use row-by-column multiplication to unpack a matrix system like
[x′y′]=[42−13][xy]+[et−5]
back into individual equations.
Packing and Unpacking Matrix Form
x1′x2′x3′=x2=x3=−2x1+5x2−4x3+cos(t)
x1′x2′x3′=?
Text solution
Line up the state variables in columns with 0s for missing termsWrite our three-equation system from the previous example so every row has a spot for x1,x2,x3 and the forcing term in the same order.
Pack the coefficients and initial values into matricesPut the grid of coefficients in front of the column of state variables, add the column of forcing terms at the end, and stack the initial conditions into a column.
Unpack a matrix system using row-by-column multiplicationFor the 2×2 example, multiply across each row of [42−13] and down the column [xy], then add the matching forcing term from [et−5].
x′y′=4x−y+et=2x+3y−5
The matrix form and the separate equations are two ways of writing the exact same system: each row of the matrix holds the coefficients for one first-order equation.
6
Linear vs. Nonlinear First-Order Systems
Every system we packed into a matrix so far was linear, meaning the state variables only appear to the first power multiplied by numbers or functions of t. What happens when we convert an equation with a squared term like
y′′+3ty′−y2=et
into First-Order Form and try to pack it into a matrix?
Linear vs. Nonlinear First-Order Systems
y′′+3ty′−y2=et
First-Order Form?
Matrix Form?
Text solution
Isolate y′′ and convert to First-Order Form using x1=y,x2=y′Turning derivatives into state variables works the exact same way whether the equation is linear or nonlinear.
y′′x1′x2′=y2−3ty′+et=x2=x12−3tx2+et
Check how the state variables x1 and x2 appear in each termSeparate the terms that only involve time t or the first power of a state variable from any term where a state variable is raised to a power, multiplied by another state variable, or inside a function.
x2′=nonlinear in x1x12−linear in x23tx2+forcing term in tet
Because the state variable x1 is squared, the system x1′=x2,x2′=x12−3tx2+et is nonlinear: it still defines a valid first-order arrow field, but we stop at the first-order equations because it cannot be written as a matrix of t-only functions multiplying [x1x2].
7
Coupled Second-Order Systems in First-Order Form
Some physical problems start out as two second-order equations that depend on each other, such as two carts connected by springs with positions x and y:
x′′y′′=−5x+2y=2x−2y
To predict what both carts do next, we need four pieces of information at any instant: both positions (x,y) and both velocities (x′,y′). So we convert the pair of second-order equations into a system of four first-order equations.
Coupled Second-Order Systems in First-Order Form
Text solution
Name a position variable and a velocity variable for each cartSet x1,x2 equal to x and x′, and set x3,x4 equal to y and y′.
x1=x,x2=x′,x3=y,x4=y′
Write the first derivative of each of the four state variablesThe derivatives of the position variables are their velocity variables (x1′=x2 and x3′=x4), while the derivatives of the velocities (x2′=x′′ and x4′=y′′) come from substituting x1=x and x3=y into the two second-order equations.
The two coupled second-order equations become a system of four first-order equations tracking the full state (x1,x2,x3,x4)=(x,x′,y,y′).
Key concepts
First-order systems and solutions
A first-order system like x′=x−2y,y′=3x+y gives a velocity arrow (x′,y′) at every point (x,y) on the grid. A pair of functions x(t),y(t) is a solution only if substituting them makes every equation in the system hold at the same time.
Converting higher-order equations into First-Order Form
Isolate the highest derivative first, then name one state variable for the function and each derivative up to one order below the highest:
For a single nth-order equation like 2y′′′+8y′′−10y′+4y=2cos(t), isolating y′′′=−2y+5y′−4y′′+cos(t) and setting x1=y,x2=y′,x3=y′′ gives x1′=x2 and x2′=x3, with the isolated equation in the last equation: x3′=−2x1+5x2−4x3+cos(t).
For a coupled second-order system like x′′=−5x+2y,y′′=2x−2y, give each variable its own position-velocity pair (x1=x,x2=x′ and x3=y,x4=y′). This gives two separate pairs of equations: x1′=x2 with x2′=−5x1+2x3, and x3′=x4 with x4′=2x1−2x3 (never x2′=x3).
When to pack into Matrix Form (and when not to)
Check what happens to the state variables x1,x2,… on the right-hand side:
Linear in the state variables (even when multiplied by functions of t like −3tx2 or with forcing terms like cos(t)): line up the x1,x2,x3 columns with 0s for missing variables, and pack the coefficients into a matrix multiplying the state column:
Nonlinear in any state variable (such as x12,sin(x1),ex2, or x1x2 in x2′=x12−3tx2+et): do not pack into Matrix Form. Stop right at the first-order equations, because the coefficient matrix can only hold numbers and functions of t, never the state variables themselves.
8
Practice
1
For the system x′=2x−3y,y′=x−4y, find (x′,y′) at the instant when the state is at (3,2), and describe how the point is moving on the 2D grid at that instant.
Plug x=3 and y=2 into each equation (watch out for swapping the coordinates into x=2,y=3, which gives (−5,−10)).
Substitute x=3 and y=2 into both equations; which component of (x′,y′) gives left-right motion and which gives up-down motion?
Plug x=3 and y=2 into each equation (watch out for swapping the coordinates into x=2,y=3, which gives (−5,−10)):
x′y′=2(3)−3(2)=0=3−4(2)=−5
Because x′=0 is horizontal velocity and y′=−5 is vertical velocity (don't read (0,−5) as moving left just because −5 is negative), at (3,2) the point is not moving left or right and is moving straight down at a speed of 5.
2
For the system x′=5x−y,y′=4x, determine whether each pair of functions is a solution: (a) x(t)=e2t,y(t)=3e2t and (b) x(t)=e4t,y(t)=e4t.
Differentiate x(t) and y(t) first using the chain rule, then test whether both equations hold before deciding.
(a)Differentiating gives x′(t)=2e2t and y′(t)=6e2t (don't forget to multiply by 2 from the chain rule, which would leave x′=e2t). In the first equation, x′=2e2t and 5x−y=5e2t−3e2t=2e2t, which matches. Don't stop after the first equation and say (a) is a solution. Check the second equation too: y′=6e2t while 4x=4e2t. Because the second equation fails, (a) is not a solution.
(b)Differentiating gives x′(t)=4e4t and y′(t)=4e4t. In the first equation, x′=4e4t and 5x−y=5e4t−e4t=4e4t; in the second equation, y′=4e4t and 4x=4e4t. Both hold, so (b) is a solution.
3
Unpack the matrix system
[x′y′]=[−2150][xy]+[0sin(t)]
into two separate first-order differential equations.
Go across each row of [−2150] and down the column [xy], then add the matching entry from the forcing column at the end.
Multiply each row of the matrix by the column [xy] (don't multiply down the matrix columns, which gives x′=−2x+y, and don't attach y to sin(t) as y′=x+ysin(t); the coefficient of y in the bottom row is 0, and sin(t) is added afterward):
x′y′=−2x+5y=x+sin(t)
4
Convert the third-order initial value problem 3y′′′−6y′′+9y=3et,y(0)=2,y′(0)=0,y′′(0)=−4 into First-Order Form using x1=y,x2=y′,x3=y′′, and then write the system and initial conditions in Matrix Form.
Isolate y′′′ first by moving −6y′′+9y to the right and dividing by 3; when you line up the columns for the matrix, check which derivative is missing from the equation.
Isolate y′′′ by moving the lower-order terms to the right and dividing by 3 (copying coefficients before isolating and dividing by 3 gives the wrong bottom row [9,0,−6]):
y′′′=−3y+2y′′+et
Substituting x1=y,x2=y′,x3=y′′ gives the first-order system x1′=x2,x2′=x3,x3′=−3x1+2x3+et with x1(0)=2,x2(0)=0,x3(0)=−4.
When packing the bottom row of the matrix, notice that y′ (x2) is missing, so put 0 in the second spot (writing [−3,2,0] instead of [−3,0,2] multiplies 2 by x2=y′ instead of x3=y′′):
Convert both (a) y′′+t2y′−cos(t)y=ln(t) and (b) y′′+4y′+sin(y)=0 into first-order systems using x1=y,x2=y′. State which system is linear and write only that system in Matrix Form.
After isolating y′′ in both equations, look at what is inside t2,cos(t),ln(t), and sin(y): is it the time variable t or a state variable x1,x2?
Isolating y′′ and substituting x1=y,x2=y′ gives:
(a)x1′=x2,x2′=cos(t)x1−t2x2+ln(t)
(b)x1′=x2,x2′=−sin(x1)−4x2System (a) is linear because the state variables x1 and x2 only appear to the first power multiplied by functions of t (don't let t2,cos(t), and ln(t) trick you into calling (a) nonlinear, since those functions only act on the time variable t), whereas (b) is nonlinear because the state variable x1 is inside sin(x1) (don't try to put (b) into a matrix like [0−sin(1)1−4]). Matrix Form for (a):
[x1′x2′]=[0cos(t)1−t2][x1x2]+[0ln(t)]
6
Convert the coupled second-order system x′′+2x′=−4x+3y,y′′=4x−3y+cos(t) into a system of four first-order equations using x1=x,x2=x′,x3=y,x4=y′, and write the system in Matrix Form.
Isolate x′′ in the first equation first; then check what the derivative of x2=x′ is, remembering that x3=y starts the pair for y and is not x′′.
First subtract 2x′ from both sides of the first equation to get x′′=−4x−2x′+3y (moving +2x′ across the equals sign without flipping its sign leaves +2x2 instead of −2x2).
Then write the derivative of each state variable (don't write x2′=x3 out of habit from single third-order equations; here x2=x′, so x2′=x′′, while x3=y starts the pair for y):