Implicit Differential Equations

Implicit differential equations (IDEs) are a fascinating, if slightly rebellious, branch of calculus. While most standard differential equations are “explicit”—meaning you can neatly isolate the derivative on one side—IDEs keep things tangled.

Think of it like the difference between a recipe that says “Add 2 cups of flour”(explicit) and one that says “The amount of flour plus the amount of sugar must equal 5 cups” (implicit). You know the relationship, but you have to do some work to find the specific values.

What Makes an Equation Implicit?

In a standard explicit first-order ODE, we write:

\[\frac{dy}{dx} = f(x, y)\]

In an implicit differential equation, the derivative is embedded within a function where it cannot be (or simply isn’t) isolated:

\[F(x, y, \frac{dy}{dx}) = 0\]

Why Use Them?

  • Physics & Constraints: Many physical systems are governed by constraints (like a bead sliding on a wire) where the relationship between position and velocity is fixed by the geometry, not a direct formula.

  • Singularities: IDEs can describe behaviors where the derivative might become undefined or “multi-valued”(where one point has multiple possible slopes).

  • Differential-Algebraic Equations(DAEs): These are a subset of IDEs often used in electrical circuit simulation and multi-body dynamics.

Solving Strategies

Because you can’t always “solve for \(y'\),” the approach changes:

1. Implicit Differentiation: If you have an equation like, \(x^2 + y^2 = 1\), you differentiate every term with respect to, treating as a function of: \(2x + 2y \cfrac{dy}{dx} = 0\) Then, you isolate \(\cfrac{dy}{dx}\) if possible.

  1. Direction Fields: You can still visualize these equations! For any point, you solve the algebraic equation \(F(x,y,y') = 0\) for \(y'\). If there are multiple solutions for \(y'\), the slope field might have overlapping segments.

  2. Numerical Solvers: For complex IDEs or DAEs, standard solvers like Runge-Kutta might struggle.Specialized algorithms(like the Backward Differentiation Formula, or Diagonally implicit rungekutta) are used to handle the “stiffness” of these equations.

A Classic Example: Clairaut’s Equation

One of the most famous IDEs is Clairaut’s Equation: \(y = x \cfrac{dy}{dx} + f\left(\cfrac{dy}{dx}\right)\). This equation is unique because it often yields two types of solutions: a family of straight lines(the general solution) and a “singular solution” that acts as an envelope to those lines.

Numerical Solution

SepalSolver’s Ode45i can handle implicit equations, but you need to provide the function in the form \(F(x, y, y') = 0\). Here’s a simple example of how to set up and solve an implicit equation using SepalSolver: To solve the clairaut’s equation, we can rearrange it to fit the form \(F(x, y, y') = 0\): ie , \(F(x, y, y') = y - x y' - f(y')\).

Example 1 : Solving Clairaut’s Equation \(y = x y' + \left(y'\right)^2\)

\[F(x, y, y') = y - x y' - \left(y'\right)^2, \quad y(0) = 1\]

First we need to compute the \(y'(0)\) from the initial condition using decic. And then we can use the computed \(y'(0)\) to solve the equation using Ode45i.

// define the implicit function F(x, y, yp) = 0
double F(double x, double y, double yp) => y - x*yp - yp * yp;

// initial conditions y(0) = 1, and guess for y'(0) = 0.1
double y0 = 1, yp0 = 0.1;

// Compute y'(0) using decic
(y0, yp0) = decic(F, 0, y0, 1, yp0, 0);

// Now solve the implicit ODE using Ode45i
var (T, Y, Yp) = Ode45i(F, (y0, yp0), [0, 5]);

// Plot the results
Scatter(T, Y, "fob"); HoldOn();

// Add analytical solution for comparison
Plot(T, T+1, "r"); HoldOff();

// Axis label and legend
Xlabel("x"); Ylabel("y");
Legend(["Numerical Solution", "Analytical Solution"], LowerRight);

// Save the plot
SaveAs("Clairaut.png");
Clairaut.png

Example 2 : Solve Weissinger implicit ODE \(y = x^n f(y') + g(y')\)

While Clairaut’s equation is a textbook classic, Weissinger’s Implicit Differential Equation takes things a step further into the realm of higher-degree implicit equations. It is specifically a first-order equation where the derivative is raised to a power, but it maintains a structure that allows for a clever substitution method. The general form of a Weissinger equation is: \(y = x^n f(y') + g(y')\)

In many contexts, particularly in the study of aerodynamics(where Weissinger’s name is prominent due to his work on lifting-line theory), you might see specialized versions of this.However, in pure mathematics, it is often treated as a generalization of d’Alembert’s equation.

Unlike a standard ODE, the Weissinger equation is nonlinear in the derivative.

  • Relationship to Clairaut: If you set \(n = 1\) and \(f(y') = y'\), you essentially return to the Clairaut form.

  • The Power of x: The \(x^n\) term dictates how the geometry of the solution curves scales as you move away from the origin.

To solve a Weissinger equation, we rarely try to isolate algebraically.Instead, we use a parameter, where: \(p = y' = \cfrac{dy}{dx}\) substituting \(p\) into the equation gives: \(y = x^n f(p) + g(p)\) To find the relationship between \(x\) and \(p\), we differentiate the entire equation with respect to \(x\):

\[\cfrac{dy}{dx} = nx^{n-1} f(p) + x^n f'(p) \cfrac{dp}{dx} + g'(p) \cfrac{dp}{dx}\]

Since \(\cfrac{dy}{dx} = p\) , we get a linear differential equation for in terms of \(p\):

\[p = nx^{n-1} f(p) + \left[x^n f'(p) + g'(p) \right] \cfrac{dp}{dx}\]

This transformation is powerful because it turns a difficult implicit equation into a linear one(usually of the Bernoulli type or similar), which we can solve to get \(x(p)\). Once you have \(x(p)\) and \(y(fp)\), you have a** parametric solution** to the original ODE.

Weissinger’s work is most famous in fluid dynamics, specifically the Weissinger Area Rule and his “L-method” for calculating lift distribution on swept wings. In these engineering contexts, implicit equations arise because the induced downwash(the change in airflow direction) depends on the lift, but the lift itself is a function of that downwash.

  • Aerodynamics: Modeling the circulation around wings with non-rectangular shapes.

  • Classical Mechanics: Describing trajectories where the velocity constraint is non-linear.

  • Singularities: Just like Clairaut equations, Weissinger equations often have “envelope” solutions where the uniqueness of the solution breaks down.

Consider \(F(t, y, y') = ty^2(y')^3 - y^3(y')^2 + t(t^2 + 1)y' - t^2y = 0\)

In this case, fix the initial value \(y(t_0) = \sqrt{\cfrac{3}{2}}\) and let decic compute a consistent initial value for the derivative \(y'(t_0)\), starting from an initial guess of \(y'(t_0) = 0\).

// Define the implicit function F(t, y, yp) = 0
double F(double t, double y, double yp) => t*y*y*yp*yp*yp - y*y*y*yp*yp + t*(t*t + 1)*yp - t*t*y;

// Initial conditions y(t0) = sqrt(3/2), and guess for y'(t0) = 0
double t0 = 1, y0 = Sqrt(3.0/2.0), yp0 = 0;

// Compute y'(t0) using decic
(y0, yp0) = decic(F, t0, y0, 1, yp0, 0);

// Now solve the implicit ODE using Ode45i
var (T, Y, Yp) = Ode45i(F, (y0, yp0), [t0, 5]);

// Plot the results
Scatter(T, Y, "fob"); HoldOn();

// Add analytical solution for comparison
Plot(T, Sqrt(T.Pow(2) + 0.5), "r"); HoldOff();

// Axis label and legend
Xlabel("t"); Ylabel("y");
Legend(["Numerical Solution", "Analytical Solution"], LowerRight);

// Save the plot
SaveAs("Weissinger.png");
Weissinger.png

Example 3 : Robertson differential equation in implicit form

Here we reformulate the robertson ode as a pully implicit system of differential algebraic equations

\[\begin{split}\begin{array}{rcl} y'_1 &=& -0.04y_1 + 10^4 y_2 y_3 \\ y'_2 &=& 0.04y_1 - 10^4 y_2 y_3 -(3 \times 10^7) y_2^2 \\ y'_3 &=& (3 \times 10^7) y_2^2 \end{array}\end{split}\]

We previously solved this system of ODEs to steady state with the initial conditions \(y_1 = 1\), \(y_2 = 0\), and \(y_3 = 0\).

But the equations also satisfy a linear conservation law,

\[y'_1 + y'_2 + y'_3 = 0\]

In terms of the solution and initial conditions, the conservation law is

\[y_1 + y_2 + y_3 = 1.0\]

The problem can be rewritten as a system of DAEs by using the conservation law to determine the state of \(y_3\). This reformulates the problem as the implicit DAE system

\[\begin{split}\begin{array}{rcl} 0 &=& y'_1 + 0.04y_1 - 10^4 y_2y_3 \\ 0 &=& y'_2 - 0.04y_1 + 10^4 y_2y_3 + (3 \times 10^7)y_2^2\\ 0 &=& y_1 + y_2 + y_3 - 1. \end{array}\end{split}\]
//define ODE
double[] robertsonimplicit(double t, double[] y, double[] yp) =>
    [yp[0] + 0.04 * y[0] - 1e4 * y[1]*y[2],
     yp[1] - 0.04 * y[0] + 1e4 * y[1]*y[2] + 3e7*y[1]*y[1],
     y[0] + y[1] + y[2] - 1];

// Set intial conditions for y0 and guess values for yp0
double[] y0 = [1, 0, 0], yp0 = [0, 0, 0];

// Solve for yp0, Truth array for y0 = [1,1,1] but for yp0 it is [0,0,0].
(y0, yp0) = decic(robertsonimplicit, 0, y0, [1, 1, 0], yp0, [0, 0, 0]);

//Solve ODE
(ColVec T, Matrix Y, Matrix Yp) = Ode45i(robertsonimplicit, (y0, yp0), [0, 4e6]);
// Plot the result
Y[.., 1] = 1e4*Y[.., 1];
SemiLogx(T, Y);
Xlabel("Time t"); Ylabel("Soluton y");
Legend(["y_1", "1e4*y_2", "y_3"], MiddleLeft);
Title("Solution of implicit Robertson's ODE with ODE45i");
SaveAs("Implicit-Robertson-ODE-Ode45i.png");

Ouput

Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Warning: Matrix is close to singular or badly scaled.Results may be inaccurate
Implicit-Robertson-ODE-Ode45i.png

As an exercise, the reader is encouraged to solve this same problem but using this constraint

\[y'_1 + y'_2 + y'_3 = 0\]

that is:

\[\begin{split}\begin{array}{rcl} 0 &=& y'_1 + 0.04y_1 - 10^4 y_2y_3 \\ 0 &=& y'_2 - 0.04y_1 + 10^4 y_2y_3 + (3 \times 10^7)y_2^2\\ 0 &=& y'_1 + y'_2 + y'_3. \end{array}\end{split}\]