Solve ODE reducible to exact equation

1. Nov 29, 2013

mahler1

The problem statement, all variables and given/known data.

Find all the solutions of the equation:
$\dfrac{\sin(y)}{x}dx+(\dfrac{y}{x}\cos(y)-\dfrac{\sin(y)}{y})dy=0$ knowing that the equation admits an integrating factor $u$ of the form $u(x,y)=h(\dfrac{x}{y})$

The attempt at a solution.

If I call $M(x,y)=\dfrac{\sin(y)}{x}$ and $N(x,y)=\dfrac{y}{x}\cos(y)-\dfrac{\sin(y)}{y}$ then, in order to be an exact differential equation, $M$ and $N$ must satisfy $M_y=N_x$, but $M_y=\dfrac{\cos(y)}{x}≠-\dfrac{y\cos(y)}{x^2}=N_x$, so this is not an exact differential equation.

As the exercise suggests, I've tried to propose an integrating factor $u$ of the form $u(x,y)=h(\dfrac{x}{y})$, but, since up to know I've only solved equations where the integrating factor depended just on one of the variables, I got stuck in the middle of the problem.

So, $u$ must satisfy:

$(uM)dx+(uN)dy=0$

Then, $(uM)_y=(uN)_x \iff u_yM+uM_y=u_xN+uN_x \iff xh_yM+hM_y=\dfrac{1}{y}h_xN+hN_x$.

Calculating all these partial derivatives gives:

$xh_y\dfrac{\sin(y)}{x}+h\dfrac{\cos(y)}{x}=\dfrac{1}{y}h_x(\dfrac{ycos(y)}{x}-\dfrac{\sin(y)}{y})+h(-\dfrac{ycos(y)}{x^2})$

At this point I got stuck and I don't know what and how to integrate in order to find $u(x,y)$

2. Nov 29, 2013

vela

Staff Emeritus
You didn't differentiate correctly. You should have, for example,
\begin{align*}
(uM)_y &= \frac{\partial}{\partial y} \left[ h\left(\frac{x}{y}\right) \frac{\sin y}{x}\right] \\
&= h'\left(\frac{x}{y}\right)\left(-\frac{x}{y^2}\right) \frac{\sin y}{x} + h\left(\frac{x}{y}\right) \frac{\cos y}{x} \\
&= -h'\left(\frac{x}{y}\right) \frac{\sin y}{y^2} + h\left(\frac{x}{y}\right) \frac{\cos y}{x}
\end{align*}

3. Nov 29, 2013

mahler1

Thanks, I'll correct it and see if I can get a nicer expression.

4. Nov 29, 2013

mahler1

After vela's correction, I got:

$(uM)_y=-h'(\dfrac{x}{y})(\dfrac{\sin(y)}{y^2})+h(\dfrac{x}{y})(\dfrac{\cos(y)}{x})$.
$(uN)_x=h'(\dfrac{x}{y})(\dfrac{\cos(y)}{x}-\dfrac{\sin(y)}{y^2})-h(\dfrac{x}{y})\dfrac{y\cos(y)}{x^2})$.
So, $(uM)_y=(uN)_x$ if and only if

$-h'(\dfrac{x}{y})\dfrac{\sin(y)}{y^2}+h(\dfrac{x}{y})\dfrac{\cos(y)}{x}=h'(\dfrac{x}{y})(\dfrac{\cos(y)}{x}-\dfrac{\sin(y)}{y^2})-h(\dfrac{x}{y})\dfrac{y\cos(y)}{x^2})$ if and only if

$h(\dfrac{x}{y})\dfrac{\cos(y)}{x}=h'(\dfrac{x}{y})(\dfrac{\cos(y)}{x})-h(\dfrac{x}{y})\dfrac{y\cos(y)}{x^2})$.

Then

$h(\dfrac{x}{y})(\dfrac{\cos(y)}{x}+\dfrac{y\cos(y)}{x^2})=h'(\dfrac{x}{y})(\dfrac{\cos(y)}{x})$

$1+\dfrac{y}{x}=\dfrac{h'\dfrac{x}{y}}{h\dfrac{x}{y}}$. If I make the substitution $z=\dfrac{x}{y}$, then the equation reduces to:

$1+\dfrac{1}{z}=\dfrac{h'(z)}{h(z)}$.

So

$\int (1+\dfrac{1}{z})dz=\int \dfrac{dh}{h} \iff z+ln(z)+k=ln(h)$.

Then, $h=ze^z=\dfrac{x}{y}e^{\dfrac{x}{y}}$. Now I have to go back to the original equation, which it will be reduced to an exact equation by this integrating factor.

Is this correct?

5. Nov 29, 2013

vela

Staff Emeritus
Yes, it is!

6. Nov 29, 2013

mahler1

Thanks very much!

7. Nov 29, 2013

lurflurf

Good work.
Let me offer a suggestion.
I would change variable z=x/y first to make things less messy
$$\frac{\sin(y)}{x}\mathrm{d}x+\left( \frac{y}{x}\cos(y)-\frac{\sin(y)}{y}\right)\mathrm{d}y=0\\ \text{becomes}\\ \sin(y)\frac{\mathrm{d}z}{z}+\frac{1}{z}\cos(y)\mathrm{d}y=0$$

8. Nov 29, 2013

Good remark.