Differential Equation Exercise 3
In this exercise, we’re asked to solve a first-order differential equation:
$$ xy' - y = 0 $$
We begin by solving for y' in terms of x and y:
$$ y' = \frac{y}{x} $$
This is a separable differential equation of the form y' = f(x)g(y), with f(x) = 1/x and g(y) = y.
Rewriting the derivative in Leibniz notation:
$$ \frac{dy}{dx} = \frac{y}{x} $$
We now separate the variables y and x:
Bring all terms involving y to the left-hand side and those involving x to the right-hand side:
$$ \frac{dy}{y} = \frac{dx}{x} $$
Next, integrate both sides with respect to their respective variables:
$$ \int \frac{dy}{y} = \int \frac{dx}{x} $$
$$ \int \frac{1}{y} \, dy = \int \frac{1}{x} \, dx $$
The integral on the left yields the antiderivative \(\log(y) + c_1\):
$$ \log(y) + c_1 = \int \frac{1}{x} \, dx $$
Similarly, the right-hand side integrates to \(\log(x) + c_2\):
$$ \log(y) + c_1 = \log(x) + c_2 $$
Combining the two constants into a single one, we write c3 = c2 - c1, which can be any real number:
$$ \log(y) = \log(x) + c_3 $$
Bringing all logarithmic terms to one side:
$$ \log(y) - \log(x) = c_3 $$
Applying the identity \(\log(y) - \log(x) = \log(y/x)\):
$$ \log\left(\frac{y}{x}\right) = c_3 $$
Exponentiating both sides to eliminate the logarithm:
$$ e^{\log\left(\frac{y}{x}\right)} = e^{c_3} $$
$$ \frac{y}{x} = e^{c_3} $$
Since \( e^{c_3} \) is a positive constant, we denote it simply as c:
$$ \frac{y}{x} = c $$
Solving for y gives the general solution of the differential equation:
$$ y = cx $$
Alternative Solution Method
This equation can also be solved using a different method.
$$ xy' - y = 0 $$
Divide both sides by x to simplify:
$$ \frac{xy' - y}{x} = \frac{0}{x} $$
$$ y' - \frac{y}{x} = 0 $$
This is a first-order linear differential equation of the form y' + a(x)y = b(x), where a(x) = - 1/x and b(x) = 0.
To solve it, we apply the integrating factor method:
$$ y = e^{-\int a(x)\, dx} \cdot \left[ \int b(x) \cdot e^{\int a(x)\, dx} \, dx + c \right] $$
Substituting a(x) = - 1/x and b(x) = 0 gives:
$$ y = e^{-\int -\frac{1}{x} \, dx} \cdot \left[ \int 0 \cdot e^{\int -\frac{1}{x} \, dx} \, dx + c \right] $$
$$ y = e^{\int \frac{1}{x} \, dx} \cdot c $$
The integral of 1/x is \( \log(x) \). Since the constant of integration is already accounted for outside the exponential, we omit it:
$$ y = e^{\log(x)} \cdot c $$
Because \( e^{\log(x)} = x \), we find:
$$ y = x \cdot c $$
This confirms the general solution of the differential equation:
$$ y = cx $$
As expected, both methods lead to the same result.
And so on.
