# Differential equation with separable, probably wrong answer in book

I have a differential equation:

$$\frac{dy}{dx} = y \log(y)\cot(x)$$

I'm trying solve that equation by separating variables and dividing by $y\log(y)$:

$$dy = y \log(y) \cot(x) dx$$

$$\frac{dy}{y \log(y)} = \cot(x) dx$$

$$\cot(x) - \frac{dy}{y \log(y)} = 0$$

Where of course $y > 0$ regarding to division

Beacuse:

$$\int \frac{dy}{y \log(y)} = \ln | \ln(y) | +C$$

and:

$$\int \cot(x) dx = \ln| \sin(x) | + C$$

So:

$$\ln| \sin(x) | - \ln | \ln(y) | = C$$

$$\ln \lvert\frac{\sin(x)} {\ln(y)} \rvert = C$$

$$\frac{\sin(x)}{\ln(y)} = \pm e^{C}$$

$d = \pm e^{C}$

$$\sin(x) = d \ln(y)$$

$$\frac{\sin(x)}{d} = \ln(y)$$

$$e^{\frac{\sin(x)}{d}} = y$$

This is my final answer. I have problem because in book from equation comes the answer to exercise is:

$$y = e^{c \sin(x)}$$

Which one is correct?

I will be grateful for explaining Best regards

• They're the same answer. It depends which side you put the arbitrary constant on. – Paul Apr 18 '17 at 12:00
• The fraction $1/d$ is a constant. So is $c$. However, it appears you lost a solution since $c=0$ yields a valid solution. Thus, your answer is incomplete. The answer in the book is correct. – quasi Apr 18 '17 at 12:02
• @Krzystof Your book's ans s correct. You must notice hat $c$ and $\ln c$ both are constants . Thus try using $\ln c$ as constant of integration. You will reach where the book specifies. – The Dead Legend Apr 18 '17 at 12:08

Note that $$\int \frac{du}{u} = \ln |u| + c_1 = \ln |u| + \ln |c| = \ln |cu|.$$

$$\cot x\, dx =\frac{dy}{y \ln y}$$ $$\implies \frac{d(\sin x)}{\sin x} = \frac{d(\ln y)}{y \ln y}$$
$$\int \frac{d(\sin x)}{\sin x} \, dx = \int \frac{d(\ln y)}{\ln y}\, dx$$ $$\implies \ln |a\sin x| = \ln |b\ln y|$$ $$\implies a\sin x = b\ln y, \quad(1)$$ $$\implies \ln y = c\sin x$$ $$\implies y = e^{c\sin x}$$ where $a, b, c$ are arbitrary constants. Note that $(1)$ includes all possible solutions including the case $a=0$.
NOTE: $$\ln|\frac{\sin x}{\ln y}|=C$$ Can also be written as $$\ln|\frac{\sin x}{\ln y}|=\ln C$$ (Because both terms are constant.)
This shall give you $$\sin x =C \ln y$$ Which will give you: $$y=e^{c \sin x}$$ where $c=\frac{1}{C}$. I will prefer this solution because in your answer d=0 won't be giving you any solution but Note that c=0 will do. {Credits to that comment}