# Solution conflict!

1. Jan 4, 2006

### gulsen

I have a basic differential equation:
$$\frac{dy}{dx} = x + y, y(0) = 1$$

Now, when I try to solve this by making it exact
$$\mu \frac{dy}{dx} + \mu y = \mu x$$
I get $$\mu = e^{-x}$$ and solution $$-x-1$$. This doesn't satisfy the initial condition. But when I try to solve it as a non-homogenous equation as:
$$\frac{dy}{dx} + y= x$$
I get
$$y_p = 2e^x, y_c = -x-1$$
so
$$y = 2e^x-x-1$$

Which seems to be a correct & full solution. What was I missing in the first try?

2. Jan 4, 2006

### Eratosthenes

You are solving dy/dx + y = x which is wrong since the original equation is
dy/dx = x + y, or dy/dx - y = x so now u(x) = e^(-x) and so on and it works out.

And yes, the answer is y = 2e^x - x - 1

3. Jan 4, 2006

### D H

Staff Emeritus
I assume this was just a typo, but that equation should be
$$\mu \frac{dy}{dx} - \mu y = \mu x$$
Your error: you forgot the constant of integration. You should have obtained
$$y = -(x+1) + c/\mu = ce^x - (1+x)$$
and then solved for the initial condition $y(0)=1$ yielding $c=2$ or
$$y = 2e^x -(x+1)$$
You're nomenclature is backward here. The solution to the homogeneous equation is called the complementary function and is denoted as $y_c$. The complementary function generally involves arbitrary constants. A solution to the inhomogeneous equation is called a particular function and is denoted as $y_p$.
In this case, the solution to the homogeneous equation $y^\prime-y=0$ is
$$y_c = ce^x$$
where $c$ is an arbitrary constant and
$$y_p = -(x+1)$$
is a particular solution to the inhomogeneous equation. Combining these,
$$y = ce^x - (1+x)$$
which meets the initial conditions when $c=2$.

Last edited: Jan 4, 2006
4. Jan 19, 2006

### gulsen

Oh, that was just a typo. Thanks D_H, it ends up that I've forgotten the integration constant.
About naming, take it easy, I'm just a freshman!