# Differential equations

A differential equation is an equation involving a function and its derivative (or derivatives). Our goal is to find the function, if one exists, that satisfies the given differential equation. For example, y = sin(x) is a solution to the ordinary differential equation,

To show this, we can find the derivative of the solution, y'(x), and substitute it, as well as y(x), into the differential equation. Differentiating y = sin(x) yields y' = cos(x). Substituting these into the differential equation,

which satisfies the differential equation. Further, it can be shown that y = Csin(x) is a family of solutions called the general solution of the differential equation, where C is some arbitrary constant. The solution y = sin(x) is referred to as a particular solution to the differential equation.

There are various types of differential equations and a number of different methods that can be used to solve them. It is therefore important to be able to classify different differential equations.

## Classifying differential equations

On this page, we will define two types of differential equations: ordinary differential equations and partial differential equations.

An ordinary differential equation (ODE) contains a function with one independent variable along with its derivative(s). A partial differential equation (PDE) contains a function of several variables and their partial derivatives. Below are a few examples of each.

- Ordinary differential equations

- Partial differential equations

Differential equations can be further classified based on characteristics such as their order, degree, linearity, and whether or not they are homogeneous.

## Order and degree

The order of a differential equation is the order of the highest derivative in the equation. Below are some examples of differential equations based on their order.

- 1st order ODE -
- 2nd order ODE -
- 3rd order ODE -
- 2nd order PDE -

Given that the differential equation is written in the form of a polynomial and its derivatives, the degree of the differential equation is the power of the highest order derivative in the equation. Below are some examples.

- 1st degree -
- 1st degree -
- 3rd degree -

In the first two equations, the degree is determined by y' and y'', both of which have a power of 1. In the third equation, the highest order derivative is , which has a power of 3.

## Solving differential equations

There are different approaches to solving differential equations depending on the type of equation being solved. Below are some examples.

### Separable differential equations

Given that a differential equation can be written in the form,

where P and Q are functions of x and y respectively, then the functions and their differentials (dx, dy, etc.) can be separated to:

The differential equation can then be solved by integrating both sides with respect to their corresponding variables.

Example

Find the general solution for .

Separating the variables yields:

Then, integrate both sides with their respective variables:

## Homogeneous differential equations

A first order differential equation in the form is homogeneous if f can be written as some other function, F, such that . The differential equation, can then be solved using the separation of variables technique described in the previous section.

For example, let for the differential equation . Dividing the numerator and denominator of f by x^{2} yields the equivalent form:

Thus, the differential equation is homogeneous since we can write it as a function of . We can then solve the converted differential equation using separation of variables by letting which results in y = vx and by the product rule. Substituting these new values into the converted differential equation yields:

Separating the variables yields:

Then, integrating both sides of the equation:

Using back substitution and solving for y, the solution is:

## Linear differential equations

A differential equation in the form,

,

where P and Q are continuous functions, is a first order linear differential equation. To solve this type of differential equation, multiply both sides by a function u(x), called an integrating factor, such that u'(x) = P(x)u(x). Thus, dividing both sides by u(x) yields:

Then, integrating both sides with respect to x yields the value of u(x):

Using C = 1 makes the process more convenient when multiplying by the integrating factor, so .

Example

Solve

Dividing both sides by sin^{2}(x) yields:

The above equation is in the form of a first order linear equation. Since P(x) = csc^{2}(x), the integrating factor is:

Multiplying both sides of the differential equation by the integrating factor yields:

By the product rule for derivatives, the left side of the equation above is the derivative of . Substituting this into the equation yields:

Then, integrating both sides and solving for y yields the solution:

## Exact differential equation

A differential equation in the form,

where P_{y}(x, y) = Q_{x}(x, y) is called an exact differential equation if there is some function f(x, y) such that:

When these conditions are met, the solution is f(x, y) = C.

Example

Solve

Let P(x, y) = (x^{2} + 4y) and Q(x, y) = (y^{4} + 4x). Then,

,

making the differential equation an exact differential equation. To find the solution, integrate either P or Q with respect to their respective variables. Integrating P in terms of x yields:

To find g(y), set f_{y}(x, y) = Q(x, y). Now,

,

so:

Then, to find g(y), integrate the derivative with respect to y:

Thus:

Since f(x, y) = C,

Combining the constants, the solution is therefore:

Alternatively, integrating Q with respect to y yields:

To find h(x), set f_{x}(x, y) = P(x, y). Now,

so:

Then, integrating the derivative with respect to x yields:

Thus:

Again, since f(x, y) = C,

Combining the constants, the solution is:

, |

Which agrees with the solution when integrating P with respect to x.