Solve the differential equation

x^2dy+ (x-3xy + 1)=0

To solve the differential equation x^2dy + (x - 3xy + 1) = 0, we can apply the method of solving exact differential equations.

An exact differential equation is of the form M(x, y) + N(x, y)dy/dx = 0. It can be written as dF = 0, where F(x, y) is a function of x and y. An exact differential equation satisfies the condition dM/dy = dN/dx.

In this case, we have:
M(x, y) = x - 3xy + 1
N(x, y) = x^2

Let's check if the condition dM/dy = dN/dx is satisfied:

dM/dy = -3x + 1
dN/dx = 2x

Since dM/dy is not equal to dN/dx, the equation is not exact. However, we can make it exact by multiplying through by an integrating factor.

The integrating factor (IF) is given by IF = e^(∫(dN/dx - dM/dy) dx). In this case, we have IF = e^(∫(2x + 3x - 1) dx) = e^(∫(5x - 1) dx) = e^(5x^2/2 - x).

Now, we multiply the entire equation by the integrating factor:
x^2e^(5x^2/2 - x) dy + (x - 3xy + 1)e^(5x^2/2 - x) = 0

The left-hand side can be simplified by noticing that it is the result of applying a chain rule to a function F(x, y) = F(x, y(x)) = C.

Let's differentiate F(x, y) = C with respect to x and set it equal to the left-hand side of the equation:
dF/dx = ∂F/∂x + ∂F/∂y * dy/dx = 0

Now, we can equate the corresponding terms:
∂F/∂x = x - 3xy + 1
∂F/∂y = x^2

Solving these equations will give us the function F(x, y). Let's integrate ∂F/∂x with respect to x:
F(x, y) = ∫(x - 3xy + 1) dx = (1/2)x^2 - (3/2)x^2y + x + g(y)

Here, g(y) is the function of y only, obtained by integrating ∂F/∂y with respect to y.

Now, comparing the obtained F(x, y) with the original function F(x, y) = C, we can find the constant of integration:
(1/2)x^2 - (3/2)x^2y + x + g(y) = C

Finally, we have the general solution of the given differential equation:
(1/2)x^2 - (3/2)x^2y + x + g(y) = C

This is the solution to the differential equation x^2dy + (x - 3xy + 1) = 0.