# Math Help - First order linear equation

1. ## First order linear equation

Where am I going wrong here?!?

Find the general solution of the following equation;

$x \frac{dy}{dx} + 2y = x^3$

i.e. $\frac{dy}{dx} + \frac{2}{x}y = x^2$

So, my working.

Using the whole (ry)' = ry' + r'y = r(y' + py) = rf thing where p = 2/x and f = x^2...

$r' = rp = \frac{2}{x}r$

=> $(log(r))' = \frac{2}{x}$

=> $log(r) = log(\frac{2}{x})$

So $r = \frac{2}{x}$

=> $(\frac{2y}{x})' = 2x$

=> $\frac{2y}{x} = x^2 + C$

=> $y = \frac{x^3}{2} + \frac{Cx}{2}$

The answer given in the tutorial is (no working given) $y = \frac{x^3}{5} + Cx^{-2}$ and I have no idea how to get that though I figure the problem lies with the log bit... Any help?

2. Hello,
Where am I going wrong here?!?

Find the general solution of the following equation;

$x \frac{dy}{dx} + 2y = x^3$

(...)

The answer given in the tutorial is (no working given) $y = \frac{x^3}{5} + Cx^{-2}$ and I have no idea how to get that though I figure the problem lies with the log bit... Any help?
Instead of dividing by $x$ try multiplying by $x$ :

$x \frac{\mathrm{d}y}{\mathrm{d}x} + 2y = x^3\implies
x^2 \frac{\mathrm{d}y}{\mathrm{d}x} + 2xy = x^4$

Now note that the LHS of the last equality is $\frac{\mathrm{d}}{\mathrm{d}x}(x^2y)$ and you are done.

3. How clever.

Only thing is, i have a resit in methods of applied maths in a few days and one of the things i did wrong on the first exam was that thing where you use the (ry)' = rf thing and i know thats what you've sort of done here but i need to know where i go wrong in my working above.

=> $(log(r))' = \frac{2}{x}$
=> $log(r) = log(\frac{2}{x})$
This step is wrong. Integrating both sides of $\left(\log r\right)' = \frac{2}{x}$ you should get $\log r = 2\log x+C=\log x^2+C$ hence $r=\exp\left(\log x^2+C \right)=x^2 \underbrace{\exp C}_{\text{constant}}=K x^2$. Using $(ry)'=rf$ you'll get the result you're expecting.