# Solve the differential equation $(x + y)\,\mathrm{d}y = (4x + y)\,\mathrm{d}x$

$$(x + y)\,\mathrm{d}y = (4x + y)\,\mathrm{d}x$$

The variables don't seem to be separable, so I divided both sides by $x$ and put $t = \frac y x$. Even after this, I get a non-separable equation.

• It should always be separable after this substitution. – Jakobian Aug 4 '18 at 20:21

It is separable: If we let $y=tx$, we get that $$\frac{\mathrm{d}y}{\mathrm{d}x}=x\frac{\mathrm{d}t}{\mathrm{d}x}+t$$ So $$\frac{4x+tx}{x+tx}=x\frac{\mathrm{d}t}{\mathrm{d}x}+t$$ $$\frac{4+t}{1+t}=x\frac{\mathrm{d}t}{\mathrm{d}x}+t$$ $$\frac{4+t}{1+t}-t=x\frac{\mathrm{d}t}{\mathrm{d}x}$$ $$\frac{4+t}{1+t}-t\frac{1+t}{1+t}=x\frac{\mathrm{d}t}{\mathrm{d}x}$$ $$\frac{4+t}{1+t}-\frac{t+t^2}{1+t}=x\frac{\mathrm{d}t}{\mathrm{d}x}$$ $$\frac{4-t^2}{1+t}=x\frac{\mathrm{d}t}{\mathrm{d}x}$$ $$\frac{1+t}{4-t^2}=\frac{1}{x}\frac{\mathrm{d}x}{\mathrm{d}t}$$

This equation is homogeneous of order $0$ and we write $$y'=\dfrac{4x+y}{x+y}=\dfrac{4+\frac{y}{x}}{1+\frac{y}{x}}$$ Let $u=\dfrac{y}{x}$ then $u'x+u=y$ with substitution $$u'x+u=\dfrac{4+u}{1+u}$$ or $$\dfrac{1+u}{4-u^2}du=\dfrac{dx}{x}$$ implies $$-\dfrac14\ln(u+2)-\dfrac34\ln(2-u)=\ln(x)+C$$ now we replace $u=\dfrac{y}{x}$.

$$(x + y)\,\mathrm{d}y = (4x + y)\,\mathrm{d}x$$ $$\frac {dx}{(x + y)} = \frac {dy}{(4x + y)}$$ $$\frac {dx}{(x + y)} = \frac {dy}{(4x + y)}=-\frac {d(y-2x)}{(y-2x)} = \frac {d(2x+y)}{3(2x + y)}$$ We work with these 2 last fractions $$-\frac {d(y-2x)}{(y-2x)} = \frac {d(2x+y)}{3(2x + y)}$$ After integration $$-3\ln(y-2x) = \ln(2x + y)+K$$ Finally we get : $$\boxed {(y-2x)^3(y+2x)=C}$$

• This is an interesting solve, but the third line even though correct after verification, comes out of thin air. I think you got it backward from the other answers, if not I'm curious to know what's motivated the introduction of $(y-2x)$ and $(y+2x)$ groups ? – zwim Aug 4 '18 at 23:22
• But I do agree this method works with this diff equation it may not work with an equation thats a bit different...the classical substitution $y=tx$ is certainly the best solution for this kind of equation @zwim – Isham Aug 4 '18 at 23:27

HINT: Note that $$\frac{\partial}{\partial x} (x + y) = 1 = \frac{\partial}{\partial y} (4x + y)$$ and think of the solution in the form of $F(x, y) = 0$.

Can you proceed from here?

EDIT: As it was correctly noticed by Isham I made a mistake and the ODE $$(x + y) dy = (4x + y) dx$$ is indeed not exact. Below is the method that I was initially talking about.

In general, we have $$M(x, y) dx + N(x, y) dy = 0,$$ which is said to exact if $M_y - N_x = 0$, where the subscript variable denotes the argument of differentiation. It is straightforward to obtain a solution from here in the form $F(x, y) = 0$. For details see here.

However, in some cases when $M_y \neq N_x$ it still can be made to be exact. The latter is called Inexact differential equation. Unfortunately, here it is not the case, since both $$\frac{M_y - N_x}{M} = \frac 2 {x+y}$$ and $$\frac{M_y - N_x}{N} = \frac 2 {4x + y}$$ depends on both $x$ and $y$ and hence the initial ODE is not inexact either.

• Partial derivatives haven't been taught :( – Avnish Kabaj Aug 4 '18 at 20:15
• however, this is the simplest way to proceed and you need minimal knowledge of partial derivatives. I'll edit my answer from being a hint to a complete solution later on, if you find it helpful. – pointguard0 Aug 4 '18 at 20:17
• I would love to know more. – Avnish Kabaj Aug 4 '18 at 20:24
• @AvnishKabaj Look up Exact differential equations. – Jyrki Lahtonen Aug 4 '18 at 20:49
• you have a sign mistake since $$(x + y)\,\mathrm{d}y -(4x + y)\,\mathrm{d}x=0$$ so it's not a differential exact ..you have 1 and -1 – Isham Aug 4 '18 at 21:01