x dy dx 2y (differential equation solution)

\[\]

\[
\textbf{Q1: Solve the differential equation:} \quad x \frac{dy}{dx} = 2y
\]

\[
\textbf{Step 1: Rearranging the equation}
\]
We start by separating the variables \( x \) and \( y \). We divide both sides by \( y \) and \( x \):
\[
\frac{1}{y} \, dy = \frac{2}{x} \, dx
\]

\[
\textbf{Step 2: Integration of both sides}
\]
Now, we integrate both sides of the equation. On the left side, we integrate with respect to \( y \), and on the right side, we integrate with respect to \( x \):
\[
\int \frac{1}{y} \, dy = \int \frac{2}{x} \, dx
\]

The integrals are straightforward:
\[
\ln |y| = 2 \ln |x| + C
\]
where \( C \) is the constant of integration.

\[
\textbf{Step 3: Solve for \( y \)}
\]
Next, we solve for \( y \). To do this, we exponentiate both sides of the equation to eliminate the logarithms:
\[
e^{\ln |y|} = e^{2 \ln |x| + C}
\]

Using the properties of exponents, we can simplify:
\[
|y| = e^{C} \cdot |x|^2
\]

Let \( e^C = C_1 \) (where \( C_1 \) is a new constant), so the equation becomes:
\[
|y| = C_1 x^2
\]

\[
\textbf{Step 4: Final solution}
\]
Since \( |y| \) can be both positive and negative, we drop the absolute value and write the final general solution as:
\[
y = C_1 x^2
\]
where \( C_1 \) is the constant of integration.

This is the general solution to the differential equation \( x \frac{dy}{dx} = 2y \).