I am having trouble solving the third order differential equation
$y'''+y'=0$
It was given to me in a quiz (which I got wrong) with boundary conditions
$y(0) = 0$
$y'(0)=2$
$y(\pi)=6$
I know that the obvious trial solution is $y=Ae^{rx}$ but I kind of get stuck after here. I have seen in many solutions to other problems when there are complex roots of the complementary equation that this can be expressed as a combination of sine and cosine (I imagine using Euler's Formula). Is that what happens here?
$\endgroup$ 13 Answers
$\begingroup$Let's see:
If $y=e^{rx}$, then the Chain Rule tells us that $y' = re^{rx}$ and $y''' = r^3e^{rx}$.
If $y$ is a solution, that means $y'''+y'=0$.
In other words, $r^3e^{rx} + re^{rx}=0$
If you factor, you find that $(r^3+r)e^{rx}=0$. This happens when the (characteristic) polynomial $p(r) = r^3+r = r(r^2+1)$ has roots: $r = 0,i,-i$.
From here you know that each of $y_1=e^{0x}=1$, $y_2=e^{ix}$, $y_3=e^{-ix}$ are solutions.
Alternatively, using Euler's Identity, the real valued functions $y_1=e^{0x}=1$, $y_2=\sin(x)$, $y_3=\cos(x)$ are solutions.
Using linearity, the general (real valued) solution takes the form $$y = A + B\sin(x) + C\cos(x)$$
You should be able to use the boundary conditions now to solve for the $A, B, C$.
$\endgroup$ $\begingroup$Set $z=y'$ and so $z''+z=0$ whose general solution is $z(t)=A\cos{t}+B\sin{t}$. One has that $y$ is an antidervative of $z$ so $z(t)=A\sin{t}-B\cos{t}+C$ and now we can plug the boundary conditions
$$\begin{align} -B+C&=0\\A&=2\\B+C&=6\end{align}$$
And our solution is
$$z(t)=2\sin{t}-3\cos{t}+3$$
$\endgroup$ $\begingroup$Your trial solution should be $y=\mathrm e^{rx}$, you don't need the $A$.
Using this, we see that $y'''+y'=0 \iff (r^3+r)\mathrm e^{rx} = 0$.
Since $\mathrm e^{rx} \neq 0$, we conclude that $r^3+r=0$, i.e. $r(r^2+1)=0$.
This gives $r=0,\pm \mathrm i$ as solutions and so $y = \mathrm e^0, \mathrm e^{\pm i x}$.
The general solution will be a linear combination of these:
$$y= A + B\mathrm e^{+\mathrm ix} + C \mathrm e^{-\mathrm ix}$$
We can, as you say, use Euler's formula $\mathrm e^{\mathrm ix} = \cos x + \mathrm i \sin x$ to give
$$y = A + (B+C)\cos x + \mathrm i (B-C) \sin x$$
We can the relabel the constants $B+C$ and $\mathrm i (B-C)$ as $\tilde B$ and $\tilde C$ to give your final (general) solution is then $y = A + \tilde B\cos x + \tilde C\sin x$.
Now apply the initial conditions to get $A$, $\tilde B$ and $\tilde C$.
$\endgroup$