import sympy x = sympy.symbols('x') y = sympy.symbols('y', cls=sympy.Function) # Define the differential equation: dy/dx = 6*x^2*y^2 diffeq = sympy.Equality(y(x).diff(x), 6 * x**2 * y(x)**2) # Solve the differential equation solution = sympy.dsolve(diffeq, y(x)) print(solution) Use code with caution. Copied to clipboard
[ \int y^{-2} , dy = -y^{-1} + C_1 = -\frac{1}{y} + C_1 ] solve the differential equation. dy dx = 6x2y2
Starting with: $$ -\frac{1}{y} = 2x^3 + C $$ import sympy x = sympy