Some questions regarding second order differential equations I'm solving second order differential equations and I am not having much trouble solving the questions I have been set, but I am just wondering why some things happens... so for this particular question, I must solve:
$y''+2y'=x$
$y(0)=1$
For the first part of finding the complementary function, I have set it out as:
$r^2+r=0$ and so $r=0$ or $r=-2$
Now the step I do not understand is how it then jumps from this to $y_1(x)=c_1e^{-2x}$ and $y_2(x)=c_2$. How do I work this out from the values of $r$? Also another thing I do not understand is how the particular solution of $y_p(x)=x(a_1+a_2x)$ is found.
I have just taken these at fact for now so that I can actually answer the question, but I would like to understand how I can arrive at these solutions myself.
One last thing, I have the solution of:
$y(x)=\frac{x^2}{4}-\frac{x}{4}+c_1e^{-2x}+c_2$
Using the fact that $y(0)=1$, I have found that $c_1+c_2=1$. Can I use this in $y(x)$ or not?
 A: The characteristic equation comes from substituting $y=e^{rx}$ into the homogenous form of your differential equation:
$y''+2y'= 0 \rightarrow r^2e^{rx}+2re^{rx}=0$ Since the equation is homogenous (right hand side = 0), you can divide out the common $e^{rx}$ and you are left with your characteristic equation. You need to find the values of $r$ that make the equation come out to 0. That's where the characteristic equation comes from. It gives you the complementary solutions (i.e., $y_c$). You need to add a particular solution ($y_p$) to get a complete solution. There is no one method of finding $y_p$. For simple functions like you have, you can use use the method of undetermined coefficients on a power series (i.e., use $y=\sum\limits_{i=1}^{\infty} a_ix^i$), do the formal differentiation on the series and equate like terms (or recognize that you only need a second order polynomial, and make things simpler). Other RHS functions require different methods. It's all very.....particular ;-)
As for your solution, a second order diffeq needs two boundary conditions, you have one. So you cannot find the values for your coefficients.
A: You found the two roots of the complementary solution, which provide two independent solutions to the DEQ. We have:
$$y_c(x) = c_1 e^{-2 x} + c_2 e^{0 x} = c_1 e^{-2 x} + c_2 = y_1(x) + y_2(x)$$
For the particular solution, since we have an $x$ on the RHS and a $c_2$ as one of our complementary solutions, we need to guess at a $y_p$ that accounts for it, so we choose
$$y_p(x) = x( a + b x)$$
We now substitute this back into the DEQ and solve for the constants.
Since this is a second order DEQ, you need two initial conditions to solve for $c_1$ and $c_2$.
A: Regarding the complementary solution, for a second order equation there will generally be two solutions to the characteristic equation, in your case $r_1 = -2$ and $r_2 = 0$.
In general the complementary function is then $y_c(x) = c_1 e^{r_1 x} + c_2 e^{r_2 x}$.
There's no trick to finding this it's just because it works if you plug this in generally, it's just something you have to memorize (or use Laplace transforms).
In your case you have $y_c(x) = c_1 e^{-2 x} + c_2 e^{0 x} = c_1 e^{-2 x} + c_2$.
Regarding the particular solution we are trying to get $x$ on the RHS so, since the left side contains only derivatives, we should guess a second degree polynomial: $ax^2 + bx + c$.
Then plugging this into the ODE gives
$$
2a + 2(2ax + b) = x \\
4ax + 2a + 2b = x
$$
So $4a=1$ and $2a+2b = 0$, which implies that $a=1/4$ and $b=-1/4$.
Since it just goes away when the derivatives are taken, it doesn't matter what $c$, i.e. it can be any constant.
This constant will just combine with the constant from the general solution once the solutions are combine to be a single constant ($c_2$ in your final solution above).
Regarding the last part about the constants, you can eliminate one of the constants and have it in terms of the other (e.g. $c_2 = 1 - c_1$) but you will always have one constant.
The reason is that this is a second order ODE so there must be two initial value (or other) conditions for the solution to be fully specific with no constants.
