[Math] general solution of $x\frac{dy}{dx}-4y=x^6e^x$

ordinary differential equationsproof-verification

I have a question about the following example in Zill and Wright's textbook:

Example $\quad$ Solve $x\frac{dy}{dx}-4y=x^6e^x.$

This is a simple example to illustrate how to find general solution of a linear first-order differential equation (DE):

Solution $\quad$ By dividing by $x$ we get the standard form
$$\frac{dy}{dx}-\frac{4}{x}y=x^5e^x.$$
Let $P(x)\triangleq-4/x$ and $f(x)\triangleq x^5e^x$. Note that $P$ and $f$ are continuous on $(0, \infty)$, so the general solution on $(0, \infty)$ is $y=y_c+y_p,$ where $y_c=ce^{-\int P(x)dx}$ is the general solution to the homogeneneous DE, and $$y_p=e^{-\int P(x)dx}\int e^{\int P(x)dx}f(x)dx$$
is a particular solution to the non-homogeneous DE.

Now, note that $e^{-\int P(x)dx}=e^{\int 4/xdx}=x^{4}$ on $(0, \infty)$. So $y_c=cx^4$ and a particular solution is $y_p=x^{4}\int xe^xdx=x^4(x-1)e^x.$ Hence the general solution is $y=cx^4+x^4(x-1)e^x$ on $(0, \infty)$.


My question: Isn't $y=cx^4+x^4(x-1)e^x$ the general solution on the entire real line as well?

We're restricted to $(0, \infty)$ to make $P$ continuous. The above argument also holds on $(-\infty, 0)$. However, $P$ isn't in the original problem. It's an intermediate term we invented to solve the DE, and as a result we exclude $\{0\}$ from the real line.

Looking at the original DE, any solution $y$ must be $0$ when $x=0.$ And $y=cx^4+x^4(x-1)e^x$ clearly satisfies this. So is there any problem to say that it is the general solution of the original DE on the entire real line? Did I miss something? Thanks a lot!

Best Answer

Because of the singular point at 0, the solution on each side doesn't necessarily have to "match up". That means $c$ can take on different values for positive and negative numbers, and the general solution is $$ y = \begin{cases}c_1 x^4 + x^4(x-1)e^x & x < 0 \\ c_2x^4 + x^4(x-1)e^x & x\ge 0\end{cases} $$ or equivalently $$ y = b_1 x^4 + b_2 x^3|x| + x^4(x-1)e^x $$ for some constants $b_1$ and $b_2$.