Module 5 First Order Differential Equations

Module S First Order Differential Equations

Differential Equations (DE)

  • A differential equation contains derivatives of an unknown function.
  • Examples:
    • d2ydx2+d3ydx3=2\frac{d^2y}{dx^2} + \frac{d^3y}{dx^3} = 2
    • dydx=xy+2x\frac{dy}{dx} = xy + 2x
    • dydx+2y+3=x\frac{dy}{dx} + 2y + 3 = x
  • Algebraic equations examples:
    • x+y=2x + y = 2
    • x2+xy=y2x^2 + xy = y^2
  • Rectilinear motion example: acceleration a=dvdt=10a = \frac{dv}{dt} = -10, initial velocity u=10u = 10

Order of a DE

  • The order of a DE refers to the highest derivative in the equation.
  • Examples:
    • y=xy+2xy' = xy + 2x (1st order DE)
    • y+2y+3=xy'' + 2y + 3 = x (2nd order DE)
    • y=2y3y''' = 2y' - 3 (3rd order DE)
  • This module focuses only on 1st order DEs.

Direction Fields

  • Direction fields can be used to understand and visualize the behavior of solutions to a DE.
  • Consider 1st order DEs of the form dydx=f(x,y)\frac{dy}{dx} = f(x,y).
  • Example: Consider the DE dydx=x+y1\frac{dy}{dx} = x + y - 1 (i.e., f(x,y)=x+y1f(x,y) = x + y - 1).
  • The DE says that the slope of the solution y(x)y(x) at (x,y)(x,y) is x+y1x + y - 1.
  • A direction field is generated by plotting slope lines at an array of points.
  • Example points:
    • At (x,y)=(0,0)(x,y) = (0,0), dydx=0+01=1\frac{dy}{dx} = 0 + 0 - 1 = -1
    • At (x,y)=(1,1)(x,y) = (1,1), dydx=1+11=1\frac{dy}{dx} = 1 + 1 - 1 = 1
    • At (x,y)=(2,1)(x,y) = (2,-1), dydx=2+(1)1=0\frac{dy}{dx} = 2 + (-1) - 1 = 0

Matching DEs with Direction Fields

  • Example: Match each of the DEs with its direction field.
    • I. y=y2+y2y' = y^2 + y - 2
    • II. y=y2xy' = y - 2x
    • III. y=y2y2y' = y^2 - y - 2
    • IV. y=y2y+2y' = -y^2 - y + 2
    • V. y=1xyy' = 1 - xy
    • VI. y=y+xyy' = y + xy
  • Solutions:
    • I matches with E.
    • II matches with A.
    • III matches with B.
    • IV matches with C.
    • V matches with D.
    • VI matches with F.

Plotting Solutions on a Direction Field

  • To plot a solution on a direction field, we must specify a starting point (x<em>0,y</em>0)(x<em>0, y</em>0).
  • Then, move from that starting point in a direction parallel to the surrounding field lines.
  • Important: You cannot cross a slope line if you are moving parallel to it.

Initial Value Problem (IVP)

  • A DE with a starting point is called an initial value problem (IVP).
  • dydx=f(x,y),y(x<em>0)=y</em>0\frac{dy}{dx} = f(x,y), \quad y(x<em>0) = y</em>0
    • dydx=f(x,y)\frac{dy}{dx} = f(x,y) is the DE.
    • y(x<em>0)=y</em>0y(x<em>0) = y</em>0 is the starting point/initial value.
  • Example: Plot the solutions to the following IVPs using the provided direction field for dydx=x+y1\frac{dy}{dx} = x + y - 1.
    • a) dydx=x+y1,y(0)=1\frac{dy}{dx} = x + y - 1, \quad y(0) = 1
    • b) dydx=x+y1,y(0)=0\frac{dy}{dx} = x + y - 1, \quad y(0) = 0
    • c) dydx=x+y1,y(1)=0\frac{dy}{dx} = x + y - 1, \quad y(-1) = 0

Autonomous DES

  • In previous sections, we considered direction fields of 1st order DEs of the form dydx=f(x,y)\frac{dy}{dx} = f(x,y).
  • A 1st order DE is called autonomous if it has the form dydx=f(y)\frac{dy}{dx} = f(y).
    • i.e., The RHS depends only on the dependent variable yy, not the independent variable xx.
  • Examples of the DEs considered previously:
    • dydx=y2+y2\frac{dy}{dx} = y^2 + y - 2
    • dydx=y2y+2\frac{dy}{dx} = y^2 - y + 2
    • dydx=y2y+2\frac{dy}{dx} = -y^2 - y + 2
    • Autonomous DES
    • dydx=x+y1\frac{dy}{dx} = x + y - 1
    • dydx=y2x\frac{dy}{dx} = y - 2x
    • dydx=1xy\frac{dy}{dx} = 1 - xy
    • dydx=y+xy\frac{dy}{dx} = y + xy
    • Not autonomous DES
  • If we compare direction fields, we see that the slopes of an autonomous DE do not depend horizontally on xx.
    • That is, the slope does not change as we move horizontally on the direction field.

Equilibrium Solutions of Autonomous DES

  • An equilibrium solution of an autonomous DE dydx=f(y)\frac{dy}{dx} = f(y) is a solution of the form y=constanty = constant.
  • Note: If y=constanty = constant, then dydx=0\frac{dy}{dx} = 0. So, we find equilibrium solutions by solving f(y)=0f(y) = 0.
  • Example: Determine the equilibrium solutions of dydx=y2+y2\frac{dy}{dx} = y^2 + y - 2.
    • Equilibrium sol dydx=0\Rightarrow \frac{dy}{dx} = 0
    • 0=y2+y2\Rightarrow 0 = y^2 + y - 2
    • 0=(y+2)(y1)\Rightarrow 0 = (y + 2)(y - 1)
    • y=2,y=1\Rightarrow y = -2, \quad y = 1

More Examples of Equilibrium Solutions

  • Determine the equilibrium solutions of dydx=y34y2+4y\frac{dy}{dx} = y^3 - 4y^2 + 4y.
    • Equilibrium sol dydx=0\Rightarrow \frac{dy}{dx} = 0
    • 0=y34y2+4y\Rightarrow 0 = y^3 - 4y^2 + 4y
    • 0=y(y24y+4)\Rightarrow 0 = y(y^2 - 4y + 4)
    • 0=y(y2)2\Rightarrow 0 = y(y - 2)^2
    • y=0,y=2\Rightarrow y = 0, \quad y = 2
  • Determine the equilibrium solutions of:
    • a) dydx=y2+y+6\frac{dy}{dx} = -y^2 + y + 6
      • Need dydx=0\frac{dy}{dx} = 0
      • 0=y2+y+6\Rightarrow 0 = -y^2 + y + 6
      • 0=(y2y6)\Rightarrow 0 = -(y^2 - y - 6)
      • 0=(y3)(y+2)\Rightarrow 0 = -(y - 3)(y + 2)
      • y=2,y=3\Rightarrow y = -2, \quad y = 3
    • b) dydx=ycos(y)\frac{dy}{dx} = y \cos(y)
      • Need dydx=0\frac{dy}{dx} = 0
      • 0=ycos(y)\Rightarrow 0 = y \cos(y)
      • y=0orcos(y)=0\Rightarrow y = 0 \quad or \quad \cos(y) = 0
      • y=0,y=±π2,±3π2,±5π2,\Rightarrow y = 0, \quad y = \pm \frac{\pi}{2}, \pm \frac{3\pi}{2}, \pm \frac{5\pi}{2}, …
      • y=(2n+1)π2,nZy = (2n+1)\frac{\pi}{2}, \quad n \in \mathbb{Z}

Stability of Equilibrium Solutions

  • An equilibrium solution y=cy = c is:
    • Stable if all nearby solutions approach cc as the independent variable (x)(x) \rightarrow \infty.
    • Unstable if all nearby solutions move away from cc as the independent variable (x)(x) \rightarrow \infty.
  • Can determine stability using a sign diagram.
  • Example: Determine the stability of the equilibrium solutions of dydx=y2+y2\frac{dy}{dx} = y^2 + y - 2.
    • Previously found y=1y = 1 and y=2y = -2 are equilibrium solutions.
    • Test points:
      • y = 2 \Rightarrow \frac{dy}{dx}(2) = 2^2 + 2 - 2 = 4 > 0
      • y = 0 \Rightarrow \frac{dy}{dx}(0) = 0^2 + 0 - 2 = -2 < 0
      • y = -3 \Rightarrow \frac{dy}{dx}(-3) = (-3)^2 - 3 - 2 = 4 > 0
    • Hence, y=1y = 1 is an unstable sol, and y=2y = -2 is a stable sol.

More Examples of Stability

  • Determine the equilibrium solutions of the following DE and determine the stability of these solutions:
    • dydx=y34y2+4y\frac{dy}{dx} = y^3 - 4y^2 + 4y
      • Previously found that y=0y = 0 and y=2y = 2 are equilibrium solutions.
      • Test points:
        • y = 3 \Rightarrow \frac{dy}{dx}(3) = 3^3 - 4(3)^2 + 4(3) = 3 > 0
        • y = 1 \Rightarrow \frac{dy}{dx}(1) = 1^3 - 4(1)^2 + 4(1) = 1 > 0
        • y = -1 \Rightarrow \frac{dy}{dx}(-1) = (-1)^3 - 4(-1)^2 + 4(-1) = -9 < 0
      • So, y=0y = 0 is unstable, and y=2y = 2 is semi-stable (stable from below, unstable from above).
  • Determine the equilibrium solutions of the following DEs & their stability.
    • a) dydx=y2+y+6\frac{dy}{dx} = -y^2 + y + 6
      • From previous example, y=2y = -2 and y=3y = 3 are equilibrium solutions.

Applications Examples

  • Applications
  • A. Natural growth
    • \frac{dP}{dt} = rP
      • P = population Size
      • t = time
      • r = Growth rate
    • r=1
      • Equilibrium sol
  • \frac{dP}{dt} = P and P(0) = 5

Separable DES

  • A 1st order DE is called separable if it can be written in the form
    • \frac{dy}{dx} = f(y) g(x)
    • or
    • all y stuff = all x stuff
  • dy/(f(y)) = g(x)dx
  • Examples
    • Separable DE
      • \frac{dy}{dx} = cos(x)y,
      • g(x) = cos(x)
      • f(y) = y
      • \frac{dy}{dx} = \frac{x}{y}
      • g(x) = x
      • f(y) = y
    • Not separable
      • \frac{dy}{dx} = cos(x)+ y^2
  • Solution technique
  • \frac{dy}{dx} = dy = f(y)g(x)
  • Integrate both sides
  • \int\frac{dy}{f(y)} = \int^{} g(x) dx
  • Remember differential and implicit form
  • Differential form example
    • General solution to the DE \frac{dy}{dx} = xy
  • Separate the dy and dx
  • \frac{dy}{y} = xdx
  • note: integral dy/f(y) = \int f' divide dx
  • \int^{}\frac{dy}{y} = \int x dx
  • Lnly = \frac{X^2}{2} + C
  • implicit solution
  • Index laws to solve
  • y = e^((\frac{x^2}{2})+c)
  • y = ae^\frac{x^2}{2}
  • explicit general solution
  • y = Ae^(x^2/2)
  • This is called the general solution to the DE

Particular solutions and the IVP

  • We can get a particular solution by specifiying an initial condition (IC).
    • This allows us to determine the particular value of the constant A.
    • Eg. Solve the IVP \frac{dy}{dx} = xy and y(0) = 3.
      • Solution:
        • From the previous example, y = A e^(x^2/2).
        • Applying IC: 3 = A e^(0) = A. So, A = 3.

More Separable DE Solutions

  • Determine the general solution to the DE \frac{dy}{dx} = xy^2.
    • Then, solve the IUP \frac{dy}{dx} = xy^2, y(1)=2
    • Separable DE
      • \frac{dy}{y^2} = xdx
  • Integrate them
    • \int y^-2 dy = \int xdx
    • -y^-1 = \frac{x^2}{2} + C
    • y = \frac{-1}{x^2/2 + C}

Cosine IVP and Separable General Solution Examples

  • Solve the TVP \frac{dy}{dx} = \frac{cos(x)}{e^y} and y(0) = 0
  • Determine the general sol \frac{dy}{dx} = \frac{y}{x}
  • Solved this equation for Separable DE
    • \int e^y = \int cos(x)dx
    • e^(y) = sin(x) + C
    • Take the Ln of each side
      • Lne^y = ln(sin(x) + C)
    • y = ln(sin(x) + C)
  • Applying the initial conditions
    • y = ae^\frac{x^2}{2}
  • Applying the initial conditions
    • y(0) =3
    • y=3 Ae^(x^2/2)

Autonomous DE and More

  • Autonomous DE and more
  • \frac{dy}{dx}= \frac{dy}{(y^2 +y - 2)} = dx
  • (y+2)(y-1)=0
    • Equilibrium sols are \frac{dy}{(y+2)} and and (y-1)=0
  • need A/y+2 + B/ y-1
  • If y=1 then
    • \frac{A}{(y-1)} + B/3 = 1/ y+2)(y-1)

Application of natural Growth Formulas

  • Separable
  • \frac{dp}{p} = dt
    • Inp = t + c OR p = A e^( t/2)
  • Apply the variables
    • t=5 then evaluate a long answer
  • Logistic growth: grow according to the logistic equation
    • \frac{dp}{dt} = r * - \frac{p}{k}
    • K = carrying capacity
  • If r = (1/ 2), k= 100 P growings according y(o)=50
    • Separable solution for P (t)

Logistic Growth Explained

  • Logistical Growth problems
  • A new substance that has a reactions in two froms $P * Q \rightarrow X$
    • Q >=x, or the concentration of the products
  • What concentrations in x from this

Liner DES

  • A 1st order DE is called linear if it can be written in the form

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

  • Eg.

  • \frac{dy}{dx} + (cos(x)) y = e^2

  • Where p(x) = cos(x)

  • Examine y term

  • Solution technique

  • step 1: calculate Integrationg facor

  • 1 = e^( integralP(xx)dx)

  • \int Ixy Q(x)dx

  • Combine Ixy etc info the general solution problem

Doses the integrate really work?

  • Determine the general solution to the DE.

  • \frac{dy}{dx} + 3y + 4

  • Solution for form of the DE

    • Step 1: calculate integrating factor
    • Ix = \int e^(p(x). dx) = \int e^(3 dx)

ICs and IUPs

  • To determine a value for 'C', we need to specify an IC to give an IUP.
  • Eg. Solve the IUP dydx+3y=4,y(0)=1\frac{dy}{dx} + 3y = 4, \quad y(0) = 1.
    • Solution:
      • From previous example, y=43+Ce3xy = \frac{4}{3} + Ce^{-3x}.
      • y(0)=11=43+Ce3(0)1=43+CC=13y(0) = 1 \Rightarrow 1 = \frac{4}{3} + Ce^{-3(0)} \Rightarrow 1 = \frac{4}{3} + C \Rightarrow C = -\frac{1}{3}.

More liner IVP and solutions

  • linear

  • \int1dx

  • = \int e ^ -1dx = e∧ -x

  • Step 2:

  • IxyQ(x) dx = \inte∧xy(x)dx

  • Let u=x

  • dv = \int e^( -x)

  • Then by parts -\int vdu

General solutions and formulas for solving

  • General solutions formulas
    • Solve the following IUPs x \frac{dy}{dx} + 2y = 3
      • Obtain the general solution.
      • Solve: Liner convert to standard form
      • \frac{dy}{dx} + \frac{{3}}{x}y = 3
  • 2) Sp(x)/dx = \int( dx/x)2=e^(2lnx)
  • )simplify y (x), See previous example

Applications: Linear Model and Equations.

  • Models with liner equations and forumls

  • An Object of mass m is falling under gravity

  • \frac{dv}{dt} mg+ km= 100-2v/10

    • V(0 = 0/ liner and separable