First order Linear Differential Equations

What is first order Linear differential Equation?

A differential equation is linear if the dependent variable ‘y’ and its derivative appear only in first degree. The general form of  a linear differential equation of first order is,

\dpi{120} \mathbf{\frac{dy}{dx}+Py =Q}

Where P and Q are  functions of x(or constants).

For example,

\dpi{120} \frac{dy}{dx}+2y=x^{3}

\dpi{120} \frac{dy}{dx}+2y= sinx

are linear differential equations.

How to solve linear differential equations?

This type of differential equations are solved when they are  multiplied  by a factor, called integration factor because by multiplication of this factor the left hand side becomes exact differential of some function.

Integrating factor is given as,

\dpi{120} I.F = e^{\int pdx}

Its solution is written as,

\dpi{120} \mathbf{y (I.F)= \int Q (I.F) dx +C}

Following examples illustrates the procedure.

 

Example1:Solve the following Linear differential equation.

\dpi{120} {\color{Red} \frac{dy}{dx}-\frac{y}{x}=2x^{2}, x>0}

Solution:

\dpi{120} \frac{dy}{dx}+\left (\frac{-1}{x} \right )y =2x^{2}

here P= -1/x  and Q=2x^2

\dpi{120} I.F = e^{\int pdx}=e^{\int \left ( \frac{-1}{x} \right )dx}

\dpi{120} I.F =e^{-lnx}=e^{lnx^{-1}}=x^{-1}=\frac{1}{x}

Plugin these values into the formula

y (I.F)= \int Q (I.F) dx +C

y (\frac{1}{x})= \int 2x^{2} \left (\frac{1}{x} \right ) dx +C

y (\frac{1}{x})= \int 2x dx +C

y (\frac{1}{x})= x^{2} +C

y= x^{3} +Cx

 

Example2: Solve the following initial value problem

{\color{Red} \frac{dy}{dx}+\frac{2x}{x^{2}+1}y=\frac{1}{(x^{2}+1)^{2}} ;y(0)=0}

Solution: This is a linear differential equation where,

P=\frac{2x}{x^{2}+1} ; Q=\frac{1}{(x^{2}+1)^{2}}

Integrating factor

\dpi{120} I.F = e^{\int pdx}=e^{\int \left ( \frac{2x}{x^{2}+1} \right )dx}

\dpi{120} I.F = e^{ln(x^{2}+1)}=x^{2}+1

Using formula,

y (I.F)= \int Q (I.F) dx +C

y (x^{2}+1)= \int \frac{1}{(x^{2}+1)^{2}}\left (x^{2}+1\right )dx +C

y (x^{2}+1)= \int \frac{1}{(x^{2}+1)}dx +C

y (x^{2}+1)= tan^{-1}(x) +C

Using initial condition y(0)=0

0(0+1)=tan^-1(0)+C

0=C

y (x^{2}+1)= tan^{-1}(x)

y = \frac{tan^{-1}(x)}{x^{2}+1}

Differential Equations reducible to linear form:

Some differential equations are not separable  or linear but they can be transformed to linear form after a suitable substitution. Here is an example.

Example3 : Solve the following differential equation.

{\color{Red} 2xe^{2y}\frac{dy}{dx}=3x^{4}+e^{2y}}

Solution:  This equation seems complex  to solve but after reducing  it would be an easy linear differential equation.

Let u=e^2y

\frac{du}{dx}=2e^{2y}\frac{dy}{dx}

Using  this we get the original differential equation transformed to

x\frac{du}{dx}= 3x^{4}+u

rewriting this  as general form of linear differential equation

\frac{du}{dx}+\frac{-1}{x}u= 3x^{4}

P=\frac{-1}{x}; Q=3x^{4}

\dpi{120} I.F = e^{\int pdx}=e^{\int \left ( \frac{-1}{x} \right )dx}

\dpi{120} I.F =e^{-lnx}=e^{lnx^{-1}}=x^{-1}=\frac{1}{x}

Plugin these values into the formula

y (I.F)= \int Q (I.F) dx +C

u(\frac{1}{x})= \int 3x^{3} \left (\frac{1}{x} \right ) dx +C

u (\frac{1}{x})= \int 3x^{2} dx +C

u (\frac{1}{x})= x^{3} +C

Plugin back u as e^2y

e^{2y}= x^{4} +Cx

y=\frac{1}{2}ln(x^{4}+Cx)

When y is independent variable instead of x.

Example4:Solve the following differential equation.

{\color{Red} ydx-(x+2y^{2})dy=0}

Solution:

ydx=(x+2y^{2})dy

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

\frac{dx}{dy}=\frac{x}{y}+2y

\frac{dx}{dy}+\frac{-1}{y}x=2y

here P=-1/y  and Q= 2y

\dpi{120} I.F = e^{\int pdy}=e^{\int \left ( \frac{-1}{y} \right )dy}

\dpi{120} I.F =e^{-lny}=e^{lny^{-1}}=y^{-1}=\frac{1}{y}

Plugin these values into the formula

x (I.F)= \int Q (I.F) dy +C

x(\frac{1}{y})= \int 2y \left (\frac{1}{y} \right ) dy +C

x (\frac{1}{y})= \int 2 dy +C

x (\frac{1}{y})= 2y +C

x=y(2y+C)

 

Example5:A tank initially contains 100 gal of water in which is dissolved 2 lb of salt. Salt-water solution containing 1 lb of salt for every 4 gal of solution enters the tank at a rate of 5 gal per minute. Solution leaves the tank at the same rate, allowing for a constant
solution volume in the tank.

a)Use an analytic method to determine the eventual salt content in the tank.

b) Find the concentration of salt when t —>∞.  Check and see how reasonable is your answer.

Solution: The key idea to solve this kind of differential equations is that ‘The rate of change of salt concentration in a tank is equal to the rate at which salt enters the tank minus the rate at which  salt leaves the tank’.

let x(t) represents the pounds of salt present in the tank at time t.

Then   dx/dt= rate in- rate out

Rate in:

Concentration of the solution entering the tank=(1/4) lb/gal

Rate at which solution is entering = 5 gal/min

Rate at which salt enters the tank = 1/4 *5 = (5/4) lb/min

Rate out :

Assuming perfect mixing, the concentration of salt in the solution is found by dividing the amount of salt by the volume of solution.

so the concentration of solution leaving the tank = (x/100) lb/gal

Rate at which solution is leaving = 5 gal/min

Rate at which salt leaves the tank= (x/100)*5= 5x/100 =x/20 lb/min

Initially there is 2 lb of salt present in the tank so x(0)=2 lb

So differential equation can be modeled as,

\frac{dx}{dt}=\frac{5}{4}-\frac{1}{20}x ; x(0)=2

\frac{dx}{dt}+\frac{1}{20}x=\frac{5}{4}

here P= 1/20 ,  Q=5/4

\dpi{120} I.F = e^{\int pdt}=e^{\int \left ( \frac{1}{20} \right )dt}

\dpi{120} I.F = e^{ \frac{t}{20} }

Plugin the values into the formula

x (I.F)= \int Q (I.F) dt +C

x (e^{\frac{t}{20}})= \int \frac{5}{4} (e^{\frac{t}{20}}) dt +C

x (e^{\frac{t}{20}})= \frac{5}{4} \left [20(e^{\frac{t}{20}}) \right ] +C

x (e^{\frac{t}{20}})= 25(e^{\frac{t}{20}}) +C

x = 25 +Ce^{\frac{-t}{20}}

Using initial condition x(0)=2,  we get

2 = 25 +Ce^{0}

C=-23

b) Concentration of salt at any time t is given as,

c(t)= x(t)/100

c(t) = \frac{25 -23e^{\frac{-t}{20}}}{100}

Eventual concentration can be found  as,

\lim_{t\rightarrow \infty }c(t) = \lim_{t\rightarrow \infty }\frac{25 -23e^{\frac{-t}{20}}}{100}= \frac{25-0}{100}=\frac{1}{4}  lb/gal

This answer is quite reasonable as the concentration of solution entering the tank is same 0.25 lb/gal

 

 

 

 

 

Practice problems:

Solve the following linear differential equations\

1.(1+x^{2})\frac{dy}{dx}+y=e^{tan^{-1}(x)}

2. \sqrt{1-x^{2}}\frac{dy}{dx}+y=1 ; y(0)=4

3. 2xy\frac{dy}{dx}+2y^{2}= 3x-6          Hint : u=y^2

4.\sqrt{1-y^{2}}dx=(sin^{-1}y-x)dy ; y(0)=0

5. A tank contains 100 gal of pure water. At time zero, sugar-water solution containing 0.2 lb of sugar per gal enters the tank at a rate of 3 gal per minute. Simultaneously, a drain is opened at the bottom of the tank allowing sugar-solution to leave the tank at
3 gal per minute. Assume that the solution in the tank is kept perfectly mixed at all times. Find the amount of sugar present in the tank at time t.

 

 

 

 

 

Answers:

  1. y=tan^{-1}(x)-1 +Ce^{-tan^{-1}(x)}
  2. y=1+3e^{-sin^{-1}(x)}
  3. y^{2}x^{2}=x^{3}-3x^{2}+C
  4.  x-sin^{-1}y+1=e^{sin^{-1}y}: y\in (-1,1)
  5.  S(t)= 20\left (1-e^{\frac{-3t}{100}} \right )

 

Leave a comment