Solution for dx/dy + px = q, where p and q are functions of y or constants
A differential equation is called linear if there are no multiplications among dependent variables and their derivatives. In other words, all coefficients are functions of independent variables. It can be written in two forms. The second is discussed in detail here.
dxdy+Px=Q
Such that, P and Q are either constants or functions of y variable only. This type of differential equation is called a first-order linear differential equation. To solve this type of equation, we first multiply both the sides of the equation by a function of y: g(y):
g(y)dxdy+P(g(y))x=Qg(y)
The function g(x) is chosen such that RHS becomes the derivative of y.g(x)
Therefore,
g(y)dxdy+P(g(y))x=g(y)dxdy+xgโ(y)
P=gโ(y)g(y)
Now we integrate both the sides with respect to x to obtain:
โซPdy=โซgโ(y)g(y)dy
โซPdy=log(g(y))
Therefore:
g(y)=eโซPdy
eโซPdydxdy+PeโซPdyx=QeโซPdy
ddx(xeโซPdy)=QeโซPdy
By integrating both equations we obtain:
xeโซPdy=โซ(QeโซPdy)dy
y=eโโซPdyโ โซQeโซPdydy+C
Steps used to solve first-order linear differential equation are as follows:
(i) Write the given differential equation in the following first-order linear DE form dxdy+Px=Q
where P, Q are constants or functions of y only.
(ii) Find the Integrating Factor (IF): eโซPdy
(iii) Write the solution of the given differential equation using IF in the following manner: x(IF)=โซ(QรIF)dy+C
Example: Find the general solution of the linear DE: ydxโ(x+2y2)dy=0
This equation can be written in the form: dxdyโxy=2y
This is a linear differential equation of the type discussed above: dxdy+Px=Q
Here P = -1/y and Q = 2y which are both functions of y.
Therefore,
IF=eโซPdy=eโซโ1ydy=eโlogy=1y
Hence, the solution of the given differential equation can be written as:
x1y=โซ2y(1y)dy+c
Or
xy=โซ2dy+c
Integrating the equation gives:
xy=2y+c
Hence we can write:
x=2y2+cy
Since c is also a function of y. This is the general solution of the linear DE.
Example: Solve the given differential equation: (tanโ1yโx)dy=(1+y2)dx
We can write this equation in a linear form, such that: dxdy+x1+y2=tanโ1y1+y2
In this case, we identify that P = 11+y2 and Q = tanโ1y1+y2 where P and Q are both functions of y
Hence we can write the equation using the integrating factor:
IF=eโซ11+y2dy=etanโ1y
Now we can write the given differential equation is:
xetanโ1y=โซtanโ1y1+y2etanโ1ydy+c
Now let S = โซtanโ1y1+y2etanโ1ydy
Substituting tanโ1y=t, such that 11+y2dy=dt
Now, we get:
S = โซtanโ1y1+y2etanโ1ydy=โซtetdt
=tetโโซ1etdt=tetโet=et(tโ1)
S=etanโ1y(tanโ1yโ1)
Now we substitute the value of S in the differential equation:
xetanโ1y=etanโ1y(tanโ1yโ1)+c
Hence the general solution for the differential equation is:
x=(tanโ1y)+cetanโ1y