# How to verify that this implicit equation is a solution to a nonlinear ordinary differential equation.

I am studying the nonlinear ordinary differential equation

$$\frac{d^2y}{dx^2}=\frac{1}{y}-\frac{x}{y^2}\frac{dy}{dx}$$

I have entered this equation into two different math software packages, and they produce different answers.

software 1:

$$0=c_2-\ln(x)-\frac{1}{2}\ln\left(-\frac{c_1y}{x}-\frac{y^2}{x^2}+1\right)-\frac{c_1}{\sqrt{-c_1^2+4}}\tan^{-1}\left(\frac{c_1+\frac{2y}{x}}{\sqrt{-c_1^2+4}}\right)$$

software 2:

$$0=-c_2-\ln(x)-\frac{c_1}{\sqrt{c_1^2+4}}\tanh^{-1}\left(\frac{c_1x+2y}{x\sqrt{c_1^2+4}}\right)-\frac{1}{2}\ln\left(\frac{c_1xy-x^2+y^2}{x^2}\right)$$

I have not attempted to verify the solution from software 1 yet, but have done some work on software 2.

I first used software 2 to try to solve for y, to substitute the expression for y directly into the ordinary differential equation. The result was the following:

I believe that this output is ambiguous, since there are essentially two equations that are supposed to be equated to zero

I am not sure if it is possible to solve for y, and hence to check the validity of this solution using this method.

I then did some reading on the internet, and it was suggested to, in this case, take the second implicit derivative with respect to x, then simplify.

I tried to do this with math software 2, and the result was, after simplifying:

$$\frac{d^2y}{dx^2}=\frac{c_1xy-x^2+y^2}{y^3}$$

I did some hand calculations, and it seems that software 2 simplifies the result before calculating the next derivative, even without using the simplify command.

Considering this, I used the software to take the first derivative implicitly, then wrote out the equation in full, put that equation into a different form than the software output, and calculated the second derivative implicitly by hand, treating derivatives as functions of x for operations such as the product rule.

The equation I calculated did not match the original differential equation.

Software 2 has a function called odetest, which is supposed to verify that a function is a solution to an ordinary differential equation. If you use odetest on this solution, the returned result is zero, implying that the function is a solution.

The problem is that odetest does not show steps. I contacted the company and asked to see the steps for this calculation, but they would not provide the steps.

Are there any other ways to verify implicit solutions to an ordinary differential equation?

As a symbolic solution exists, it should be possible to transform the equation and integrate it with relatively elementary means. And indeed, by careful examination one finds that the right side is the derivative of $$\frac xy$$, so that a direct integration to $$y'(x)=\frac{x}{y(x)}+c$$ is possible. You could try to find this form of the equation from your solutions, avoiding the second derivative.
$$\frac{d^2y}{dx^2}=\frac{1}{y}-\frac{x}{y^2}\frac{dy}{dx}$$ You can check the solution just rewrite the DE as: $$\frac{d^2y}{dx^2}=(x)'\frac{1}{y}+x \left (\frac{1}{y}\right )'$$ Since $$(fg)'=f'g+fg'$$ we have: $$y''= \left (\frac xy \right )'$$ $$y'=\left (\frac xy \right) +C$$