Differential Equation Exercise
We want to solve the differential equation
$$ y' = - \frac{1+y}{x^2} $$
This is a first-order differential equation, and it can be handled using the method of separation of variables.
We begin by separating the variables $y$ and $x$:
$$ \frac{1}{1+y}\, y' = - \frac{1}{x^2} $$
Writing $y'$ as dy/dx and rearranging gives
$$ \frac{1}{1+y}\, \frac{dy}{dx} = - \frac{1}{x^2} $$
$$ \frac{1}{1+y}\, dy = - \frac{1}{x^2}\, dx $$
We now integrate both sides with respect to their variables:
$$ \int \frac{1}{1+y}\, dy = \int -\frac{1}{x^2}\, dx $$
$$ \int \frac{1}{1+y}\, dy = - \int x^{-2}\, dx $$
Since $\int x^{-2}\, dx = \frac{x^{-1}}{-1} = -\frac{1}{x}$, we obtain
$$ \int \frac{1}{1+y}\, dy = \frac{1}{x} + c_1 $$
On the left-hand side, the antiderivative is the natural logarithm:
$$ \log |1+y| = \frac{1}{x} + c_1 $$
Exponentiating both sides yields
$$ 1+y = e^{\frac{1}{x}} \cdot e^{c_1} $$
$$ y = c\, e^{\frac{1}{x}} - 1 $$
where $c = e^{c_1}$ is an arbitrary constant. This is the general solution.
Checking for constant solutions
Returning to the original equation,
$$ y' = - \frac{1+y}{x^2}, $$
if $y = -1$ we obtain
$$ y' = -\frac{1+(-1)}{x^2} = 0. $$
Thus $y = -1$ is a valid constant solution, since the derivative vanishes for all $x \neq 0$.
$$ \forall\, x \in \mathbb{R}\setminus \{0\}, \quad y=-1 \implies y'=0 $$
Conclusion
The complete solution set therefore consists of:
- the general solution for $y \neq -1$: $$ y = c\, e^{\tfrac{1}{x}} - 1 $$
- the constant solution $y = -1$.
