Example 6 Solve

\[ y^{\prime }=\frac {y}{x}+x\sin \left ( \frac {y}{x}\right ) \]

The first step is to see if we can write the above as \begin {equation} y^{\prime }=\frac {y}{x}+g\left ( x\right ) f\left ( b\frac {y}{x}\right ) ^{\frac {n}{m}} \tag {1} \end {equation} Hence \begin {equation} y^{\prime }=\frac {y}{x}+x\sin \left ( \frac {y}{x}\right ) \tag {2} \end {equation} Comparing (2) to (1) shows that\begin {align*} n & =1\\ m & =1\\ g\left ( x\right ) & =x\\ b & =1\\ f\left ( b\frac {y}{x}\right ) & =\sin \left ( \frac {y}{x}\right ) \end {align*}

Hence the solution is \begin {equation} y=ux \tag {A} \end {equation} Where \(u\) is the solution to \begin {equation} u^{\prime }=\frac {1}{x}g\left ( x\right ) f\left ( u\right ) \tag {3} \end {equation} Therefore \(f\left ( u\right ) =\sin u\) and \(\left ( 3\right ) \) becomes\[ u^{\prime }=\frac {1}{x}\left ( x\right ) \sin \left ( u\right ) \] This is separable. \begin {align*} \frac {1}{\sin u}du & =dx\\ \int \frac {1}{\sin u}du & =\int dx\\ \ln \sin \frac {u}{2}-\ln \cos \frac {u}{2} & =x+c_{1}\\ \ln \tan \frac {u}{2} & =x+c_{1}\\ \tan \frac {u}{2} & =c_{2}e^{x}\\ \frac {u}{2} & =\arctan \left ( c_{2}e^{x}\right ) \\ u & =2\arctan \left ( c_{2}e^{x}\right ) \end {align*}

Hence (A) becomes\[ y=2x\arctan \left ( c_{2}e^{x}\right ) \]