# Differential equation with separable variables

I have a differential equation:

$$x \cos(y) dx + x^{2} \sin(y) dy = a^{2}\sin(y) dy$$

I'm transforming equation to:

$$x \cos(y) dx + (x^{2}-a^2)\sin(y)dy = 0$$

And next I'm dividing both sides by $(x^2 - a^2 )\cos(y)$

and I'm obtaining equation:

$$\frac{x}{x^2 - a^2}dx + \tan(y) dy = 0$$

Beacuse:

$$\int \frac{x}{x^2 - a^2}dx = - \ln |x^2 - a^2 | +C$$

And:

$$\int \tan(y) dy = -\ln|\cos(y)| +C$$

So, solution in my opinion is:

$$\frac{1}{2} \ln | x^2- a^2| - \ln|\cos(y)| = C$$

And after transforming:

$$d \cos(y) = \sqrt{x^2-a^2}$$

where $d = \pm e^c$

In the book from which the exercise comes, the answer is:

$$a^{2} - x^{2} = \cos^2(y)$$

Is that the same like my answer?

• is this not $$a^2\sin(y)dy$$ in your first line? – Dr. Sonnhard Graubner Apr 15 '17 at 11:04
• i have $$y(x)=\arccos\left(\frac{\sqrt{x^2-a^2}}{C}\right)$$ – Dr. Sonnhard Graubner Apr 15 '17 at 11:11
• Are there any initial conditions given? – projectilemotion Apr 15 '17 at 11:25
• Yes, you are right. I've corrected that ;) – Krzysztof Michalski Apr 15 '17 at 11:28
• The only difference between your solution and the books is that your book effectively chooses $d = i$. Unless there is some additional information in the book that justifies doing this, your answer is correct and more general (as long as $d$ is allowed to take complex values - if not, then you need to consider the cases $|x| \le a$ and $|x| > a$ separately). – Paul Sinclair Apr 15 '17 at 17:55