I'm watching various videos on differential equations and they all say that linear differential equations are on the form:

$y' + P(x)y = Q(x)$ where $P(x)$ is the integrating factor and equals $e^{\int P(x) dx}$

...But nobody bothers to explain why or what this integrating factor is.

What happens for example when $P(x)$ is a constant?

Maybe someone here could explain what is going on, really.


  • $\begingroup$ Maybe the video was garbled. A first-order linear differential equation is of the form $y^\prime + P(x)y = Q(x)$, but the $P(x)$ here is not an integrating factor---it's just the given coefficient of $y$ in the equation. The integrating factor is $e^{\int{P(x)\,dx}}$, but that is not equal to $P(x)$. $\endgroup$ Mar 23, 2014 at 23:31
  • 1
    $\begingroup$ "Integrating factor" is from Dr. Calgari's cabinet of misconceptions. Whenever you hear it mentioned, run away. $\endgroup$ Mar 24, 2014 at 16:22

3 Answers 3


All linear first order differential equations are of that form. Let's do a simpler example to illustrate what happens. Suppose we want to solve

$$y' + xy = 0.$$

Naturally, you would isolate $x$ and $y$ to get

$$\frac{y'}{y} = -x.$$

However we can recognize that $\dfrac{y'}{y}$ is nothing more than $\dfrac{d}{dx}\log|y(x)|$. (Check this via chain rule.) Then want we really want to solve is

$$\frac{d}{dx}\log|y(x)| = -x.$$

Since we know how to integrate, let's integrate both sides to get

$$\log|y(x)| = -\frac{x^2}{2}+C.$$

Exponentiating gives

$$|y(x)| = e^Ce^{-\frac{x^2}{2}}.$$

But since $e^{-\frac{x^2}{2}}$ is always positive, the $y$ must always be positive or negative so we can drop the absolute value (and incorporate it into the constant) so that our solution is actually $y(x) = C\exp\left(-\frac{x^2}{2}\right)$ (where we have rewritten $\text{sgn}(y)e^C$ as simply $C$ since we only care about the overall constant). That took quite a bit of work to do but let's see what happens when we plug our solution back into the equation. Firstly, $y'(x) = -Cx\exp\left(-\frac{x^2}{2}\right)$ (again, verify this). Substituting, we get

$$y'+xy \Longrightarrow -Cxe^{-\frac{x^2}{2}} + Cxe^{-\frac{x^2}{2}} = 0.$$

We found the solution! Our solution then looks like $Ce^{-\int x dx}$ which seems to mimic the $e^{\int P(x)dx}$ term you have written to a degree (but the sign is backwards). Let's investigate further to see what the actual situation is.

Notice I could have replaced $x$ with any function, call it $P(x)$ and we could have done the same thing. The only change would have been $\dfrac{d}{dx}\log|y(x)| = -P(x)$. If you solve this, you would get that

$$y(x) = Ce^{-\int P(x)dx}.\tag{1}$$

Before moving to the most general setting, let's try this integrating factor trick to see what happens. Let's haphazardly multiply our differential equation by $e^{\int P(x)dx}$ and see what happens. Well we would get

$$e^{\int P(x)dx}y' + P(x)e^{\int P(x) dx}y = 0.\tag{2}$$

However this form is very compelling. We can see that the following is true:

$$\left(e^{\int P(x) dx}y\right)' = e^{\int P(x)dx}y' + P(x)e^{\int P(x) dx}y = 0.$$

This says that $(2)$ is equivalent to the expression

$$\left(e^{\int P(x) dx}y\right)' = 0.$$

But we know how to find the solution now! Since the derivative of the term in parentheses is $0$, it has to be constant, which tells us that $e^{\int P(x)dx}y = C$, or $y(x) = Ce^{-\int P(x)dx}$. This corresponds exactly with what we got before.

With this in mind, let's look at the general equation you have: $y' + P(x)y = Q(x)$. Let's take cues from the case we just looked at and let's multiply everything by $e^{\int P(x)dx}$ (note the similarity to equation $(1)$..) and see what happens. We get

$$e^{\int P(x)dx} y' + P(x)e^{\int P(x)dx}y = e^{\int P(x)dx}Q(x).$$

You can see that this looks eerily similar to what we had before (and this is not by accident). From what we did before, we can rewrite the entire left side as simply

$$\left(e^{\int P(x)dx}y\right)' = e^{\int P(x)dx}Q(x).$$

This is almost a solution! All you then have to do is integrate both sides and then divide by $e^{\int P(x)dx}$ to get $y$ as a function of $x$.

(Note that the full, general solution also includes the solution $y =C e^{-\int P(x)dx}$.)

Here's an example:

$$y' + xy = x.$$

Doing our integrating factor trick, we would multiply both sides by $e^{\int x dx} = e^{\frac{x^2}{2}}$. Doing so, we get

$$\left(e^{\frac{x^2}{2}}y\right)' = xe^{\frac{x^2}{2}}.$$

If we integrate both sides, we get

$$e^{\frac{x^2}{2}}y = \int xe^{\frac{x^2}{2}}dx \stackrel{\text{chain rule}}{=} C + e^{\frac{x^2}{2}}.$$

Dividing both sides by $e^{\frac{x^2}{2}}$, we get that $y = Ce^{-\frac{x^2}{2}}+1$ which you can check by plugging back into the initial differential equation to verify. The piece $Ce^{-\frac{x^2}{2}}$ we can recognize as the solution to the "homogeneous" case (when $Q = 0$) that we did up above. So this technique, when done correctly, gives you the full solution all the time.

  • 1
    $\begingroup$ Nice answer. But why introduce the absolute value first, only to drop it (without an explanation why we can)? The formula remains right if you start by saying that $y'/y = \mathrm{d}/\mathrm{d}x \log(y(x))$. $\endgroup$ Mar 24, 2014 at 8:39
  • $\begingroup$ Thanks for the feedback. I felt I should have elaborated more but wanted to skip over it to focus on other things. For sake of completeness though, I fixed it. $\endgroup$ Mar 24, 2014 at 16:10
  • $\begingroup$ Just starting with $\log y$ would also work in the complex plane. :-) $\endgroup$ Mar 24, 2014 at 22:15

You might try looking at http://www.math.ubc.ca/~israel/m215/lineq/lineq.html ... Sorry, it's not a video.

  • $\begingroup$ To add a bit of context, these notes by Dr. Israel describe the integrating factor as the first technique used in differential equations, one especially for a first-order linear ODE. Worked examples are given with special attention to the case where $P(x)$ is simply a constant. The satisfaction of initial conditions is also shown. $\endgroup$
    – hardmath
    Mar 24, 2014 at 0:45
  • 1
    $\begingroup$ Link-only answers are not really a good fit for SE, could you summarize the most relevant points here, as far as they are not well covered by other answers yet? $\endgroup$ Mar 24, 2014 at 8:41

You have $$y^{'}+P(x)y=Q(x)$$ Multiply this whole thing by a function $I(x)$, to get $$I(x)y^{'}+I(y)P(x)y=IQ(x)$$ Now, we will write $$I(x)P(x)=\dfrac{dI}{dx}\\ \implies I(x)=\exp\left(\int P(x)dx\right)$$ This is the integrating factor: you have $$I(x)y^{'}+\dfrac{dI}{dx}y=\dfrac{d(I(x)y)}{dx}=IQ(x)$$ Which you can now solve.

So, what if $P(x)=P$ is a constant? Then you have $$I(x)P=\dfrac{dI}{dx}\\ \implies I(x)=\exp\left(\int Pdx\right)=C\exp\left(Px\right),\text{ where $C$ is a constant.}$$ Substitution gives $$I(x)y^{'}+\dfrac{dI}{dx}y=\dfrac{d(\exp\left(Px\right)y)}{dx}=\exp\left(Px\right)Q(x)$$ Which you can now solve.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .