Solving $\frac{dy}{dx} = y - 3x$ with $y(-1) = 2$

83 Views Asked by At

Alright I know I'm asking for an answer with this, however on all of the examples presented to me with my notes in class and online, It doesn't show $y' = yx \leftarrow \textrm{example}$.

It shows problems like $y' + \tan(x)y = \cos^2(x)$. that's just an example. They have $y'$ on the left with $x$ and $y$.

Therefore, I am not certain that I will be making an error that I won't know about. I just want some example on how to do this so I don't mess up with some explanation.

2

There are 2 best solutions below

0
On BEST ANSWER

Your equation is $$y'-y=-3x$$ If we multiply both sides by $$\mu = \exp\left(\int -1 \right)=\exp(-x)$$ We can rewrite it as $$\left(\exp(-x)y\right)'=-3x\exp(-x)$$ Can you see why? Can you continue?

0
On

The integrating factor will work whenever you have $y'+f(x)y=g(x)$, $f$ and $g$ continuous.

Here $f(x)=-1$ and $g(x)=-3x$.

Thus use $e^{\int -1\operatorname{dx}}=e^{-x}$.

Get $(e^{-x}y)'=e^{-x}(-3x)$.

Integrate: $e^{-x}y=3(e^{-x}+xe^{-x})+C$ Finally, $y=3(1+x)+Ce^x$.
And $y(-1)=0+\frac Ce=2\implies C=2e$. So $y=3+3x+2e^{x+1}$. Note: Integration by parts was used.