First Order Linear Differential Equations

You might like to read about Differential Equations
and Separation of Variables first!

A Differential Equation is an equation with a function and one or more of its derivatives:

Differential equation y plus dy over dx equals 5x
Example: an equation with the function y and its derivative dydx  

Here we'll look at solving a special class of Differential Equations called First Order Linear Differential Equations

First Order

They are "First Order" when there's only dydx , not d2ydx2 or d3ydx3 and so on

Linear

A first order differential equation is linear when it can be made to look like this:

dydx + P(x)y = Q(x)

Where P(x) and Q(x) are functions of x.

To solve it there's a special method:

And we also use the derivative of y=uv (see Derivative Rules (Product Rule) ):

dydx = udvdx + vdudx

Steps

Here's a step-by-step method for solving them:

Let's try an example to see:

Example 1: Solve this:

dydxyx = 1

First, is this linear? Yes, as it is in the form

dydx + P(x)y = Q(x)
where P(x) = −1x and Q(x) = 1

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this:dydxyx = 1 Becomes this:udvdx + vdudxuvx = 1

Step 2: Factor the parts involving v

Factor v:u dvdx + v( dudxux ) = 1

Step 3: Put the v term equal to zero

v term equal to zero: dudxux = 0 So: dudx = ux

Step 4: Solve using separation of variables to find u

Separate variables: duu = dxx Put integral sign: duu = dxx Integrate:ln(u) = ln(x) + C Make C = ln(k):ln(u) = ln(x) + ln(k) And so:u = kx

Step 5: Substitute u back into the equation at Step 2

(Remember v term equals 0 so can be ignored):kx dvdx = 1

Step 6: Solve this to find v

Separate variables:k dv = dxx Put integral sign: k dv = dxx Integrate:kv = ln(x) + C Make C = ln(c):kv = ln(x) + ln(c) And so:kv = ln(cx) And so:v = 1k ln(cx)

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv:y = kx 1k ln(cx) Simplify:y = x ln(cx)

And it produces this nice family of curves:

Family of curves for y equals x ln(cx) for different values of c
y = x ln(cx)
for various values of c

Try different values of c here:
../algebra/images/function-graph.js?fn0=x*ln%28cx%29&xmin=-2&xmax=4&ymin=-2.2&ymax=2.2&aval=0.2480&varc=0.6|0|2

What's the meaning of those curves?

They are the solution to the equation dydxyx = 1

In other words:

Anywhere on any of those curves
the slope minus yx equals 1

Let's check a few points on the c=0.6 curve:

Graph of y equals x ln(0.6x) with points A, B, and C marked for slope verification

Estmating off the graph to 1 decimal place only:

Point x y Slope (dydx) dydxyx
A 0.6 −0.6 0 0 − −0.60.6 = 0 + 1 = 1
B 1.6 0 1 1 − 01.6 = 1 − 0 = 1
C 2.5 1 1.4 1.4 − 12.5 = 1.4 − 0.4 = 1
Can you get better results using the graph here?
../algebra/images/function-graph.js?fn0=x*ln%280.6*x%29&xmin=-3.840&xmax=3.480&ymin=-2.380&ymax=2.500&aval=0.2480&pts=-1|-1~2|1

Perhaps another example to help you? Maybe a little harder?

Example 2: Solve this:

dydx3yx = x

First, is this linear? Yes, as it is in the form

dydx + P(x)y = Q(x)
where P(x) = − 3x and Q(x) = x

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this:dydx3yx = x Becomes this: u dvdx + v dudx3uvx = x

Step 2: Factor the parts involving v

Factor v:u dvdx + v( dudx3ux ) = x

Step 3: Put the v term equal to zero

v term = zero: dudx3ux = 0 So: dudx = 3ux

Step 4: Solve using separation of variables to find u

Separate variables: duu = 3 dxx Put integral sign: duu = 3 dxx Integrate:ln(u) = 3 ln(x) + C Make C = −ln(k):ln(u) + ln(k) = 3ln(x) Then:uk = x3 And so:u = x3k

Step 5: Substitute u back into the equation at Step 2

(Remember v term equals 0 so can be ignored):( x3k ) dvdx = x

Step 6: Solve this to find v

Separate variables:dv = k x-2 dx Put integral sign: dv = k x-2 dx Integrate:v = −k x-1 + D

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv:y = x3k ( −k x-1 + D ) Simplify:y = −x2 + Dk x3 Replace D/k with a single constant c: y = c x3 − x2

And it produces this nice family of curves:

Family of curves for y equals cx cubed minus x squared
y = c x3 − x2
for various values of c

And one more example, this time even harder:

Example 3: Solve this:

dydx + 2xy= −2x3

First, is this linear? Yes, as it is in the form

dydx + P(x)y = Q(x)
where P(x) = 2x and Q(x) = −2x3

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this:dydx + 2xy= −2x3 Becomes this: u dvdx + v dudx + 2xuv = −2x3

Step 2: Factor the parts involving v

Factor v:u dvdx + v( dudx + 2xu ) = −2x3

Step 3: Put the v term equal to zero

v term = zero: dudx + 2xu = 0

Step 4: Solve using separation of variables to find u

Separate variables: duu = −2x dx Put integral sign: duu = −2x dx Integrate:ln(u) = −x2 + C Make C = −ln(k):ln(u) + ln(k) = −x2 Then:uk = e-x2 And so:u = e-x2k

Step 5: Substitute u back into the equation at Step 2

(Remember v term equals 0 so can be ignored):( e-x2k ) dvdx = −2x3

Step 6: Solve this to find v

Separate variables:dv = −2k x3 ex2 dx Put integral sign: dv = −2k x3 ex2 dx Integrate:v = oh no! this is hard!

Let's see ... we can integrate by parts... which says:

RS dx = RS dx − R' ( S dx ) dx

(Side Note: we use R and S here, using u and v could be confusing as they already mean something else.)

Choosing R and S is very important, this is the best choice we found:

  • R = −x2 and
  • S = 2x ex2

So let's go:

First pull out k:v = k−2x3 ex2 dx R = −x2 and S = 2x ex2:v = k(−x2)(2xex2) dx Now integrate by parts:v = kRS dx − kR' ( S dx) dx

Put in R = −x2 and S = 2x ex2

And also R' = −2x and S dx = ex2

So it becomes:v = −kx22x ex2 dx − k−2x (ex2) dx Now Integrate:v = −kx2 ex2 + k ex2 + D Simplify:v = kex2 (1−x2) + D

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv:y = e-x2k ( kex2 (1−x2) + D ) Simplify:y =1 − x2 + ( Dk)e-x2 Replace D/k with a single constant c: y = 1 − x2 + c e-x2

And we get this family of curves:

Family of curves for y equals 1 minus x squared plus c times e to the power of negative x squared
y = 1 − x2 + c e-x2
for various values of c

9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438