# Linear, first order ODE, given general solution

Construct a linear first order ODE of $$xy'+a_0(x)y=g(x)$$ such that the general solution is $$y=x^3+\frac{c}{x^3}$$

If I substitute the general solution into the question, $$xy'+a_0(x)(x^3+\frac{c}{x^3})=g(x)$$ this form looks unusual to solve and a(x), g(x) are not given in any expression. how can I to approach this?

• You also know that $y'=3x^2+\frac{-3c}{x^4}$
– Paul
Commented Oct 3, 2016 at 15:39

1. First you should compute $y'$ and plug it in.
2. Since the general solution is $y = x^3 + c x^{-3}$, consider two solutions $y_1 = x^3 + c_1 x^{-3}$ and $y_2 = x^3 + c_2 x^{-3}$. Linearity tells you that $y_1 - y_2 = (c_1 - c_2) x^{-3}$ is a solution to the corresponding homogeneous problem. This should allow you to find $a(x)$.
3. Using the knowledge from $a(x)$ you can then find the inhomogeneous term $g(x)$ using the general form of the solution.
Isolating the constant gives $$C=x^3y-x^6.$$ Differentiating to get rid of the constant results in $$0=x^3y'+3x^2y-6x^5$$ The canonical first order linear equation form of that is then $$y'+\frac3xy=6x^2$$
If $y = x^3 + cx^{-3}$ then $$xy' = x\left(3x^2 -3cx^{-4}\right) = 3x^3 - 3cx^{-3}$$ So $$xy' + a_0(x) y = 3x^3 - 3cx^{-3}+ a_0(x) \left(x^3 + cx^{-3}\right) = (a_0(x)+3)x^3 + c(a_0(x)-3)x^{-3}$$ Since this is to be equal to a function $g(x)$ independent of $c$, we must have $a_0(x)=3$. It follows that $g(x)=6x^3$ works.