Differential Equations/First Order Linear 1

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search
From Differential Equations
First Order Differential Equations

Contents

[edit] What is a linear first order equation?

A linear first order equation is an equation in the form

\frac{dy}{dx}+P(x)y=Q(x).

Linear first order equations are important because they show up frequently in nature and physics, and can be solved by a fairly straight forward method.

[edit] Solving First Order Linear Equations

First order linear equation can be solved by the following method.

[edit] Step-by-Step Solution

To solve the equation

\frac{dy}{dx}+P(x)y=Q(x),
  1. First, set Q(x) equal to 0 so that you end up with the homogeneous linear equation (the usage of this term is to be distinguished from the usage of "homogeneous" in the previous sections).

    \frac{dy}{dx}+P(x)y=0
  2. This equation is separable, so separate them:

    \frac{dy}{y}+P(x)dx=0
  3. Solve the equation to obtain the solution

    y=Ce^{-\int P(x) dx}
  4. Now let the replace C be a variable function of x, and denote it g(x).

    y=g(x)e^{-\int P(x) dx}
  5. Substitute the previous equation into the differential equation to get

    g'(x)e^{-\int P(x) dx}=Q(x)
  6. Now solve for g(x) to get

    g(x)=C+\int Q(x)e^{-\int P(x) dx}dx
  7. Now obtain the general solution by plugging in this expression in g(x):

    y=g(x)e^{-\int P(x) dx}=Ce^{-\int P(x) dx}+e^{-\int P(x) dx}\int Q(x)e^{\int P(x) dx}dx

The previous method is called the variation of parameters.

[edit] Example 1: P and Q are Constant

Let's say we have the equation
\frac{dy}{dx}+my=n
where n and m are constants. Solve this for y.
Step 1: Find the integrating factor, e^{\int P(x)dx}
\int mdx=mx+C
e^{\int P(x)dx}=Ce^{mx}
Letting C=1, we get emx.
Step 2: Multiply through by integrating factor.
e^{mx}\frac{dy}{dx}+e^{mx}my=ne^{mx} \,
Step 3: Recognize that the left hand is \frac{d}{dx} e^{\int P(x)dx}y, giving
\frac{d}{dx} e^{mx}y=ne^{mx}
Step 4: Integrate both sides w.r.t.x.
\int (\frac{d}{dx} e^{mx}y)dx=\int ne^{mx}dx
e^{mx}y=\frac{n}{m}e^{mx}+C
Step 5: Solve for y
y=\frac{n}{m}+\frac{C}{e^{mx}}

[edit] Example 2: P and Q are x

Take the equation
\frac{dy}{dx}+xy=x
Solve for y.
Step 1: Find e^{\int P(x)dx}
\int x=\frac{1}{2}x^2+C
e^{\int P(x)dx}=Ce^{\frac{1}{2}x^2}
Letting C=1, we get e^{\frac{1}{2}x^2}
Step 2: Multiply through
e^{\frac{1}{2}x^2}\frac{dy}{dx}+e^{\frac{1}{2}x^2}xy=e^{\frac{1}{2}x^2}x
Step 3: Recognize that the left hand is \frac{d}{dx} e^{\int P(x)dx}y, giving
\frac{d}{dx} e^{\frac{1}{2}x^2}y=e^{\frac{1}{2}x^2}x
Step 4: Integrate
\int (\frac{d}{dx} e^{\frac{1}{2}x^2}y)dx=\int xe^{\frac{1}{2}x^2}dx
e^{\frac{1}{2}x^2}y=e^{\frac{1}{2}x^2}+C
Step 5: Solve for y
y=1+\frac{C}{e^{\frac{1}{2}x^2}}

[edit] Example 3: P and Q are Unrelated

Take the equation
\frac{dy}{dx}+\frac{1}{x}y=x
Solve for y.
Step 1: Find e^{\int P(x)dx}
\int \frac{1}{x}=ln(x)+C
e^{\int P(x)dx}=Ce^{ln(x)}=Cx
Letting C=1, we get x.
Step 2: Multiply through
x\frac{dy}{dx}+y=x^2
Step 3: Recognize that the left hand is \frac{d}{dx} e^{\int P(x)dx}y
\frac{d}{dx} xy=x^2
Step 4: Integrate both sides w.r.t.x.
\int (\frac{d}{dx} xy)dx=\int x^2dx
xy=\frac{1}{3}x^3+C
Step 5: Solve for y
y=\frac{1}{3}x^2+\frac{C}{x}

[edit] Making Linear Equations from Non-Linear Equations

Sometimes a non-linear equation, which is not solvable like this, can be made linear, and more easily solvable, by applying a substitution.

[edit] Example

y\frac{dy}{dx}+xy^2=5x
Let's make the following substitution:
v=y^2 \,
\frac{dv}{dx}=2y\frac{dy}{dx}
Plugging in, we get
\frac{1}{2}\frac{dv}{dx}+xv=5x
\frac{dv}{dx}+2xv=10x
We can then solve as a linear equation in v, using the step-by-step method above:
Step 1: Find the integrating factor:
e^{\int P(x)dx}
e^{\int 2x dx}=e^{x^2+C}
e^{\int P(x)dx}=Ce^{x^2}
Letting C=1 for convenience, we get e^{x^2} as our integrating factor.
Step 2: Multiply through
e^{x^2}\frac{dv}{dx}+e^{x^2}xv=10e^{x^2}x
Step 3: Recognize that the left hand is \frac{d}{dx} e^{\int P(x)dx}v
\frac{d}{dx} e^{x^2}v=10e^{x^2}x
Step 4: Integrate both sides w.r.t.x.
\int (\frac{d}{dx} e^{x^2}v)dx=\int 10e^{x^2}xdx
e^{x^2}v=5e^{x^2}+C
Step 5: Solve for v.
v=5+\frac{C}{e^{x^2}}
Now that we have v, solve for y.
v=y^2 \,
y^2=5+\frac{C}{e^{x^2}} \,