What Is an Exact Differential Equation?
A first-order equation written in differential form, M(x, y) dx + N(x, y) dy = 0, is called exact when the left side is the total differential of some function F(x, y): that is, when there exists a potential F with
∂F/∂x = M and ∂F/∂y = N
If such an F exists, the equation says dF = 0, so the solutions are simply the level curves F(x, y) = C. Instead of integrating a slope field, you recover one scalar function and read off an implicit general solution in a single stroke. The practical test, due to the equality of mixed partial derivatives, is ∂M/∂y = ∂N/∂x. This calculator runs that test symbolically, reconstructs F by partial integration when the test passes, fits the constant C to your chosen point, and draws the resulting solution curve.
How to Use the Exact Differential Equation Calculator
Enter M and N exactly as they appear in M dx + N dy = 0. If your equation arrives as dy/dx = −M/N, clear the fraction first: dy/dx = −(2xy + 3)/(x² − 4y) becomes (2xy + 3) dx + (x² − 4y) dy = 0. Choose the point (x₀, y₀) your solution should pass through. The steps show ∂M/∂y and ∂N/∂x side by side, declare exactness or its failure, then integrate M with respect to x, differentiate to find the leftover g(y), and assemble F. When symbolic integration is out of reach, the potential is computed by a path integral instead (legitimate precisely because exactness makes such integrals path-independent), and the level curve is still drawn.
Worked Example
Take (2xy + 3) dx + (x² − 4y) dy = 0. First the test: ∂M/∂y = 2x and ∂N/∂x = 2x. Equal, so the equation is exact. Integrate M in x holding y fixed:
F = ∫(2xy + 3) dx = x²y + 3x + g(y)
Differentiate in y and match against N: Fy = x² + g′(y) = x² − 4y forces g′(y) = −4y, so g(y) = −2y². The implicit general solution is x²y + 3x − 2y² = C; through (1, 1) the constant is C = 2. Every solution curve of this equation is one contour of the surface z = F(x, y), which is why the graph shows a closed-form curve rather than a single function y(x).
Why the Test ∂M/∂y = ∂N/∂x Works
If F exists with Fx = M and Fy = N, then My = Fxy and Nx = Fyx, and Clairaut's theorem says the mixed partials of a twice continuously differentiable function agree. So equality is necessary. On a rectangle (or any simply connected region) it is also sufficient: F can be built by integrating M along x and correcting with a function of y, exactly the procedure this tool performs. The same mathematics appears in vector calculus as the test for a conservative vector field, where F is the potential function and the differential equation's solution curves are the field's equipotential lines. Thermodynamics uses the identical criterion to distinguish state functions like entropy, whose differentials are exact, from path-dependent quantities like heat and work.
When the Equation Is Not Exact
Failure of the test does not end the story. Multiplying M dx + N dy = 0 by a well-chosen integrating factor μ(x, y) can make it exact, classically with μ depending on x alone when (My − Nx)/N is a function of x only. The rotation-field chip y dx − x dy = 0 shows the situation: My = 1 but Nx = −1, not exact, yet multiplying by 1/y² produces the exact equation d(x/y) = 0. When the test fails, this calculator says so explicitly and draws the direction field so you can still see the solution family you are hunting.
Common Mistakes to Avoid
- Testing the wrong pair of derivatives. The criterion differentiates M by y and N by x, the "crossed" variables. Computing Mx = Ny instead is the single most frequent error and validates the wrong equations.
- Losing the sign when converting from dy/dx form. dy/dx = f(x, y) rearranges to −f dx + dy = 0 or f dx − dy = 0 depending on how you clear it; a dropped minus makes an exact equation look inexact.
- Writing g′(y) with x still in it. After matching Fy to N, every x must cancel. If it does not, either the equation is not exact or an integration slipped; the leftover function must depend on y alone.
- Forgetting that the solution is implicit. F(x, y) = C is the answer; solving for y explicitly is often impossible and never required. Leave the level-curve form unless the problem demands otherwise.
- Assuming exactness survives multiplication. Scaling an exact equation by an arbitrary function usually destroys exactness. Only special integrating factors preserve or create it.
Real-World Applications
Exact equations are the differential-equation face of conservation laws. In mechanics, a force field with a potential energy function makes total energy constant along trajectories: the orbits satisfy an exact equation whose F is the energy. Thermodynamics is built on exact differentials, with Maxwell's relations literally the statement My = Nx applied to thermodynamic potentials. In fluid dynamics, stream functions turn incompressible flow fields into exact differentials whose level curves are streamlines. Continue with the separable equation calculator for the other classical solvable form, or the slope field generator to visualize any first-order equation before solving it.
Frequently Asked Questions
What does "exact" actually mean here?
That M dx + N dy is precisely the differential dF of a single function F(x, y), with no adjustment needed. The equation then asserts dF = 0, so F stays constant along every solution: the solution curves are the contours of F, like elevation lines on a topographic map.
Why do the solutions come out as implicit curves F(x, y) = C?
Because one potential function describes the whole family at once. Each value of C slices the surface z = F(x, y) at a different height, and most slices cannot be rearranged into an explicit y = f(x); a circle x² + y² = C is already two functions.
Is the test ∂M/∂y = ∂N/∂x always conclusive?
On simply connected regions, yes: equality guarantees a potential exists and inequality rules it out. On regions with holes, equality can hold while no single-valued F exists, the famous example being the angular field around the origin. Textbook problems almost always live on rectangles, where the test is airtight.
How does the calculator recover F from M and N?
It integrates M with respect to x, treating y as a constant, obtaining F up to an unknown g(y). Differentiating that result in y and comparing with N isolates g′(y), which integrates to finish F. The two integrations are displayed as separate steps, mirroring hand computation.
What is an integrating factor and when do I need one?
A multiplier μ(x, y) that converts a non-exact equation into an exact one. You need it whenever the cross-partial test fails but the equation should still have potential-like solutions. If (My − Nx)/N depends on x alone, μ(x) = e∫(My − Nx)/N dx works.
How is this connected to conservative vector fields?
Identically the same mathematics with different vocabulary: (M, N) is a vector field, exactness is conservativeness, F is the potential function, and solution curves of the ODE are curves along which the potential is constant, orthogonal trajectories of the field's flow lines.
Can an equation be both exact and separable?
Yes. y dx + x dy = 0 is exact (F = xy) and also separable (dy/y = −dx/x). Solvability classes overlap, and when several apply you should use whichever route is fastest; the answers agree up to algebraic rearrangement of the constant.
What role does the point (x₀, y₀) play?
It selects one contour from the family by fixing C = F(x₀, y₀), the differential-form version of an initial condition. The graph drawn is exactly that member. Changing the point slides you to a parallel level curve without recomputing F.
Why does the tool use a path integral when symbolic integration fails?
For an exact equation, the integral of M dx + N dy from a base point to (x, y) is independent of the path taken, and its value is F(x, y) − F(x₀, y₀). Integrating numerically along a straight segment therefore evaluates the true potential even when no elementary antiderivative exists.
What happens at points where N = 0?
The slope dy/dx = −M/N blows up: the solution curve has a vertical tangent there. Nothing is wrong with the implicit solution F = C, which passes through such points smoothly; only the explicit-function viewpoint breaks. This is another argument for keeping answers in level-curve form.