Method of finding solution of $y’=y+e^x$

ordinary differential equations

(Edited after serious comments from Chongxu Ren, Ulrich, Gerry Myerson etc; thanks to them for bringing my attention to put the question in precise form)

I am trying to find the solution of differential equation $y'=y+e^x$ for $x\in\mathbb{R}$.

This can be solved by using method of integrating factor; but without referring to it, I went for looking solution step-by-step with complexity, as follows.

Simple Case: If it would have been $y'=e^x$, i.e. $Dy=e^x$, we could have taken integration of both sides to get $y=ae^x+b$.

(The method of integrating factor brings above equation to form $D(e^{-x}y)=1$)

General Case: The right side is not only the function of $x$, but some terms of the (unknown) function $y$ also; an easy example is the equation in title.

We then move to collect terms of $y$ on one side, and keep function of $x$ other side. We can write main equation as
$$(D-\mathbf{1})y=e^x,$$
and we want to invert $D-\mathbf{1}$ to get information of unknown $y$. [In case $Dy=f(x)$, we expect to get $y=\int f(x)$, provided, $f(x)$ satisfies some conditions on given domain of it.]

For $(D-\mathbf{1})y=e^x$, I went to do like: $y=\frac{1}{D-\mathbf{1}}e^x= (\mathbf{1}+D+D^2+\cdots )(-e^x)$. But, this last expression on RHS does not make sense since $D^n(-e^x)=-e^x$ for all integers $n\ge 0$.

Question: When does such method of inverting $D-\mathbf{1}$ or a polynomial expression of $D$ actually works to give solution of given differential equation – say $(D^r + a_1D^{r-1} + \cdots + a_r\mathbf{1})y=f(x)$?

Best Answer

Here is way to make the integrating factor method work in this specific case. Multiplying by $e^{-x}$, the equation is equivalent to $$y'e^{-x}-ye^{-x}=1 \quad \quad \quad \quad \text{ i.e. to } \quad \quad \quad \quad(ye^{-x})'=1$$

So you get $$ye^{-x}=x+C\quad \quad \quad \quad \text{ i.e. } \quad \quad \quad y=(x+C)e^x$$

Related Question