Linear Differential Equations

Last Updated : 20 Jan, 2026

Linear Differential Equations are differential equations where the unknown function and its derivatives appear linearly. In other words, the equation is a linear combination of the function and its derivative, with constant coefficients. Such types of equations have solutions that can be expressed as a sum of particular and homogeneous solutions.

Linear-Differential-Equation
Linear differential equation in y vs. in x

1) Equation of form dy/dx + Py = Q, is known as First-Order Differential Equation.

Where: P and Q are either constant or functions of x.

2) Equation of form d2y/dx2 + Pdy/dx + Qy = R, is called Second-Order Differential Equation.

Where: P, Q, and R are functions of x.

Examples of Linear Differential Equations

  • dy/dy ​+3y = x
  • x log x dy/dx + y = ex
  • dx/dy = sin y + x

Order of Linear Differential Equations

The order of linear differential equations is determined by the highest derivative present in the differential equation.

  • First order linear differential equations involve only the first derivative, dy/dx + Py = Q.
  • Second order linear differential equations involve the second derivative, d2y/dx2 + Pdy/dx + Qy = R.
  • Continuing like this, the nth order linear differential equations involve the nth derivative in the equation,

andny/dxn + an-1dn-1y/dxn-1 + . . . + a1 dy/dx + a0y = f(x),

Where

  • n - the order of linear differential equation.

Formula for General Solution of Linear Differential Equations

Formula for general solution of linear ODE depends on order and nature of the given equation. Formula for first order and different cases of second order ODE are given as follows:

Formula for First-Order Lineaar ODE

For any first-order linear ODE of form \frac{dy}{dx} + P(x)y = Q(x) , where P(x) and Q(x) functions of x. Then, the general solution to this equation can be found using the following formula:

y(x) = \frac{1}{\text{I.F.}} \left( \int Q(x) \cdot \text{I.F.} \, dx + C \right)

Where

  • C - constant of integration and I.F. (Integration Factor) = e∫P(x)dx.

Formula for Second-Order Linear ODE

For any second-order linear ODE of form \frac{d^2y}{dx^2} + P(x) \frac{dy}{dx} + Q(x)y = R(x) , where P(x), Q(x), and R(x) are functions of x. The general solution to this equation depends on the nature of the roots of its associated characteristic equation.

Nature of RootsGeneral Solution
Distinct Real Roots (r1 ≠ r2)

y(x) = C_1 e^{r_1x} + C_2 e^{r_2x}

Repeated Real Roots (r1 = r2)

y(x) = (C_1 + C_2 x) e^{r_1x}

Complex Conjugate Roots (r1 = α + iβ, r2 = α - iβ )

y(x) = e^{\alpha x} \left( C_1 \cos(\beta x) + C_2 \sin(\beta x) \right)

Where:

  • r1 and r2 are the roots of the characteristic equation.
  • α and β are the real and imaginary parts of the complex conjugate roots respectively.
  • C1​ and C2​ are arbitrary constants determined by initial conditions.

First Order Linear Differential Equations

A first-order differential equation involves only the first derivative of the unknown function.

General form first-order linear differential is,

dy/dx +Py = Q

Where P and Q are either constant or function of x.

Examples of Linear Differential Equations

  • dx/dy + yx = 1
  • dx/dy = tan y - x

How to Solve First-Order Linear Differential Equation?

Consider the first-order linear differential equation:

dy/dx + Py = Q . . . . . . (1)

Where P and Q are constant or functions of x.

Now, consider a function of x, say, f(x).

Multiply both the sides of the equation (1) by the function f(x), we get

f(x)â‹…dy/dx + Pâ‹…f(x)â‹…y = Qâ‹…f(x) . . . . . . (2)

We will choose the function f(x) in such a way that the right-hand side of the equation (2) will becomes derivative of f(x)â‹…y.

f(x)â‹…dy/dx + Pâ‹…f(x)â‹…y = d/dx[f(x)â‹…y]

On simplifying, we get

f(x)dy/dx + Pf(x)y = f(x)dy/dx + yf'(x)

⇒ Pf(x)y = yf'(x)
⇒ Pf(x) = f'(x)
⇒ P = f'(x)/f(x)

Now, integrate both the sides with respect to x, we get

∫P⋅dx = ∫ [f'(x)/f(x)] dx
∫P⋅dx = log (f(x))

Taking exponents on both the sides, we get

e∫P⋅dx = elog (f(x))
⇒ e∫P⋅dx = f(x) [Since elog x = x]

This function f(x) = e∫P⋅dx is called integrating factor of given linear differential equation. It is denoted by I.F.

So, I.F = e∫P⋅dx

Now, multiply both the sides of the linear differential equation (1) by I.F, we get

e∫P⋅dx dy/dx + Pye∫P⋅dx = Qe∫P⋅dx
⇒ d(ye∫P⋅dx)/dx = Qe∫P⋅dx (Since d(uv)/dx = udv/dx + vdu/dx)

Integrate both the sides with respect to x, we get

ye∫P⋅dx = ∫Qe∫P⋅dx dx + C, where C is integration constant.
⇒ y = e-∫P⋅dx ∫Qe∫P⋅dx dx + e-∫P⋅dx C
⇒ y × I.F = ∫Q × I.F dt + C

Where I.F is the integrating factor.

Thus, above obtained equation is general solution of the given first order linear differential equation.

Second-Order Linear Differential Equation

A second-order differential equation is the type of differential equation that consists of a function and its second-order derivative.

The equation of the form,

d2y/dx2 + Pdy/dx + Qy = R, is called the second-order differential equation.

Where

  • P, Q and R are the functions of x.

How to Solve Second Order Linear Differential Equation?

There are two types of second order linear differential equation, namely homogeneous and non-homogeneous second order linear differential equation.

A. For Homogeneous Second Order Linear Differential Equation:

Consider the homogeneous second order linear differential equation as,

d2y/dx2 + Pdy/dx + Qy = R . . . . . . (1)

Where P, Q and R are constants.

Assume, solution of given linear differential equation be of the form,

y = eλx, where λ is a constant.

Now, we will find the values of λ for which the solution satisfies the given second order differential equation.

So, dy/dx = λeλx and d2y/dx2 = λ2eλx

Substitute the values of dy/dx, d2y/dx2 and y in the equation (1), we get

λ2eλx + Pλeλx + Qeλx = 0

⇒ eλx(λ2 + Pλ + Q) = 0

We know that exponent function cannot be negative.

So, λ2 + Pλ + Q = 0. This equation is known as auxiliary equation or characteristics equation of the given second order linear differential equation.

Observe that auxiliary equation is an quadratic equation which can be easily solved.

Let λ1 and λ2 be the roots or zeroes of the quadratic equation.

Case 1: If roots are real and unequal, λ1 ≠ λ2. Then, the solution of the second order differential equation will be,

y = Aeλ1x + Beλ2x, where A, B are constants.

Case 2: If roots are real and equal, λ1 = λ2 = λ. Then, the solution of the second order differential equation will be,

y = (A + Bx)eλx, where A, B are constants.

Case 3: If roots are complex, i.e., λ1 = α+ iβ and λ2 = α- iβ, Then, the solution of the second order differential equation will be,

y = eαx(A cos βx + B sin βx), where A, B are constants.

B. For Non-Homogeneous Second Order Differential Equation:

Consider the non-homogeneous second order linear differential equation as,

d2y/dx2 + Pdy/dx + Qy = f(x)

Where

  • P, Q and R are constants.

Solution of second order linear differential equation is given as,

y = yc + yp, where yc is the complementary function and yp is the particular integral.

Here, yc is the solution of the homogeneous second order linear differential equation.

d2yc/dx2 + Pdyc/dx + Qyc = 0

yc is calculated in the similar way as we have find the solution of homogeneous second order differential equation.

And yp is the solution of the equation,

d2yp/dx2 + Pdyp/dx + Qyp = f(x)

To find yp, we assume the solution of the function f(x). And then substitutes the values of d2y/dx2, dy/dx, y and f(x).

Then, we compare both the sides to get the values of coefficients and hence the value of particular integral, yp.

Few assumptions, we should know are:

f(x)

yp

eax

Aeax, where A is constant

anxn + an-1xn-1 + . . . + a1x + a0

Axn + Bxn-1 + . . . + Mx + N, where A, B, . . . N are constants

cos ax or sin ax

A cos ax + B sin ax, where A and B are constants

Linear Differential Equation Formula

General form of linear differential equation is given by,

andny/dxn + an-1dn-1y/dxn-1 + . . . + a1 dy/dx + a0y = f(x)

where, y is dependent variable, x is independent variable, n is the order of the differential equation, f(x) is given function of x and an, an-1, . . . a1, a0 are the functions of x.

Non-Linear Differential Equation

Differential equation in which unknown function and its derivative appear in a non-linear manner. Such types of equations is know as non-linear differential equation. In other words, the differential equation in which the unknown function and its derivative don't have straight line when plotted on the graph.

Linear vs Non-Linear Differential Equation

Differences between Linear and Non-linear differential equation are as follows:

Linear Differential Equation

Non-Linear Differential equation

Equation which involves dependent variable and its derivative is known as linear differential equation.Equation which do not involves dependent variable and its derivative is known as non-linear differential equation.
These types of equation gives straight line when plotted on the group.These types of equations do not have straight line when plotted on the graph.

For example: dy/dx + y = x

Here, y is dependent variable and dy/dx is its derivative.

For example: dy/dx + x2 = 1/x

Here, dependent variable "y" is missing whose derivative is dy/dx.

Homogeneous and Non Homogeneous Linear Differential Equations

Homogeneous Linear DE: A linear differential equation is homogeneous if the right-hand side consists only of zeros i.e., there is no term without dependent variable and their derivative.

Non-Homogeneous Linear DE: A linear differential equation is non-homogeneous if the right-hand side is not zero i.e., there are some term without dependent variable and their derivative.

Here are some of the key distinctions between homogeneous and non-homogeneous linear differential equations:

Homogeneous Linear DENon-homogeneous Linear DE
dy/dx ​+ P(x)y = 0dy/dx ​+ P(x)y = Q(x)
y = Ce−∫P(x)dxy = Ce−∫P(x)dx + yu
Trivial (Zero)Non-trivial (Non-zero)
  • dy/dx ​+ 2xy = 0
  • dy/dx + x2y = 0
  • dy/dx ​+ 2xyy = x
  • dy/dx + x2y = sin2x

Also Check:

Examples on Linear Differential Equation

Example 1: Solve the linear differential equation: x dy/dx + y = x.

Solution:

Given, x dy/dx + y = x

Rearrange the differential equation in the form dy/dx + Py = Q.

dy/dx + y/x = 1

Here, P = 1/x and Q = 1.

Find the integrating factor, I.F.

I.F. = e∫P⋅dx

⇒ I.F. = e∫1/x⋅dx

⇒ I.F. = elnx

⇒ I.F. = x

Multiply both the sides of the given differential equation by I.F, we get

xdy/dx + y = x

⇒ d(xy)/dx = x

Integrate both the sides with respect to x, we get

xy = ∫x dx + C

⇒ xy = x2 /2 + C

⇒ y = x/2 + x-1 C

This is the required solution.

Example 2: Find the general solution of the differential equation: (1 + t)dy/dt + y = 1.

Solution:

Given, (1 + t)dy/dt + y = 1.

Rearrange the differential equation in the form dy/dx + Py = Q.

dy/dx + 1/(1+t)y = 1/(1+t)

Here, P = 1/(1+t) and Q = 1/(1+t).

Find the integrating factor, I.F.

I.F = e∫P⋅dx

⇒ I.F. = e∫1/(1+t)⋅dx

⇒ I.F. = eln(1+t)

⇒ I.F. = 1+t

The general solution of linear differential equation is given by,

y × I.F = ∫Q × I.F dt + C

⇒ y(1+t) = ∫1/(1+t) × (1+t) dt + C

⇒ y(1+t) = ∫1 dt + C

⇒ y(1+t) = t + C

⇒ y = t/(1+t) + C/(1+t)

This is the required general solution of the given linear differential equation.

Practice Questions on Linear Differential Equation

Question 1: Solve the linear differential equation: dy/dx + ysin x = sin x

Question 2: Solve: (x + log y)dy + y dx = 0

Question 3: Solve: dx/dy + 2xy = e-y

Question 4: Solve the differential equation: dy/dx = y cos x - sin x

Question 5: Find the solution to: x dy/dx + y = ex

Question 6: Solve the differential equation: dy/dx = y2 - x2

Question 7: Solve: (y2 + x2) dx - 2xy dy = 0

Question 8: Solve the differential equation: dy/dx = (x2 + y2) / (x - y)

Question 9: Solve: x dy/dx + (y - x) = 0

Question 10: Find the general solution to: dy/dx + 2xy = x2

Comment

Explore