# Thread: First order linear equation

1. ## First order linear equation

Where am I going wrong here?!?

Find the general solution of the following equation;

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

i.e. $\displaystyle \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...

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

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

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

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

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

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

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

The answer given in the tutorial is (no working given) $\displaystyle 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;

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

(...)

The answer given in the tutorial is (no working given) $\displaystyle 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 $\displaystyle x$ try multiplying by $\displaystyle x$ :

$\displaystyle 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 $\displaystyle \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.

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