MathsCalculus

Wronskian
calculator.

The Wronskian is a determinant that tests whether functions are linearly independent.

How it's worked out

Functions are linearly dependent when one can be built from the others with constant multipliers. The Wronskian tests this with a determinant. Its matrix holds the functions in the first row, their first derivatives in the second, and so on, up to order n − 1 for n functions.

W(f,g)\displaystyle W(f, g)=fg′−gf′\displaystyle {}= f g' - g f'
W(f1,f2,f3)\displaystyle W(f_1, f_2, f_3)=|f1f2f3f1′f2′f3′f1′′f2′′f3′′|\displaystyle {}= \begin{vmatrix} f_1 & f_2 & f_3 \\ f_1' & f_2' & f_3' \\ f_1'' & f_2'' & f_3'' \end{vmatrix}

Why it works: if some mix of the functions is 0 everywhere, the same mix of their derivatives is 0 too. Then the columns of the matrix depend on each other, and its determinant is 0. Turned around, one point where W is not 0 proves the functions are independent on any interval that holds that point.

The value at your point comes from automatic differentiation, so it does not depend on small-step estimates. The formula for W(x) is built separately with symbolic rules. The test across your range checks W at 121 points and treats anything below about 10−1010^{-10}, relative to the matrix entries, as 0.

Worked examples

Noor checks the two solutions she found

Noor solved y′′+5y′+6y=0y'' + 5y' + 6y = 0 and got roots of −2 and −3. Before she writes the general solution, she needs to know that these two exponentials are a fundamental set, meaning every solution is a mix of them.

W\displaystyle W=e−2x(−3e−3x)\displaystyle {}= e^{-2x}\left(-3e^{-3x}\right)−e−3x(−2e−2x)\displaystyle {}- e^{-3x}\left(-2e^{-2x}\right)=−e−5x\displaystyle {}= -e^{-5x}

At x=0x = 0, W is −1, and an exponential is never 0, so it never vanishes. That is what she needs. The coefficient of y′y' is 5, and Abel's formula predicts −0.0067 at x=1x = 1. The real W there is −0.0067, so the two agree.

Open this example in the tool

Elena has a triple root

Elena's third-order equation, y′′′−3y′′+3y′−y=0y''' - 3y'' + 3y' - y = 0, has one root repeated three times, so her solutions are exe^x, xexxe^x and x2exx^2e^x. At x=0x = 0 the matrix has rows (1, 0, 0), (1, 1, 0), (1, 2, 2). It is triangular, so its determinant is the product down the diagonal, 2.

The formula is 2e3x2e^{3x}, which is never 0, so the three form a fundamental set. The coefficient of y′′y'' is −3, and W follows Abel's formula with that value across the range.

Open this example in the tool

Jonas tests a set with a hidden link

Jonas tries sin2⁡x\sin^2 x, cos2⁡x\cos^2 x and 1. They look unrelated, but sin2⁡x+cos2⁡x−1=0\sin^2 x + \cos^2 x - 1 = 0 ties them together, so they are dependent. The largest W across the range is 2.4 × 10⁻¹⁶, which is rounding noise, and the formula is 0.

Here the link and the zero agree. The zero alone would not have settled it, as the next section shows. Finding the actual link is what proves dependence.

Open this example in the tool

Reading your result

W is not 0 at your point. Your functions are independent on any interval through that point. That holds whether or not they solve an equation. For a pair of solutions of one equation, Trench's text adds that they then form a fundamental set.

W is 0 across the whole range. This does not prove dependence for functions in general. Peano's example is x2x^2 and x|x|x|x|. Here W comes out as 0 across the range, yet no single constant links them across 0, because one is positive on the left and the other negative. Analytic functions, such as those built from polynomials, exponentials and sines, do not behave this way, and neither do solutions of one linear equation.

W is 0 at one point only. The pair xx and x2x^2 has W=x2W = x^2, which is 0 at 0 and 1 at 1. The two are still independent. They do solve the equation in the last row below, but only away from 0, where dividing through by x2x^2 breaks down. With p=−2xp = -\frac{2}{x}, W matches Abel's formula on a range that stays right of 0.

Abel's formula. For solutions of an equation written with the top derivative alone, W is fixed by its value at one point and by p, the coefficient of the next derivative. So W is either 0 at every point of an interval where p is continuous, or at none of them.

W(x)\displaystyle W(x)=W(x0)e−∫x0xp(t)dt\displaystyle {}= W(x_0)\, e^{-\int_{x_0}^{x} p(t)\,dt}
Wronskians of solution pairs, at x = 1
SolutionsEquationW(1)
ex, e4xe^{x},\ e^{4x}y′′−5y′+4y=0y'' - 5y' + 4y = 0445.24
ex, xexe^{x},\ x e^{x}y′′−2y′+y=0y'' - 2y' + y = 07.39
cos⁡3x, sin⁡3x\cos 3x,\ \sin 3xy′′+9y=0y'' + 9y = 03
x, x2x,\ x^2x2y′′−2xy′+2y=0x^2 y'' - 2x y' + 2y = 01

Common mistakes

  • Reading a zero at one point as dependence. xx and x2x^2 have W = 0 at 0 and are independent. Look at the whole range before you decide.
  • Treating W ≡ 0 as proof. It proves dependence for solutions of one linear equation and for analytic functions. For anything else, you still need to find the actual link.
  • Worrying about the sign. Swapping two functions swaps the sign: exe^x then e2xe^{2x} gives 1 at 0, and the reverse order gives −1. Independence only asks if W is 0, so either answer is fine.
  • Taking derivatives one order too far. Three functions need rows up to the second derivative. Four rows would not make a square matrix.
  • Using p without dividing first. Abel's formula needs a top coefficient of 1. For x2y′′−2xy′+2y=0x^2 y'' - 2x y' + 2y = 0, the coefficient is −2x-\frac{2}{x}, not −2x-2x. A wrong p shows at once: with −1 for exe^x and e2xe^{2x}, the test says W does not match, because W at 1 is 20.0855.

Questions people ask

If W is not zero at even one point of an interval, the functions are linearly independent there. For n solutions of an equation of order n, it also means every other solution is a mix of them. You only need one point, so pick the one that makes the numbers easiest.

Sources