stylistic:tone, linguistic:paraphrasing, information:filtering, quality:corruption
Solving first order linear ordinary differential equations

Integrating factors are useful for solving ordinary differential equations that can be expressed in the form

The basic idea is to find some function, say M (x) {\displaystyle M(x)}, called the "integrating factor", which we can multiply through our differential equation in order to bring the left-hand side under a common derivative. For the canonical first-order linear differential equation shown above, the integrating factor is e ∫ P (x) d x {\displaystyle e^{\int P(x)\,dx}}.

Note that it is not necessary to include the arbitrary constant in the integral, or absolute values in case the integral of P (x) {\displaystyle P(x)} involves a logarithm. Firstly, we only need one integrating factor to solve the equation, not all possible ones; secondly, such constants and absolute values will cancel out even if included. For absolute values, this can be seen by writing | f (x) | = f (x) sgn f (x) {\displaystyle |f(x)|=f(x)\operatorname {sgn} f(x)}, where sgn {\displaystyle \operatorname {sgn} } refers to the sign function, which will be constant on an interval if f (x) {\displaystyle f(x)} is continuous. As ln | f (x) | {\displaystyle \ln |f(x)|} is undefined when f (x) = 0 {\displaystyle f(x)=0}, and a logarithm in the antiderivative only appears when the original function involved a logarithm or a reciprocal (neither of which are defined for 0), such an interval will be the interval of validity of our solution.

To derive this, let M (x) {\displaystyle M(x)} be the integrating factor of a first order linear differential equation such that multiplication by M (x) {\displaystyle M(x)} transforms a non-integrable expression into an integrable derivative, then:

Going from step 2 to step 3 requires that M (x) P (x) = M ′ (x) {\displaystyle M(x)P(x)=M'(x)}, which is a separable differential equation, whose solution yields M (x) {\displaystyle M(x)} in terms of P (x) {\displaystyle P(x)}:

To verify, multiplying by M (x) {\displaystyle M(x)} gives

By applying the product rule in reverse, we see that the left-hand side can be expressed as a single derivative in x {\displaystyle x}

We use this fact to simplify our expression to

Integrating both sides with respect to x {\displaystyle x}

where C {\displaystyle C} is a constant.

Moving the exponential to the right-hand side, the general solution to Ordinary Differential Equation is:

In the case of a homogeneous differential equation, Q (x) = 0 {\displaystyle Q(x)=0} and the general solution to Ordinary Differential Equation is:

for example, consider the differential equation

We can see that in this case P (x) = − 2 x {\displaystyle P(x)={\frac {-2}{x}}}

Multiplying both sides by M (x) {\displaystyle M(x)} we obtain

The above equation can be rewritten as

By integrating both sides with respect to x we obtain

or

The same result may be achieved using the following approach

Reversing the quotient rule gives

or

or

where C {\displaystyle C} is a constant.