Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Linear Differential Equations Definition
3.
Formula for General Solution of Linear Differential Equations
4.
Steps To Solve Linear Differential Equations
5.
Solved Examples
6.
FAQs
7.
Key Takeaways
Last Updated: Mar 27, 2024

Linear Differential Equations

Author Rajat Agrawal
0 upvote
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

A linear differential equation is an equation with a variable, its derivative, and a few other functions.

Linear differential equations with constant coefficients are widely used in the study of electrical circuits, mechanical systems, transmission lines, beam loading, strut and column displacement, shaft whirling, and other topics.

Let’s learn about linear differential equations in-depth.

Linear Differential Equations Definition

The linear polynomial equation, which consists of derivatives of several variables, defines a linear differential equation. When the function is dependent on variables and the derivatives are partial, it is also known as Linear Partial Differential Equation.

The expression for a general first-order differential equation is:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>d</mi><mi>y</mi></mrow><mrow><mi>d</mi><mi>x</mi></mrow></mfrac><mo>+</mo><mi>P</mi><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mi>Q</mi></math> where y can be constant or function, and dy/dx is a derivative.

The value of variable y is determined by the solution of the linear differential equation.

A linear differential equation in y.

<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>d</mi><mi>y</mi></mrow><mrow><mi>d</mi><mi>x</mi></mrow></mfrac><mo>+</mo><mi>P</mi><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mi>Q</mi></math>

A linear differential equation in x.

<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>d</mi><mi>x</mi></mrow><mrow><mi>d</mi><mi>y</mi></mrow></mfrac><mo>+</mo><mi>P</mi><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mi>Q</mi></math>

A few examples of linear differential equations are:-

1.) dy/dx + 5y = cos(x)

2.) dx/dy + tan(x) = 10y

Non-Linear Differential Equations: A nonlinear differential equation is defined as the equation in which the unknown function and its derivatives are not linear. 

We can use a formula to solve a linear differential equation, a common type of differential problem. Let's learn how to obtain the general solution of a linear differential equation using the formula and derivation.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Formula for General Solution of Linear Differential Equations

The two important formulas for finding the general solution of linear differential equations are as follows.

1.) The general solution for the differential equation of the form dy/x+Py = Q is given by:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mfenced><mrow><mi>Q</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>.</mo><mi>d</mi><mi>x</mi></mrow></mfenced><mo>+</mo><mi>C</mi></math>, where Integrating Factor (I.F) = <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo></mrow></msup></mstyle></math>

2.) The general solution for the differential equation of the form dx/y+Px = Q is given by:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mfenced><mrow><mi>Q</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>.</mo><mi>d</mi><mi>y</mi></mrow></mfenced><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi></math>, where Integrating Factor (I.F) = <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>y</mi></mrow></msup></mstyle></math>

Steps To Solve Linear Differential Equations

The general solutions of a linear differential equation can be written using the three easy steps given below.

Step 1. Simplify the differential equation in the form dy/dx + Py = Q or dx/dy + Px = Q, where P and Q can be constants or functions.

Step 2. Find the Integrating Factor for the linear differential equation. 

Integrating Factor (I.F) = <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo></mrow></msup></mstyle></math>

or

Integrating Factor (I.F) = <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>y</mi></mrow></msup></mstyle></math>

Step 3. Now the solution of the linear differential equation can be written as follows.

 <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mfenced><mrow><mi>Q</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>.</mo><mi>d</mi><mi>x</mi></mrow></mfenced><mo>+</mo><mi>C</mi></math>

or

<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mfenced><mrow><mi>Q</mi><mo>.</mo><mfenced><mrow><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>.</mo><mi>d</mi><mi>y</mi></mrow></mfenced><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi></math>

The application of the above steps can be understood by solving some of the problems based on linear differential equations.

Let’s discuss some solved problems on Linear differential equations.

Solved Examples

Example 1. Find the general solution of the differential equation dy/dx + sec(x).y = 15.

Solution. Compare the given differential equation with dy/dx + Py = Q.

P = sec(x) and  Q = 15.

Let’s now find the Integrating factor using the formula, Integrating Factor (I.F) = <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo></mrow></msup></mstyle></math>

<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathsize="20px"><mo>&#x21D2;</mo><mi>I</mi><mo>.</mo><mi>F</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>P</mi><mo>.</mo><mi>d</mi><mi>x</mi></mrow></msup><mspace linebreak="newline"/><mo>&#x21D2;</mo><mi>I</mi><mo>.</mo><mi>F</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mi>s</mi><mi>e</mi><mi>c</mi><mfenced><mi>x</mi></mfenced><mo>.</mo><mi>d</mi><mi>x</mi></mrow></msup><mspace linebreak="newline"/><mo>&#x21D2;</mo><mi>I</mi><mo>.</mo><mi>F</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><msup><mi>e</mi><mrow><mi>ln</mi><mfenced><mrow><mi>sec</mi><mfenced><mi>x</mi></mfenced><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mfenced><mi>x</mi></mfenced></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mi>s</mi><mi>e</mi><mi>c</mi><mfenced><mi>x</mi></mfenced><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mfenced><mi>x</mi></mfenced></mrow></msup><mo>&#xA0;</mo><mspace linebreak="newline"/><mspace linebreak="newline"/></mstyle></math>

Now we can rewrite the LHS of I.F as follows.

<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#x21D2;</mo><mi>d</mi><mfenced><mrow><mi>y</mi><mo>&#xD7;</mo><mi>I</mi><mo>.</mo><mi>F</mi></mrow></mfenced><mo>/</mo><mi>d</mi><mi>x</mi><mspace linebreak="newline"/><mo>&#x21D2;</mo><mi>d</mi><mfenced><mrow><mi>y</mi><mo>&#xD7;</mo><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mrow></mfenced><mspace linebreak="newline"/><mo>&#x21D2;</mo><mi>d</mi><mfenced><mrow><mi>y</mi><mo>&#xD7;</mo><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mrow></mfenced><mo>/</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>15</mn><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></math>

Integrating both sides w.r.t x,  we get.

<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#x222B;</mo><mi>d</mi><mfenced><mrow><mi>y</mi><mo>&#xD7;</mo><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mn>15</mn><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced><mo>.</mo><mi>d</mi><mi>x</mi><mspace linebreak="newline"/><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>y</mi><mo>&#xD7;</mo><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>15</mn><mfenced><mrow><mi>ln</mi><mfenced open="|" close="|"><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>log</mi><mfenced open="|" close="|"><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mrow></mfenced><mspace linebreak="newline"/><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mfrac><mrow><mn>15</mn><mfenced><mrow><mi>ln</mi><mfenced open="|" close="|"><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>log</mi><mfenced open="|" close="|"><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mrow></mfenced></mrow><mfenced><mrow><mi>s</mi><mi>e</mi><mi>c</mi><mo>&#xA0;</mo><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>tan</mi><mo>&#xA0;</mo><mi>x</mi></mrow></mfenced></mfrac><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi></math>

Example 2. Find the general solution of the differential equation <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi><mo>.</mo><mi>d</mi><mi>y</mi><mo>&#xA0;</mo><mo>-</mo><mo>&#xA0;</mo><mfenced><mrow><mi>y</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mn>5</mn><msup><mi>x</mi><mn>2</mn></msup></mrow></mfenced><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>0</mn></math>

Solution. Simplify the given differential equation in the form dy/dx + Py = Q.

The simplified equation is:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>d</mi><mi>y</mi></mrow><mrow><mi>d</mi><mi>x</mi></mrow></mfrac><mo>&#xA0;</mo><mo>-</mo><mo>&#xA0;</mo><mfrac><mi>y</mi><mi>x</mi></mfrac><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>5</mn><mi>x</mi></math>

Compare the simplified differential equation with dy/dx + Py = Q.

P = -1/x and Q = 5x.
The Integrating Factor I.F is: 

 <math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mfrac><mrow><mo>-</mo><mn>1</mn></mrow><mi>x</mi></mfrac><mo>.</mo><mi>d</mi><mi>x</mi></mrow></msup><mspace linebreak="newline"/><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>I</mi><mo>.</mo><mi>F</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><msup><mi>e</mi><mrow><mo>&#x222B;</mo><mo>-</mo><mi>log</mi><mfenced><mi>x</mi></mfenced><mo>.</mo><mi>d</mi><mi>x</mi></mrow></msup><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mfrac><mn>1</mn><mi>x</mi></mfrac><mspace linebreak="newline"/></math>

<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>I</mi><mo>.</mo><mi>F</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><msup><mi>e</mi><mrow><mo>-</mo><mi>log</mi><mfenced><mi>x</mi></mfenced></mrow></msup><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mfrac><mn>1</mn><mi>x</mi></mfrac></math>

The solution of the differential equation can be given as:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>y</mi><mo>.</mo><mfrac><mn>1</mn><mi>x</mi></mfrac><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mn>5</mn><mi>x</mi><mo>&#xA0;</mo><mo>.</mo><mo>&#xA0;</mo><mfrac><mn>1</mn><mi>y</mi></mfrac><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi><mspace linebreak="newline"/><mo>&#x21D2;</mo><mfrac><mi>y</mi><mi>x</mi></mfrac><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mo>&#x222B;</mo><mn>5</mn><mo>.</mo><mi>d</mi><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi><mspace linebreak="newline"/><mo>&#x21D2;</mo><mfrac><mi>y</mi><mi>x</mi></mfrac><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>5</mn><mi>x</mi><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>C</mi><mspace linebreak="newline"/><mo>&#x21D2;</mo><mo>&#xA0;</mo><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>5</mn><msup><mi>x</mi><mn>2</mn></msup><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>x</mi><mi>C</mi></math>

The general solution of the Linear differential equation is <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mn>5</mn><msup><mi>x</mi><mn>2</mn></msup><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mi>x</mi><mi>C</mi></math>.

FAQs

1. Define Linear Differential Equation.

The linear polynomial equation, which consists of derivatives of several variables, defines a linear differential equation.

2. Mention some examples of the Linear differential equations. 

A few examples of linear differential equations are:-

a.) dy/dx + 10y = sin(x)

b.) dx/dy + sec(x) = 15y

3. Difference between linear and non-linear differential equations?

A linear equation will always have a solution for all x and y values, but nonlinear equations may or may not have a solution for all x and y values.

Key Takeaways

In this article, we have extensively discussed Linear Differential Equations, their definition, and how to solve linear differential equations. If you want to learn more, check out our articles on the Partial Differential Equations and System of Linear Equations.

Do upvote our blog to help other ninjas grow.

Happy Coding!

Previous article
Partial Differential Equations
Next article
Difference Between Linear And Non-Linear Differential Equations
Live masterclass