Please help me solve this differential equation: dy/dx-(1+1/x)y=y^2

This is just a special case of the Bernoulli Equation

y' + p(x) y = q(x) y^n

where q(x) = 1

Make the substitution v = y^(1-n)
This will give you

-v' + (1+1/x)v = 1

Now you can multiply by an integrating factor

e^[∫(1+1/x) dx] = xe^x to get

xe^x v = -e^x (x-1)

and you're almost done

Hi..

I'm not sure how to get the final answer

To solve the given differential equation, we can use the method of separation of variables. Here are the steps to solve it:

Step 1: Rewrite the equation in a more convenient form. Divide both sides of the equation by (1 + 1/x):

(dy/dx - (1 + 1/x)y) / (1 + 1/x) = y^2 / (1 + 1/x)

Step 2: Simplify the expression. For the left side, multiply the numerator and denominator by x:

(xdy/dx - (1 + x)y) / (x + 1) = y^2 / (1 + 1/x)

Simplifying further, we get:

xdy/dx - (1 + x)y = y^2 / (1 + 1/x)

Step 3: Rearrange the terms to isolate dy/dx:

xdy/dx - y - xy = y^2 / (1 + 1/x)

Rearranging further, we get:

xdy/dx - xy - y = y^2 / (1 + 1/x)

Step 4: Separate the variables by moving all the terms involving y to one side and the terms involving x and dx to the other side:

xdy / (y^2 + y) - dx / x = dy / (1 + 1/x)

Step 5: Integrate both sides of the equation. For the left side, use the partial fraction decomposition to simplify the integral:

∫[y^2 + y]^-1 dy - ∫ x^-1 dx = ∫ (1 + x)^-1 dy

Taking the integrals, we get:

ln|y^2 + y| - ln|x| = ln|1 + x| + C

ln|y^2 + y|/|x| = ln|1 + x| + C

Step 6: Eliminate the absolute value signs by considering different cases:

Case 1: If x > 0 and y^2 + y > 0, we have:

y^2 + y = C(x)(1 + x)

Case 2: If x < 0 and y^2 + y > 0, we have:

y^2 + y = C(-x)(1 + x)

Case 3: If x ≠ 0, y^2 + y < 0, we have:

y^2 + y = -C(x)(1 + x)

Step 7: Solve for y in each case:

By using the quadratic equation, we can solve the above equations to find expressions for y in terms of x.

For example, in Case 1, we have:

y = (-1 ± √(1 + 4C(x)(1 + x))) / 2

Repeat this process for the other cases to find the solutions.

Note: The constant C can be determined from initial conditions or additional information provided in the problem.