ode internal name "second order ode lagrange adjoint equation method"
This method is used when hint is “adjoint”. This transformation does not use change of variables. It was discovered by Lagrange in his Miscellanea Taurensis paper. It reduces the order of the ode by one, assuming the so called adjoint ode can be solved. This is also described in section 1.5.1 on page 14 of the “book Change and Variations A History of Differential Equations to 1900” by Jeremy Gray. This method will only work if adjoint equation turns out to be simple and can be solved. It is now only used by the program if the hint “adjoint” is detected or if all the other methods were first tried and they all fail to solve the ode. So this method works if the adjoint ode can be solved. But the adjoint ode itself is second order non constant ode. So we need to solve a second order non-constant ode in order to reduce the order by one of the original ode. Luckily the adjoint ode turns out to be possible to solve by change of variables when the original one is not, and that is why this method is tried.
Given the ode
This method starts by multiplying the ode by some unknown function \(z\equiv z\left ( x\right ) \) which gives
Using integration by parts on \(\int zpy^{\prime }dx\) using \(\int udv=uv-\int vdu\) where \(u=zp\) and \(dv=y^{\prime }\), hence \(v=y\) and \(du=\frac {d}{dx}\left ( zp\right ) \). Therefore
Using integration by parts on \(\int zy^{\prime \prime }dx\) using \(\int udv=uv-\int vdu\) where \(u=z\) and \(dv=y^{\prime \prime }\), hence \(v=y^{\prime }\) and \(du=z^{\prime }\). Therefore
Eq (3) becomes
Integrating by part again the term \(\int y^{\prime }z^{\prime }dx\) using \(\int udv=uv-\int vdu\) where \(u=z^{\prime }\) and \(dv=y^{\prime }\), hence \(v=y\) and \(du=z^{\prime \prime }\). Therefore
Substituting this in (4) gives
The adjoint ode is the term inside the integral above given by
If this can be solved, where the solution \(z_{sol}\left ( x\right ) \neq 0\), then (5) reduces to
Which is first order ode in \(y\left ( x\right ) \) which can be easily solved for \(y\left ( x\right ) \). Equation (6) is called the Lagrange adjoint equation. This method of course works only if the adjoint ode can be solved for \(z\left ( x\right ) \) and the solution is not zero.