10-02-2023

Problem: Solve the following differential equation. \[ y\mathrm{d} x-x\mathrm{d} y+ \left( 1+x^{2} \right) \mathrm{d} x + x^{2} \sin y ~\mathrm{d} y=0,~y(1)=0. \]

Solution: The given differential equation is \[ y\mathrm{d} x-x\mathrm{d} y+ \left( 1+x^{2} \right) \mathrm{d} x + x^{2} \sin y ~\mathrm{d}. \] We divide the above equation by $x^{2} $ we get \begin{align*} & \frac{y\mathrm{d} x - x\mathrm{d} y}{x^2} + \frac{1+x^{2} }{x^{2} } \mathrm{d} x + \sin y\mathrm{d} y = 0 \\ \implies & - \frac{x\mathrm{d} y-y\mathrm{d} x}{x^{2} } + \left( \frac{1}{x^{2} }+1 \right) \mathrm{d} x + \sin y\mathrm{d} y = 0 \\ \implies & -d\left( \frac{y}{x} \right) + \left( 1+\frac{1}{x^{2} } \right) \mathrm{d} x + \sin y\mathrm{d} y =0. \end{align*}


Integrating the above, we get \begin{align*} & -\frac{y}{x} + \left( x-\frac{1}{x} \right) - \cos y = c \\ \implies & -y + x^{2} - 1 - x\cos y = cx, \end{align*} where $c$ id an arbitrary constant. Now to get the value of $c$, we will use the initial condition. We substitute $x=1$ and $y=0$. \begin{align*} -0 + 1 - 1 - 1 = c & \implies c = -1. \end{align*} Thus, the solution of the given differential equation will be \[ \textcolor{blue}{\boxed{y-x^{2}-x+x\cos y= - 1 }} \]