Pleas help solve the ffg. differential equation: dy/dx-(1+1/x)y=y^2

Solve the differential equation dy/dx+ytanx=y^2secx

To solve the given first-order differential equation, dy/dx - (1 + 1/x)y = y^2, we can use the method of "separable variables". Here's how you can do it step by step:

Step 1: Rearrange the equation
Move all the terms involving y to one side of the equation:
dy/dx = (1 + 1/x)y - y^2

Step 2: Separate the variables
Split the equation into two separate parts, with the y terms on one side and the x terms on the other side:
1/[(1 + 1/x)y - y^2] dy = dx

Step 3: Integrate both sides
Now integrate both sides of the equation with respect to their respective variables.

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

Step 4: Evaluate the integrals
Compute the integrals on both sides of the equation. However, in this case, integrating the left side is a bit tricky.

Let's simplify the expression before integrating.
1/[(1 + 1/x)y - y^2] = 1/[(1/x)y + y - y^2]

Now, we can use partial fraction decomposition to make the integral easier to solve.
Assuming y ≠ 0, we can write:
1/[(1/x)y + y - y^2] = A/(y(1 - y)) + B/(y^2)

With a common denominator, we get:
1 = A(y) + B(1 - y)

Now, we can solve for A and B by comparing the coefficients of y and the constant term.
Comparing the coefficients of y:
0 = -A + B
=> A = B

Comparing the constant terms:
1 = B
Thus, A = B = 1.

Now, we can rewrite the left side of the equation:

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

Now, the integral becomes:
∫[1/y + 1/(1 - y)] dy = ∫dx

The left side can be integrated as:
ln|y| - ln|1 - y| = x + C

Step 5: Solve for y (if possible)
Now, we can try to solve the equation for y by getting rid of the natural logarithms on the left side.

Using logarithmic properties:
ln|y| - ln|1 - y| = ln|y/(1 - y)| = x + C

Exponentiating both sides:
|y/(1 - y)| = e^(x+C) = e^(x) * e^(C)

Since e^C is a constant, let's represent it as K (a positive constant):
|y/(1 - y)| = Ke^x

Now we can split the equation into two cases:

Case 1: y/(1 - y) = Ke^x (where y ≠ 1)
In this case, we can isolate y by cross-multiplying:

y = Ke^x - Ky^e^x
y(1 + Ke^x) = Ke^x
y = Ke^x / (1 + Ke^x)

Case 2: y/(1 - y) = -Ke^x (where y ≠ 0)
In this case, we can isolate y by cross-multiplying:

-y = Ke^x + Ky^e^x
y(1 + Ke^x) = -Ke^x
y = -Ke^x / (1 + Ke^x)

These are the solutions of the given differential equation. Note that we have two solutions because we have considered different cases for y.

Remember, when solving differential equations, it is always a good practice to check the obtained solutions by substituting them back into the original equation to verify their validity.