Cauchy problem of a 1st order ODE, given 2 solutions

cauchy problemordinary differential equations

I did this in an introductory differential equations course once, but I cannot remember how to proceed and don't really know how to search online for this method.

So the problem states:

Let $$ y' + b(x)y = c(x) $$ be an ODE of order 1, where $b$ and $c$ are continous functions of $x$ on $I$. Write the solutions of the Cauchy problem for this equation with the initial condition $y(\pi) = 0$, if you know that $y_1 = x$ and $y_2 = \cos(x)$ are solutions to the equation.

Now I'm a bit confused. As I understand, $y_1$ and $y_2$ are particular solutions, but I need to also find the general solution.

My attempt so far:

If $y_1$ and $y_2$ are solutions, then $y_1 – y_2 = y$ is also a solution. Plugging this into the equation we get

$$ y_1' + b(x) y_1 – (y_2' + b(x) y_2) = c(x).$$

Next, since we know $y_1$ and $y_2$ solve the equations the following holds:

$$ y_1' + b(x) y_1 = c(x),$$

and the same is true if we change the indices to 2. Plugging this information in we get:

$$ c(x) – c(x) = c(x) $$

From this it follows that $c(x) = 0$. This is were I get stuck since the equation becomes seperable:

$$ \frac{dy}{y} = -b(x) dx, $$

and I don't quite know what to do with this, since integration doesn't end well for $y$.

Best Answer

We know that $c(x) = 1+xb(x)$, so we have $$ y'+b(x)y = c(x) = 1 + xb(x) , $$ and in particular,

$$ (y-x)' + b(x) (y-x) = 0 , $$ so we don't need to worry about $c$. In particular, $\cos{x}$ is also known to satisfy this equation, which allows us to solve for $b$: $$ \frac{(y-x)'}{y-x} = -b(x) = \frac{(\cos{x}-x)'}{\cos{x}-x} . $$ Integrating this gives immediately $$ y - x = A(\cos{x}-x) $$ for some constant $A$. It remains to find the constant, which is straightforward.


So in general, if we have two solutions, $y_1$ and $y_2$, then $$ y'+by = c = y_1' + b y_1 , $$ and so $$ (y-y_1)' + b(y-y_1) = 0, \qquad (y_2-y_1)' + b (y_2-y_1) = 0 $$ and therefore $$ \frac{(y-y_1)'}{y-y_1} = -b = \frac{(y_2-y_1)'}{y_2-y_1} , $$ so $$ y = y_1 + A(y_2-y_1) , $$ which is comparable to the results for matrix equations $A\mathbf{x} = \mathbf{b}$.

Related Question