# Solution to the differential equation $\left(x \csc\left(\frac{y}{x}\right)-y\right) dx + xdy$?

What is the general solution to the differential equation $\left(x \csc\left(\frac{y}{x}\right)-y\right) dx + xdy$?

My work

If Im going to reaarange the differential equation above, it would look like this:

$$x \csc\left(\frac{y}{x}\right) dx-ydx + xdy$$ $$x \csc\left(\frac{y}{x}\right) dx-(ydx - xdy)$$

I got an idea how to deal with the expression $(ydx - xdy)$, but I don't know how to approach the expression $x \csc\left(\frac{y}{x}\right) dx$ to get the general solution of the d.e.

How to get the general solution to the differential equation above?

• Please do not forget to "accept" the answer that fits you by clicking on the tick, because it's important for answers to be accepted so that it shows up in the feature when people might search something similar Nov 15 '17 at 17:09

I guess the differential equation you are trying to solve is :

$$\left(x \csc\left(\frac{y}{x}\right)-y\right) dx + xdy =0$$

Let $y(x) = xv(x)$, which gives : $\frac{dy(x)}{dx} = v(x) + \frac{dv(x)}{dx}$ ::

$$x\csc(v(x)) + x \bigg(x\frac{dv(x)}{dx} + v(x) \bigg) - xv(x) = 0$$

$$\Leftrightarrow$$

$$x\bigg(\csc(v(x)) + x\frac{dv(x)}{dx}\bigg) = 0$$

$$\Leftrightarrow$$

$$\frac{dv(x)}{dx} = - \frac{\csc(v(x))}{x}$$

$$\Leftrightarrow$$

$$\frac{dv(x)}{dx}\sin(v(x)) = -\frac{1}{x}$$

$$\Rightarrow$$

$$\int \frac{dv(x)}{dx}\sin(v(x))dx = \int-\frac{1}{x}dx$$

$$\Leftrightarrow$$

$$\cos(v(x)) = -\ln(x) + c_1$$

Solving for $v(x)$ gives you :

$$v(x) = \begin{cases} -\arccos(\ln(x) - c_1) \\ \arccos(\ln(x) - c_1)\end{cases}$$

Substitute in the initial $y(x) = xv(x)$ that we used to solve the equation and you will get $y(x)$ !

• Huh we have: $$\int\frac{1}{x}\space\text{d}x=\ln\left|x\right|+\text{C}$$ Nov 15 '17 at 11:49
• The general solution I got from your answer is $y = x\cos^{-1}(ln(x) + c)$. Is that right? Nov 15 '17 at 12:46
• @PalautotKa You should get one with a minus sign $-$ as well, since I gave you 2 cases ! But yes, that one is correct ! Nov 15 '17 at 13:08
• The solutions are : $$y(x) = \begin{cases} x\cos^{-1}(\ln(x) + c_1) \\ -x\cos^{-1}(\ln(x) + c_1) \end{cases}$$ Also, usual functions (for example $\cos, \ln$) are written using the command : \ln for $\ln$ for example. Just a tip ! Nov 15 '17 at 13:13
• I wonder why there were 2 solutions........:-) Nov 16 '17 at 8:13

Well, we have:

$$\left(x\cdot\csc\left(\frac{\text{y}}{x}\right)-\text{y}\right)\space\text{d}x+x\space\text{d}\text{y}=0\space\Longleftrightarrow\space\text{y}\space'\left(x\right)=\frac{\text{y}\left(x\right)}{x}-\csc\left(\frac{\text{y}}{x}\right)\tag1$$

Let $\text{y}\left(x\right):=x\cdot\text{v}\left(x\right)$:

$$x\cdot\left(\csc\left(\text{v}\left(x\right)\right)+x\cdot\text{v}\space'\left(x\right)\right)=0\space\Longleftrightarrow\space-\frac{\text{v}\space'\left(x\right)}{\csc\left(\text{v}\left(x\right)\right)}=\frac{1}{x}\tag2$$

Let $\text{u}:=\text{v}\left(x\right)$:

$$\int-\frac{\text{v}\space'\left(x\right)}{\csc\left(\text{v}\left(x\right)\right)}\space\text{d}x=\int-\frac{1}{\csc\left(\text{u}\right)}\space\text{d}\text{u}=\int\frac{1}{x}\space\text{d}x=\ln\left|x\right|+\text{C}\tag3$$

• The general solution I got from your answer is $y = x\cos^{-1}(ln(x) + c)$. Is that right? Nov 15 '17 at 12:54

Substitute $y=xu$ like in a homogeneous ODE to find $$0=\frac{dx}x+\sin(u)du.$$

We need to reaarange the differential equation so that it can be solved easily...

$$\left( x \csc\left( \frac{y}{x}\right) - y\right) dx + x dy = 0$$ $$x \csc\left( \frac{y}{x}\right)dx - ydx + xdy = 0$$ $$xdy = -x \csc\left( \frac{y}{x}\right)dx + ydx$$

Divide the terms of the differential equation by $x$, getting:

$$dy = - \csc\left( \frac{y}{x}\right)dx + \left( \frac{y}{x}\right)dx$$

Apparently this modified form of differential equation is a homogenous differential equation. So we let $v = \frac{y}{x}$, $y = vx$ and $dy = vdx + xdv$. So we get:

$$dy = - \csc\left( \frac{y}{x}\right)dx + \left( \frac{y}{x}\right)dx$$ $$vdx + xdv = - \csc(v)dx + vdx$$ $$xdv = - \csc(v)dx$$ $$\frac{dv}{-\csc(v)} = \frac{1}{x} dx$$ $$-sin(v)dv = \frac{1}{x} dx$$

The above differential equation is now a variable-separable type...so we get the integral of individual terms.

$$-sin(v)dv = \frac{1}{x} dx$$ $$\int -sin(v)dv = \int \frac{1}{x} dx$$ $$cos(v) + c_1 = ln(x) + c_2$$ $$cos(v) = ln(x) + c_2 - c_1$$ $$cos(v) = ln(x) + C$$

Now getting the $v$:

$$cos(v) = ln(x) + C$$ $$v = cos^{-1}(ln(x) + C)$$

The solution of the given differential equation $\left( x \csc\left( \frac{y}{x}\right) - y\right) dx + x dy = 0$ would be:

$$y = vx$$ $$y = (cos^{-1}(ln(x) + C))x$$ $$y = xcos^{-1}(ln(x) + C)$$

Alternate ways of answering it are encouraged....