# Solving a linear differential equations

Assuming that p not equals to $0$, state conditions under which the linear differential equation

$$y'+p(x)y=f(x)$$

is separable. If the equation satisfies these conditions, solve it by separation of variables and by one other method.

What i tried

Im confused about this question, because I think this is a linear equation and could be solve by the integrating factor method and i dont see how the seperable method can be used. What it attempted was to move the RHS of the equation to the LHS to give $y'+p(x)y-f(x)=0$. I then divide the LHS of the equation by $f(x)$ , my guess is that this equation is seperable only when $f(x)=p(x)$. However im stuck from here onwards. Could anyone help me with this. Thanks

• I would go further and add that any function $p(x) = nf(x)$ where $n$ is any number. Jan 20, 2015 at 7:32
• What happens if $f(x) = 0$? Jan 20, 2015 at 8:09
• The equation becomes $$y'+p(x)y=0$$. Jan 20, 2015 at 8:15

A separable first-order linear differential equation is of the form $$\dfrac{dy}{dx}=a(x)b(y)$$ Our differential equation being $$\dfrac{dy}{dx}+p(x)y=f(x)$$ we want to reduce it to the first form above, and thus we're looking for the appropriate functions $a(x)$ and $b(y)$. Therefore we can write \begin{align}a(x)b(y)&=f(x)-p(x)y\\&=p(x)\left(\dfrac{f(x)}{p(x)}-y\right)\end{align} And we set $a(x)=p(x)$. Now, $\frac{f(x)}{p(x)}$ must be independent of $x$, so we set $f(x)=kp(x)$, with $k\in\mathbb{R}$.

Therefore, our reduced equation is $$\dfrac{dy}{dx}=p(x)\cdot(k-y)$$ which is indeed separable as $$\int\dfrac{dy}{k-y}=\int p(x)dx$$ Also note that in the case $k=0$, we get the first-order linear homogeneous equation $$\dfrac{dy}{dx}+p(x)y=0$$

It appears the condition is $f(x)=kp(x)$ for some constant $k$. In this case

$$y'=kp(x)-yp(x)=p(x)(k-y)$$

Can you handle it from here?

• Yup i got it, is it necessary to add the constant $K$, because i equate $f(x)=p(x)$ without a constant. Jan 20, 2015 at 8:46
• @yswong That would be the case for $k=1$. Mattos's hint was trying to show you that $f(x)=0$ $(k=0)$ also produces a separable equation. Including the $k$ seems to be a better answer, but I'm not $100\%$ positive there aren't any other cases.
– Mike
Jan 20, 2015 at 8:51
• @Mike There aren't. Jan 20, 2015 at 9:05