# Solve First Order Differential Equations

A tutorial on how to solve first order differential equations. Examples with detailed solutions are included.

 The general form of the first order linear differential equation is as follows $\dfrac{dy}{dx} + P(x) y = Q(x)$ where $P(x)$ and $Q(x)$ are functions of $x$. If we multiply all terms in the differential equation given above by an unknown function u(x), the equation becomes $u(x) \dfrac{dy}{dx} + u(x) P(x) y = u(x) Q(x)$ The left hand side in the above equation has a term $u \dfrac{dy}{dx}$, we might think of writing the whole left hand side of the equation as $\dfrac{d(u y)}{dx}$. Using the product rule of derivatives we obtain $\dfrac{d(u y)}{dx}=u\dfrac{dy}{dx}+y\dfrac{du}{dx}$ For $u \dfrac {dy}{dx} + y \dfrac{du}{dx}$ and $u(x) \dfrac{dy}{dx} + u(x) P(x) y$ to be equal, we need to have $\dfrac{du}{dx} = u(x) P(x)$ Which may be written as $\dfrac{1}{u} \dfrac{du}{dx} = P(x)$ Integrate both sides to obtain $\ln (u) = \displaystyle\int P(x) dx$ Solve the above for $u$ to obtain $u(x) = e^{\int P(x)dx}$ $u(x)$ is called the integrating factor. A solution for the unknown function $u$ has been found. This will help in solving the given differential equation which is written as follows. $\dfrac{d(u y)}{dx} = u(x) Q(x)$ Integrate both sides to obtain $u(x) y = \displaystyle\int u(x) Q(x) dx$ Finally solve for $y$ to obtain $y = \dfrac{\displaystyle\int u(x) Q(x) dx}{u(x)}$ Example 1: Solve the differential equation $\dfrac{dy}{dx}-2 x y = x$ Solution to Example 1 Comparing the given differential equation with the general first order differential equation $\dfrac{dy}{dx} + P(x) y = Q(x)$, we can identify $P(x)$ and $Q(x)$ as follows $P(x) = -2 x$ and $Q(x) = x$ Let us now find the integrating factor $u(x)$ $u(x) = e^{\int P(x) dx}$ $= e^{\int -2 x dx}$ $= e^{-x^2}$ We now substitute $u(x)= e^{-x^2}$ and $Q(x) = x$ in the equation $u(x) y = \displaystyle\int u(x) Q(x) dx$ to obtain $e^{-x^2} y = \displaystyle\int x e^{-x^2} dx$ Integrate the right hand term to obtain $e^{-x^2} y = -(1/2) e^{-x^2} + C$, $C$ is a constant of integration. Solve the above for $y$ to obtain $y = C e^{x^2} - 1/2$ As a practice, find $\dfrac{dy}{dx}$ and substitute $y$ and $\dfrac{dy}{dx}$ in the given equation to check that the solution found is correct. Example 2: Solve the differential equation $\dfrac{dy}{dx} + \dfrac{y}{x} = - 2$ for $x > 0$ Solution to Example 2 We first find $P(x)$ and $Q(x)$ $P(x) = \dfrac{1}{x}$ and $Q(x) = - 2$ The integrating factor $u(x)$ is given by $u(x)=e^{\int P(x) dx}$ $= e^{\int (1 / x) dx}$ $= e^{\ln |x|} = | x | = x$ since $x > 0$. We now substitute $u(x)= x$ and $Q(x) = - 2$ in the equation $u(x) y = \displaystyle\int u(x) Q(x) dx$ to obtain $x y = \displaystyle\int -2 x dx$ Integrate the right hand term to obtain $x y = -x^2 + C$ , $C$ is a constant of integration. Solve the above for y to obtain $y = \dfrac{C}{x} - x$ As an exercise find $dy / dx$ and substitute $y$ and $dy / dx$ in the given equation to check that the solution found is correct. Example 3: Solve the differential equation $x \dfrac{dy}{dx} + y = - x^3$ for $x > 0$ Solution to Example 3 We first divide all terms of the equation by $x$ to obtain $\dfrac{dy}{dx} + \dfrac{y}{x} = - x^2$ We now find $P(x)$ and $Q(x)$ $P(x) = 1 / x$ and $Q(x) = - x^2$ The integrating factor $u(x)$ is given by $u(x) = e^{\displystyle \int P(x) dx}$= e^{\displystyle \int (1/x) dx} $= e^{\ln x} = | x | = x$ since $x > 0$. We now substitute $u(x)= x$ and $Q(x) = - x^2$ in the equation $u(x) y = \displaystyle \int u(x) Q(x) dx$ to obtain $x y = \displaystyle \int - x^3 dx$ dx Integration of the right hand term yields $x y = -x^4 / 4 + C$ , $C$ is a constant of integration. Solve the above for $y$ to obtain $y = \dfrac{C}{x} - \dfrac{x^3}{4}$ As an exercise find $dy / dx$ and substitute $y$ and $dy / dx$ in the given equation to check that the solution found is correct. NOTE: If you can "see" that the left hand side of the given equation $x \dfrac{dy}{dx}+ y = - x^3$ can be written as $\dfrac{d(x y)}{dx}$, the solution can be found easily as follows $\dfrac{d(x y)}{dx} = - x^3$ Integrate both sides to obtain $x y = - \dfrac{x^4}{4} + C$. Then solve for y to obtain $y = - \dfrac{x^3}{4} +\dfrac{C}{x}$ Exercises: Solve the following differential equations. 1. $\dfrac{dy}{dx} + y = 2x + 5$ 2. $\dfrac{dy}{dx} + y = x^4$ Answers to Above Exercises 1. $y = 2x + 3 + C e^{-x}$ , $C$ constant of integration. 2. $y = x^4 - 4 x^3 + 12 x ^2 - 24 x + C e^{-x} + 24$, $C$ a constant of integration. More references on Differential Equations Differential Equations - Runge Kutta Method

SEARCH THIS SITE

Custom Search

Home Page -- HTML5 Math Applets for Mobile Learning -- Math Formulas for Mobile Learning -- Algebra Questions -- Math Worksheets -- Free Compass Math tests Practice
Free Practice for SAT, ACT Math tests -- GRE practice -- GMAT practice Precalculus Tutorials -- Precalculus Questions and Problems -- Precalculus Applets -- Equations, Systems and Inequalities -- Online Calculators -- Graphing -- Trigonometry -- Trigonometry Worsheets -- Geometry Tutorials -- Geometry Calculators -- Geometry Worksheets -- Calculus Tutorials -- Calculus Questions -- Calculus Worksheets -- Applied Math -- Antennas -- Math Software -- Elementary Statistics High School Math -- Middle School Math -- Primary Math
Math Videos From Analyzemath
Author - e-mail

Updated: 2 April 2013

Copyright © 2003 - 2013 - All rights reserved