Example 1 \[ y^{\prime \prime }-4xy^{\prime }+\left ( 4x^{2}-2\right ) y=0 \] \(p=1,q=-4x,r=\left ( 4x^{2}-2\right ) \,.\) Let us first check if the ode is exact or not as is. The condition for exactness is \[ p^{\prime \prime }-q^{\prime }+r=0 \] Therefore the above becomes\[ 0+4+\left ( 4x^{2}-2\right ) =0 \] The LHS is not zero. This means the ode is not exact. Therefore we need to try to find an integration factor \(\mu \left ( x\right ) \) to make the ode exact. (4) becomes\begin {align*} \mu ^{\prime \prime }p+\mu ^{\prime }\left ( 2p^{\prime }-q\right ) +\mu \left ( p^{\prime \prime }-q^{\prime }+r\right ) & =0\\ \mu ^{\prime \prime }+\mu ^{\prime }\left ( 4x\right ) +\mu \left ( 4+\left ( 4x^{2}-2\right ) \right ) & =0\\ \mu ^{\prime \prime }+4x\mu ^{\prime }+\mu \left ( 2+4x^{2}\right ) & =0 \end {align*}

We see in practice that finding the integrating factor leads to yet another second order ode which is as hard to solve as the original ode. The solution to this ode can be found to be \(e^{-x^{2}},xe^{-x^{2}}\). We only need one integrating factor. Hence let\[ \mu \left ( x\right ) =e^{-x^{2}}\] Multiplying this by the given ode now makes it exact\[ e^{-x^{2}}y^{\prime \prime }-4xe^{-x^{2}}y^{\prime }+\left ( 4x^{2}-2\right ) e^{-x^{2}}y=0 \] To see this let us check the condition again now. Here \(p=e^{-x^{2}},q=-4xe^{-x^{2}},r=\left ( 4x^{2}-2\right ) e^{-x^{2}}\). Hence\begin {align*} p^{\prime \prime }-q^{\prime }+r & =0\\ \left ( 4e^{-x^{2}}x^{2}-2e^{-x^{2}}\right ) -\left ( 8e^{-x^{2}}x^{2}-4e^{-x^{2}}\right ) +\left ( 4x^{2}-2\right ) e^{-x^{2}} & =0\\ 0 & =0 \end {align*}

We see that it is now exact. Hence it has adjoint ODE of the form (5) \[ \left ( \mu py^{\prime }+\left ( \mu \left ( q-p^{\prime }\right ) -\mu ^{\prime }p\right ) y\right ) ^{\prime }=0 \] Hence the first integral is \[ \mu py^{\prime }+\left ( \mu \left ( q-p^{\prime }\right ) -\mu ^{\prime }p\right ) y=c \] Using \(\mu =e^{-x^{2}},p=1,q=-4x\) the above becomes\begin {align*} e^{-x^{2}}y^{\prime }+\left ( -4xe^{-x^{2}}-\left ( -2xe^{-x^{2}}\right ) \right ) y & =c\\ e^{-x^{2}}y^{\prime }-2xe^{-x^{2}}y & =c\\ y^{\prime }-2xy & =ce^{x^{2}} \end {align*}

This is linear first ode whose solution is \[ y=e^{x^{2}}\left ( cx+c_{2}\right ) \]