Thursday, August 15, 2013

Differential Equations #3: General First-Order Linear Differential Equations

On this installment of the Differential Equation series, we will look at general linear differential equations which takes the form

y' + p(x) * y = q(x)

On this blog entry, we are going to go over a general procedure on how to solve these type of equations. The procedure requires a multiplicative factor called the integrating factor.

Procedure to solve y' + p(x) * y = q(x)

1. Calculate the integrating factor I = e^( ∫ p(x) dx).

2. Multiply the factor, I, to the equation, resulting in:
I * y' + (p(x) * I) * y = q(x) * I

Since I' = d/dx ( ∫ p(x) dx) * e^( ∫ p(x) dx) = p(x) * e^( ∫ p(x) dx), I' = I * p(x).

Then I * y' + I' * y = q(x) * I

By the derivative product rule, d/dx ( I * y ) = q(x) * I

3. Take the integral with respect to x on both sides:

I * y = ∫ (q(x) * I) dx + C

4. Solve for y. If an initial condition is given, you can solve for C.

y = ( ∫ q(x) * I dx + C) / I



We can summarize this produce by the following:

To solve y' + p(x) * y = q(x)

y = ( ∫ q(x) * I dx + C) / I, where I = e^( ∫ p(x) dx)



Let's work on some examples.

1. y' + 3*y = x

Here p(x) = 3 and q(x) = x. The integrating factor is I = e^( ∫ p(x) dx), so for this example, I = e^( ∫ 3 dx) = e^(3*x). Now:

e^(3*x) * y' + 3 * y * e^(3*x) = x * e^(3*x)
d/dx (y * e^(3*x) ) = x * e^(3*x)
∫ d/dx (y * e^(3*x)) dx = ∫ x * e^(3*x) dx

Using integration by parts on the right side:
y * e^(3*x) = (x*e^(3*x))/3 - (e^(3*x))/9 + C

y = x/3 - 1/9 + C*e^(-3*x)

2. y' + 2/x * y = x^3

Here p(x) = 2/x and q(x) = x^3, and the integrating factor is
I = e^( ∫ 2/x dx) = e^(2*ln x) = e^(ln (x^2)) = x^2

Then:
d/dx (y * x^2) = x^2 * x^3
d/dx (y * x^2) = x^5
∫ d/dx (y * x^2) dx = ∫ x^5 dx
y * x^2 = x^6/6 + C

y = x^4/4 + C*x^(-2)

3. y' + x*y = 2*x, y(0)=3

First, solve for y:
p(x) = x
q(x) = 2*x
I = e^( ∫ x dx) = e^(x^2/2)

d/dx (e^(x^2/2) * y) = e^(x^2/2) * 2 * x
e^(x^2/2) * y = ∫ e^(x^2/2) * 2 * x dx + C
e^(x^2/2) * y = 2*e^(x^2/2) + C
y = 2 + C*e^(-x^2/2)

Using the initial condition y(0)=3 to solve for C:
3 = 2 + C*e^0
C = 1

The final answer is:
y = 2 + e^(-x^2/2)

The next time we will look at (simple) second-order differential equations, and how solving a quadratic equation helps solve the differential equations. Please leave comments and questions below.

Take care, Eddie



This blog is property of Edward Shore. 2013

Spotlight: TI-55 from 1977

Spotlight: TI-55 from 1977 Welcome to a special Monday Edition of Eddie’s Math and Calculator Blog. Today, we have the origi...