Lesson 5 (09/02/26): Linear First Order ODEs (1.5)

Original PDF

Page 1

Lesson 5 (09/02/26): Linear First Order ODEs (1.5)

Review eg: Elimination of a drug from body is modelled by \( A'(t) = -\lambda A \)
Find elimination constant \( \lambda \), given \( A(5\text{ min}) = 6000\text{ units} \), \( A(25\text{ min}) = 500\text{ units} \)

\[ A'(t) = -\lambda A \] \[ \frac{1}{A} \frac{dA}{dt} = -\lambda \] \[ \int \frac{1}{A} \, dA = \int -\lambda \, dt \implies \ln A = -\lambda t + C \] \[ A(t) = e^{-\lambda t + C} = e^C \cdot e^{-\lambda t} \]

Gen. solution: \( A(t) = K e^{-\lambda t} \)

\[ A(5) = 6000 = K e^{-5\lambda} \] \[ A(25) = 500 = K e^{-25\lambda} \]

Divide:

\[ 12 = e^{20\lambda} \] \[ \lambda = \frac{\ln 12}{20} \]


Page 2

Hints for HW4

1. Radioactive decay constant for \(^{14}\text{C} \approx 0.0001216\)

2. Newtons Law of Cooling:

\[ \frac{dT}{dt} = k (T_0 - T) \]

  • \(T(t) \rightarrow\) temperature of object at time \(t\)
  • \(T_0 \rightarrow\) Constant Outside temperature / Room temp.
  • \(k \rightarrow\) Cooling Constant

Page 3

So far:

  1. \[ \frac{dy}{dx} = f(x) \]

    integrate both sides

  2. \[ \frac{dy}{dx} = \frac{f(x)}{g(y)} \rightsquigarrow \text{Seperable} \]

    re write \( g(y) \, dy = f(x) \, dx \)

    integrate both sides.

Today:

Solve linear equations by integrating both sides, using a “trick”


Page 4

Example

\[ x^3 y' + 3x^2 y = e^x \]

Product Rule:

\[ \frac{d}{dx} [f g] = f' g + f g' \]

\[ x^3 y' + 3x^2 y = x^3 \cdot \frac{dy}{dx} + \left(\frac{d}{dx} x^3\right) y \underset{\substack{\text{product} \\ \text{Rule}}}{\overset{\text{undo}}{=}} \frac{d}{dx} \left[ x^3 y \right] \]

Rewrite ODE:

\[ \frac{d}{dx} \left[ x^3 y \right] = e^x \]

integrate both sides w.r.t. \( x \)

\[ x^3 y = e^x + C \]

is the general solution.


Page 5

Linear First Order ODE

General Form:

\[ A(x) y' + B(x) y + C(x) = 0 \]

Linear in \( y, y' \leadsto \) donot have powers of \( y, y' \) or \( \sin y \), \( e^y \), \( \tan y' \dots \) in equation

but need not be linear in \( x \).

typically Also written in standard form

\[ y' + p(x) y = q(x) \]


Page 6

Which of the following are Linear 1st order ODEs?

  1. \( x^3 y' + 3x^2 y = x^3 \) ✓

  2. \( y' + e^y x = x y^2 \) ✗

  3. \( y' + 2xy = x e^{x^2} \) ✓

  4. \( x(y')^3 + \ln x \, y = 0 \) ✗

  5. \( y y' + 7x = 0 \) ✗


Page 7

Standard form:

\[ y' + p(x)y = q(x) \]

— Can we think of LHS as \( (\mu(x) \cdot y)' \)?

\[ (\mu(x)y)' = \mu(x)y' + \mu'(x)y \]

— Not Really!!

idea Multiply with some \( \mu(x) \) satisfying this

We get:

\[ (\mu(x)y)' = \mu(x)q(x) \rightsquigarrow \text{integrate}. \]


Page 8

What is this \( \mu(x) \):

\[ y' + p(x)y = q(x) \]

multiply with \( \mu(x) \) on both sides

\[ \mu(x)y' + \mu(x)p(x)y = \mu(x)q(x) \]

want the left hand side equals \( \mu(x)y' + \mu'(x)y \)

So \( \mu(x) \) should satisfy

\[ \mu'(x) = \mu(x)p(x) \]

Solve this seperable equation to find one such \( \mu(x) \)


Page 9

Solve!

\[ \mu'(x) = \mu(x) p(x) \]

solve by diving \(\mu(x)\) & Seperate Variables

\[ \frac{1}{\mu(x)} \frac{d\mu}{dx} = p(x) \]

integrate both sides

\[ \int \frac{1}{\mu} \, d\mu = \int p(x) \, dx \] \[ \ln(\mu(x)) = \int p(x) \, dx \] \[ \mu(x) = e^{\int p(x) \, dx} \]

called integrating factor.


Page 10

Summary: Solving \( y' + p(x)y = q(x) \)

  1. Step 1:

    Find the integrating factor \( \mu(x) = e^{\int p(x)\,dx} \), which satisfies \( \mu'(x) = \mu(x)p(x) \).

  2. Step 2:

    Multiply the differential equation by \( \mu(x) \):

    \[ \mu(x)y' + \underbrace{\mu(x)p(x)}_{\mu'(x)}y = \mu(x)q(x) \]

  3. Step 3:

    Apply the product rule to the left-hand side:

    \[ [\mu(x)y(x)]' = \mu(x)q(x) \]

  4. Step 4:

    Integrate both sides with respect to \( x \):

    \[ \mu(x)y(x) = \int \mu(x)q(x)\,dx + C \]

  5. Step 5:

    Divide by \( \mu(x) \) to obtain the general solution:

    \[ y(x) = \frac{1}{\mu(x)}\left( \int \mu(x)q(x)\,dx + C \right) \]


Page 11

Example: Find general solution to \( y' + 2xy = x e^{-x^2} \)

  1. \( p(x) = 2x \), \( q(x) = x e^{-x^2} \)

    \[ \mu(x) = e^{\int p(x)\,dx} = e^{\int 2x\,dx} = e^{x^2} \quad \text{integrating factor} \]

  2. Multiply by \( \mu(x) = e^{x^2} \) on both sides:

    \[ e^{x^2} y' + 2x e^{x^2} y = e^{x^2} \cdot x e^{-x^2} = x \]

  3. Observe: \( (e^{x^2} y)' = e^{x^2} y' + 2x e^{x^2} y \)

    ODE: \( (e^{x^2} y)' = x \)

  4. Integrate both sides:

    \[ e^{x^2} y = \int x\,dx + C = \frac{x^2}{2} + C \]

  5. Solve for \( y(x) \) by dividing by \( \mu(x) = e^{x^2} \):

    \[ y(x) = e^{-x^2} \left[ \frac{x^2}{2} + C \right] \]


Page 12

eg: Find general solution to \( 2y' + y = e^{3x} \)

⓪ Divide with coeff. of \( y' \)

\[ y' + \frac{1}{2}y = \frac{1}{2}e^{3x} \] \[ p(x) = \frac{1}{2}, \quad q(x) = \frac{1}{2}e^{3x} \]

① Find \( \mu(x) = e^{\int p(x)\,dx} = e^{\int \frac{1}{2}\,dx} = e^{x/2} \)

② Multiply ODE with \( \mu(x) = e^{x/2} \) on both sides.

\[ e^{x/2}y' + \frac{1}{2}e^{x/2}y = e^{x/2} \cdot \frac{1}{2}e^{3x} = \frac{1}{2}e^{\frac{7x}{2}} \]

③ re write using product Rule

\[ \left(e^{x/2}y\right)' = \frac{1}{2}e^{7x/2} \]

integrate: \( e^{x/2}y = \int \frac{1}{2}e^{\frac{7x}{2}}\,dx = \frac{1}{7}e^{\frac{7x}{2}} + C \)

⑤ divide \( e^{x/2} \rightsquigarrow y(x) = e^{-x/2}\left[\frac{1}{7}e^{7x/2} + C\right] \)


Page 13

\[ T' = k(T_0 - T) \]

\( k, T_0 \) are constants

Separable

\[ \frac{1}{T_0 - T} \, dT = k \, dt \]

integrate both sides

Linear

\[ T' + kT = kT_0 \]

\[ \mu(t) = e^{\int k \, dt} = e^{kt} \]

\[ (e^{kt} T)' = k e^{kt} T_0 \]