# How did we discover the method of solving the linear 1st order ODE?

I have the first order linear ode in the standard form which I'd like to solve:

$$\frac{d y}{d x}+P(x) y=f(x)$$

The solution in the book I'm reading (A First Course in Differential Equations with Modeling Applications by Dennis Zill 10th edition) is as follow:

The method for solving the differential equation above hinges on a remarkable fact that the left hand side of the equation can be recast into the form of the exact derivative of a product by multiplying both sides of the equation by a special function $$\mu(x)$$. It is relatively easy to find the function $$\mu(x)$$ because we want:

$$\frac{d}{d x}[\mu(x) y]=\mu \frac{d y}{d x}+\frac{d \mu}{d x} y=\mu\frac{d y}{d x}+\mu P y$$

The equality is true provided that:

$$\frac{d \mu}{d x}=\mu P$$

The last equation can be solved by separation of variables. Integrating

$$\frac{d \mu}{\mu}=P d x \quad \text { and solving } \quad \ln|\mu(x)|=\int P(x) d x+c_{1}$$

gives $$\mu(x)=c_{2} e^{\int P(x) d x}$$. Even though there are an infinite choices of $$\mu(x)$$ (all constant multiples of $$e^{\int P(x) d x}$$), all produce the same desired result. Hence we can simplify life and choose $$c_{2}=1$$.

The function $$\mu(x)=e^{\int P(x) d x}$$ is called an integrating factor for the differential equation.

Here is what we have so far: We multiplied both sides of the DE by the integrating factor and, by construction, the left-hand side is the derivative of a product of the integrating factor and y:

\begin{aligned} e^{\int P(x) d x} \frac{d y}{d x}+P(x) e^{\int P(x) d x} y &=e^{\int P(x) d x} f(x) \\ \frac{d}{d x}\left[e^{\int P(x) d x} y\right] &=e^{\int P(x) d x} f(x) \end{aligned}

Finally, we discover why $$\mu(x)$$ is called an integrating factor. We can integrate both sides of the last equation,

$$e^{\int P(x) d x} y=\int e^{\int P(x) d x} f(x)+c$$

and solve for y. The result is a one-parameter family of solutions of the DE:

$$y=e^{-\int P(x) d x} \int e^{\int P(x) d x} f(x) d x+c e^{-\int P(x) d x}$$

I have a few points that I couldn't understand in this method:

1. "The method for solving the differential equation above hinges on a remarkable fact that the left hand side of the equation can be recast into the form of the exact derivative of a product by multiplying both sides of the equation by a special function $$\mu(x)$$". Where did this fact come from and why?
2. Was this method done by construction? It wasn't clear to me how could this method be discovered for the first time, like is it intuitive? What should you have in mind in order to do the construction done in this proof? i.e. what was the motivation to multiply the DE by $$\mu(x)$$ ?

In summary, I did not understand the first few steps of this proof and why we chose to do it that way.

In practice, while solving linear DE using this method we tend to multiply the whole equation by $$\mu(x)$$ and then set the left hand side of the DE equal to $$\frac{d}{d x}[\mu(x) y]$$, and then find the solution. So I want to know why we do that procedure in the first place.

P.S: It would be nice if you can give me a little bit of history about who developed this method and when did he do it.

• This might be what you're after. – mattos Sep 29 '19 at 0:28
• Keep in mind that for the past 300+ years there have been many talented mathematicians working on problems in calculus and differential equations. People had time to try all kinds of crazy things just to see what would happen. The “motivation” might be, “Look what happened when I did this, how cool is that?” But in this case it’s likely that the general rule came from someone observing a pattern in several more specific equations that they or others had already solved. – David K Sep 29 '19 at 13:31

First notice that the LHS of the equation looks almost like the derivative of a product of two functions from calculus. Why? Because we have two summands, one of which includes a function $$y,$$ the other including the derivative $$y'$$ of $$y.$$ It only remains to see if we can indeed write this as the derivative of a product of two functions. The other function we do not know.

Now if we proceed directly to assume we have such a function $$\nu$$ so that LHS may be written as $$(y\nu)',$$ then by expanding to get $$y'\nu+y\nu'$$ and comparing with LHS of the original equation, we see that we must necessarily choose $$\nu=1$$ and $$\nu'=P,$$ which is not generally consistent.

However, we may go about this by multiplying the equation by an unknown function $$\mu$$ instead, so that now the coefficient of $$y'$$ is $$\mu,$$ which is more general than $$1,$$ and see if we can find a $$\mu$$ satisfying our conditions.

Proceeding as before, we assume we already have what we want, so that $$\mu×\text{LHS}$$ is now in the form $$(y\mu)',$$ for an as-yet-undetermined $$\mu.$$ This is called the method of analysis in problem-solving -- starting from the goal and working backwards.

Now we expand this to give $$y'\mu+y\mu'.$$ We want this to be equal to the LHS of original equation. Thus we must choose $$\mu'=P\mu,$$ and moreover this is sufficient since all other corresponding terms in both equations are already equal, by construction. This new differential equation for $$\mu$$ is what we've reduced the first problem to, and this may be easily integrated since it is homogeneous and of first order.

I did not understand the first few steps of this proof and why we chose to do it that way.

I believe that it is helpful to see this method as a generalization of a very simple reasoning, as explained below.

Problem 1: Solve $$\frac{d y}{d x}=0$$.

Solution: From the Mean Value Theorem we known that "zero derivative implies constant function". Therefore, \begin{align*} &\frac{d y}{d x}=0\\ &y=c \quad(\text{constant}) \end{align*}

Problem 2: Solve $$\frac{d y}{d x}+1=0$$.

Solution: Clearly, the left-hand side is the derivative of $$y+x$$ (this is the smart trick). Therefore, we can reduce this problem to the previous one: \begin{align*} &\frac{d y}{d x}+1=0\\ &\frac{d}{d x}(y+x)=0\\ &y+x=c \quad(\text{by Problem 1})\\ &y=-x+c \end{align*}

This strategy seems promising. In fact, it works with $$1$$ replaced by any function $$f(x)$$ whose antiderivative $$F(x)$$ is known. For example: \begin{align*} &\frac{d y}{d x}+x^2+e^x=0\\ &\frac{d}{d x}(y+\tfrac{x^3}{3}+e^x)=0\\ &y+\tfrac{x^3}{3}+e^x=c\\ &y=-\tfrac{x^3}{3}-e^x+c \end{align*} Let us try something more complicated.

Problem 3: Solve $$x\frac{d y}{d x}+y=0$$.

Solution: Inspired by the above solutions, we would like to write the left-hand side as a derivative. In this case, it is not obvious how to do that. We want to write a sum as a derivative. Do we have a tool that relates a derivative with a sum? Yes, the product rule: $$\frac{d}{dx}(\mu(x)\cdot y(x))=\mu(x)\cdot \frac{d}{dx}(y(x))+\frac{d}{dx}(\mu(x))\cdot y(x)\tag{*}$$

If we think a little, we realize that we can write the left-hand side of our equation as the right-hand side of $$(*)$$ by taking $$\mu(x)=x$$. Therefore, the previous method can be applied: \begin{align*} &x\frac{d y}{d x}+y=0\\ &x\cdot \frac{d y}{d x}+1\cdot y=0\\ &x\cdot \frac{d y}{d x}+\frac{d}{dx}(x)\cdot y=0\\ &\frac{d}{d x}(xy)=0\quad(\text{by the product rule})\\ &xy=c\\ &y=\frac{c}{x} \end{align*}

As a generalization of this idea, given an equation of the form $$\frac{dy}{dx}+P(x)y=f(x),$$ we want to find $$\mu(x)$$ such that the left-hand side takes the form $$\frac{d}{dx}(\mu(x)y)$$. Does there exist such $$\mu(x)$$? Yes: it is called integrating factor and given by $$\mu(x)=e^{\int P(x) dx}$$.