## anonymous 5 years ago how to solve dy/dx=x+y,y(0)=1

Noting that this is a linear ordinary differential equation, we can rewrite it in the form $\frac{dy}{dx} + p(x) \cdot y = g(x)$ where $p(x) = -1, g(x) = x$Finding the integration factor u(x) is trivial, as $u(x) = e^{\int p(x) dx} = e^{-x}$ Multiplying both sides by the integration factor, we arrive at $e^{-x} \frac{dy}{dx} + e^{-x} \cdot -y = e^{-x} \cdot x$ The left side may be rewritten as $(e^{-x} \cdot y)' = e^{-x} \cdot x$ and integrating both sides, we find that $\int (e^{-x} \cdot y)' dx = \int e^{-x} x dx$ which is $e^{-x} \cdot y + c_1 = -e^{-x} (x+ 1) + c_2$ for some c_1, c_2. Letting $c = c_2 - c_1$ we may rewrite the differential equation as $e^{-x} y = -e^{-x} (x + 1) + c$ Solving for y, we arrive at $y = \frac{-e^{-x} (x+ 1) + c}{e^{-x}} = c e^{x} - x - 1$ which is our general solution. Solving for c we find that $y(0) = c \cdot e^{0} - 0 - 1 = c - 1 = 1$ thus c equals 2.