1. Home
  2. Explore
  3. Mathematics
  4. First-Order Differential Equations

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

First-Order Differential Equations

First-Order Differential Equations: Separation and Integrating Factors

A first-order differential equation contains a function and its first derivative. Two useful solution methods are separation of variables, which rearranges an equation so that each variable appears on a different side, and the integrating-factor method, which solves first-order linear equations.

An initial value problem (IVP) includes a condition specifying the value of the unknown function at a particular input. That condition determines the constant of integration in the general solution.


1. Separable Differential Equations

A differential equation is separable when it can be rearranged into the form

g(y) dy=f(x) dx.g(y)\,dy=f(x)\,dx.g(y)dy=f(x)dx.

The variables are separated by placing all expressions involving yyy with dydydy on one side, and all expressions involving xxx with dxdxdx on the other. Integrating both sides then gives a relationship between xxx and yyy.

Worked example

Solve the initial value problem

x2dydx=4x2−x−2(x+1)(y+1),y(1)=1.x^2\frac{dy}{dx} = \frac{4x^2-x-2}{(x+1)(y+1)}, \qquad y(1)=1.x2dxdy​=(x+1)(y+1)4x2−x−2​,y(1)=1.

Step 1: Separate the variables

Multiply both sides by y+1y+1y+1 and divide by x2x^2x2:

(y+1)dydx=4x2−x−2x2(x+1).(y+1)\frac{dy}{dx} = \frac{4x^2-x-2}{x^2(x+1)}.(y+1)dxdy​=x2(x+1)4x2−x−2​.

Multiplying by dxdxdx gives

(y+1) dy=4x2−x−2x2(x+1) dx.(y+1)\,dy = \frac{4x^2-x-2}{x^2(x+1)}\,dx.(y+1)dy=x2(x+1)4x2−x−2​dx.

The yyy-expression and the xxx-expression are now on separate sides.

Step 2: Decompose the rational function

The denominator contains a linear factor, x+1x+1x+1, and a repeated linear factor, x2x^2x2. Therefore, use the partial-fraction form

4x2−x−2x2(x+1)=Ax+1+Bx+Cx2.\frac{4x^2-x-2}{x^2(x+1)} = \frac{A}{x+1}+\frac{B}{x}+\frac{C}{x^2}.x2(x+1)4x2−x−2​=x+1A​+xB​+x2C​.

Multiplying through by x2(x+1)x^2(x+1)x2(x+1) gives

4x2−x−2=Ax2+Bx(x+1)+C(x+1).4x^2-x-2=Ax^2+Bx(x+1)+C(x+1).4x2−x−2=Ax2+Bx(x+1)+C(x+1).

Equating coefficients of like powers of xxx gives

A+B=4,B+C=−1,C=−2.A+B=4,\qquad B+C=-1,\qquad C=-2.A+B=4,B+C=−1,C=−2.

Thus,

C=−2,B=1,A=3,C=-2,\qquad B=1,\qquad A=3,C=−2,B=1,A=3,

so the decomposition is

4x2−x−2x2(x+1)=3x+1+1x−2x2.\frac{4x^2-x-2}{x^2(x+1)} = \frac{3}{x+1}+\frac{1}{x}-\frac{2}{x^2}.x2(x+1)4x2−x−2​=x+13​+x1​−x22​.

Step 3: Integrate both sides

Integrating the separated equation gives

∫(y+1) dy=∫(3x+1+1x−2x2) dx.\int (y+1)\,dy = \int \left(\frac{3}{x+1}+\frac{1}{x}-\frac{2}{x^2}\right)\,dx.∫(y+1)dy=∫(x+13​+x1​−x22​)dx.

Therefore,

y22+y=3ln⁡∣x+1∣+ln⁡∣x∣+2x+C.\frac{y^2}{2}+y = 3\ln|x+1|+\ln|x|+\frac{2}{x}+C.2y2​+y=3ln∣x+1∣+ln∣x∣+x2​+C.

The term 2x\frac{2}{x}x2​ results from integrating −2x2-\frac{2}{x^2}−x22​.

Step 4: Apply the initial condition

Substitute x=1x=1x=1 and y=1y=1y=1:

122+1=3ln⁡2+ln⁡1+21+C.\frac{1^2}{2}+1 = 3\ln 2+\ln 1+\frac{2}{1}+C.212​+1=3ln2+ln1+12​+C.

Since ln⁡1=0\ln 1=0ln1=0,

32=3ln⁡2+2+C,\frac{3}{2}=3\ln 2+2+C,23​=3ln2+2+C,

and hence

C=−12−3ln⁡2=−12−ln⁡8.C=-\frac{1}{2}-3\ln 2 =-\frac{1}{2}-\ln 8.C=−21​−3ln2=−21​−ln8.

The solution is therefore

y22+y=3ln⁡∣x+1∣+ln⁡∣x∣+2x−12−ln⁡8.\boxed{ \frac{y^2}{2}+y = 3\ln|x+1|+\ln|x|+\frac{2}{x} -\frac{1}{2}-\ln 8 }.2y2​+y=3ln∣x+1∣+ln∣x∣+x2​−21​−ln8​.

This is an implicit solution: it gives a relationship between xxx and yyy without isolating yyy. Near the initial point x=1x=1x=1, the logarithms can be written without absolute-value signs because xxx and x+1x+1x+1 are positive there.

The original equation is undefined at x=0x=0x=0, x=−1x=-1x=−1, and y=−1y=-1y=−1. Any solution must remain in a region where the original equation is defined.


2. First-Order Linear Differential Equations

A first-order linear differential equation has the standard form

dydx+P(x)y=Q(x).\frac{dy}{dx}+P(x)y=Q(x).dxdy​+P(x)y=Q(x).

Its integrating factor is

μ(x)=e∫P(x) dx.\mu(x)=e^{\int P(x)\,dx}.μ(x)=e∫P(x)dx.

Multiplying the equation by μ(x)\mu(x)μ(x) makes its left side the derivative of a product:

μ(x)dydx+μ(x)P(x)y=ddx(μ(x)y).\mu(x)\frac{dy}{dx}+\mu(x)P(x)y = \frac{d}{dx}\bigl(\mu(x)y\bigr).μ(x)dxdy​+μ(x)P(x)y=dxd​(μ(x)y).

Consequently, the equation becomes

ddx(μ(x)y)=μ(x)Q(x).\frac{d}{dx}\bigl(\mu(x)y\bigr)=\mu(x)Q(x).dxd​(μ(x)y)=μ(x)Q(x).

Integrating both sides yields

μ(x)y=∫μ(x)Q(x) dx+C,\mu(x)y=\int \mu(x)Q(x)\,dx+C,μ(x)y=∫μ(x)Q(x)dx+C,

so the general solution is

y=1μ(x)(∫μ(x)Q(x) dx+C).y=\frac{1}{\mu(x)} \left(\int \mu(x)Q(x)\,dx+C\right).y=μ(x)1​(∫μ(x)Q(x)dx+C).

Worked example

Solve the initial value problem

x2dydx+3xy=x4ln⁡x+1,y(1)=0.x^2\frac{dy}{dx}+3xy=x^4\ln x+1, \qquad y(1)=0.x2dxdy​+3xy=x4lnx+1,y(1)=0.

Because ln⁡x\ln xlnx appears, the problem is considered for x>0x>0x>0.

Step 1: Put the equation in standard form

Divide every term by x2x^2x2:

dydx+3xy=x2ln⁡x+1x2.\frac{dy}{dx}+\frac{3}{x}y = x^2\ln x+\frac{1}{x^2}.dxdy​+x3​y=x2lnx+x21​.

Thus,

P(x)=3x,Q(x)=x2ln⁡x+1x2.P(x)=\frac{3}{x}, \qquad Q(x)=x^2\ln x+\frac{1}{x^2}.P(x)=x3​,Q(x)=x2lnx+x21​.

Step 2: Find the integrating factor

μ(x)=e∫3x dx=e3ln⁡x=x3\mu(x) = e^{\int \frac{3}{x}\,dx} = e^{3\ln x} = x^3μ(x)=e∫x3​dx=e3lnx=x3

for x>0x>0x>0.

Multiplying the standard-form equation by x3x^3x3 gives

x3dydx+3x2y=x5ln⁡x+x.x^3\frac{dy}{dx}+3x^2y = x^5\ln x+x.x3dxdy​+3x2y=x5lnx+x.

The left side is the derivative of x3yx^3yx3y:

ddx(x3y)=x5ln⁡x+x.\frac{d}{dx}(x^3y)=x^5\ln x+x.dxd​(x3y)=x5lnx+x.

Step 3: Integrate

Integrating both sides gives

x3y=∫x5ln⁡x dx+∫x dx+C.x^3y=\int x^5\ln x\,dx+\int x\,dx+C.x3y=∫x5lnxdx+∫xdx+C.

The first integral requires integration by parts. Let

u=ln⁡x,dv=x5 dx,u=\ln x,\qquad dv=x^5\,dx,u=lnx,dv=x5dx,

so that

du=1x dx,v=x66.du=\frac{1}{x}\,dx,\qquad v=\frac{x^6}{6}.du=x1​dx,v=6x6​.

Using ∫u dv=uv−∫v du\int u\,dv=uv-\int v\,du∫udv=uv−∫vdu,

∫x5ln⁡x dx=x66ln⁡x−16∫x5 dx=x66ln⁡x−x636.\int x^5\ln x\,dx = \frac{x^6}{6}\ln x-\frac{1}{6}\int x^5\,dx = \frac{x^6}{6}\ln x-\frac{x^6}{36}.∫x5lnxdx=6x6​lnx−61​∫x5dx=6x6​lnx−36x6​.

Also,

∫x dx=x22.\int x\,dx=\frac{x^2}{2}.∫xdx=2x2​.

Therefore,

x3y=x66ln⁡x−x636+x22+C.x^3y = \frac{x^6}{6}\ln x-\frac{x^6}{36} +\frac{x^2}{2}+C.x3y=6x6​lnx−36x6​+2x2​+C.

Dividing by x3x^3x3 gives the general solution

y=x−3(x66ln⁡x−x636+x22+C).y = x^{-3} \left( \frac{x^6}{6}\ln x-\frac{x^6}{36} +\frac{x^2}{2}+C \right).y=x−3(6x6​lnx−36x6​+2x2​+C).

Step 4: Apply the initial condition

Substitute x=1x=1x=1 and y=0y=0y=0:

0=166ln⁡1−1636+122+C.0 = \frac{1^6}{6}\ln 1-\frac{1^6}{36} +\frac{1^2}{2}+C.0=616​ln1−3616​+212​+C.

Since ln⁡1=0\ln 1=0ln1=0,

0=−136+12+C,0=-\frac{1}{36}+\frac{1}{2}+C,0=−361​+21​+C,

so

C=−1736.C=-\frac{17}{36}.C=−3617​.

The solution to the IVP is

y=x−3(x66ln⁡x−x636+x22−1736).\boxed{ y = x^{-3} \left( \frac{x^6}{6}\ln x-\frac{x^6}{36} +\frac{x^2}{2}-\frac{17}{36} \right) }.y=x−3(6x6​lnx−36x6​+2x2​−3617​)​.

3. Choosing and Applying the Methods

Separation of variables

Use separation when the equation can be rearranged so that all yyy-dependent terms multiply dydydy and all xxx-dependent terms multiply dxdxdx. The first example separates directly after multiplying by y+1y+1y+1 and dividing by x2x^2x2.

Integrating factors

Use an integrating factor when the equation can be written in the linear form

dydx+P(x)y=Q(x).\frac{dy}{dx}+P(x)y=Q(x).dxdy​+P(x)y=Q(x).

The equation must first be divided as needed to make the coefficient of dydx\frac{dy}{dx}dxdy​ equal to 111. The integrating factor then converts the left side into the derivative of a product.

Using an initial condition

Both methods first produce a family of solutions containing an arbitrary constant CCC. Substituting the given pair (x,y)(x,y)(x,y) into the general solution determines CCC and identifies the specific solution to the initial value problem.

Integration techniques

The algebraic form of an integral determines the integration technique:

  • Partial fractions simplify rational expressions whose denominators factor into linear or repeated factors.

  • Integration by parts is useful for products such as x5ln⁡xx^5\ln xx5lnx.

  • Term-by-term integration applies to sums, so each term can be integrated separately.

In either method, the final solution must satisfy both the differential equation and the initial condition, while remaining in a domain where the original equation is defined.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent