# Solve differential for general solution

I need to solve the following for a general solution

1. $\frac{\mathrm{d} y}{\mathrm{d} x} = -\frac{x}{y}$

2. $\frac{\mathrm{d} y}{\mathrm{d} x} = \frac{x-y+1}{x+y+3}$

for the first one I said it was a separable equation and got $y = ix + C$, is that right?

and for the second one is it a homogeneous one?

-
I just added Tex to your question. Make a comment if I mis-interpreted the math though! –  izœc Mar 23 '14 at 9:40
Nope, the first one is not. Try to put your solution into the equation. I suppose that the error comes from a misplaced integration constant. As for the second, it is not homogenouos. The right part seen as a function of $x$ and $y$ - $rhs(x,y)$ - doesn't have the property $rhs (x,ay)=a^k rhs(x,y)$ for positive $a$. –  TZakrevskiy Mar 23 '14 at 9:42

The first is separable
The second is exact : convert it to $Mdx+Ndy=0$ with $M_y=N_x=-1$

-

For the first one, I obtained $y = \pm \sqrt{C - x^2}$. Make sure you keep track of the integration constant, and apply the square root to the entire equation from : $y^2 = C - x^2$. Also, as has been pointed out in the comment, you can and should evaluate $y$ in the original equation to ensure that it is in fact a solution. This also allows you to check that either of $y = \sqrt{C - x^2}$ and $y = - \sqrt{C - x^2}$ give solutions to the equation.

-

Hint

For the second one, make a change of variable $z=x+y+3$. After simplification, the differential equation will look much better.

-

The second one has a solution as $$y(x)=-x\pm\sqrt{2x^2+8x+C}-3$$ So, it's not homogeneous.

-