# Nonhomogeneous Linear O.D.E

I found this question and I cannot seem to answer it correctly and its kinda bothering. I am not seeing what I am not getting right with this particular problem. I took the same route as the OP and found the individual particular solutions of the RHS and added them together as a linear combination but to my surprise, get something totally different. Can someone look at this and let me know what I may be doing wrong.

Original question is linked here: Solving Diff. Eq.

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {\textbf{Method of Undetermined Coefficients}}$

${\bf{SOLUTION:}}$

$y(x)=y_{h}~+~y_{p}$

${\text{Differential Equation:}}~~~~~~~~~~~~~~~~~$ $y^{(5)}+2y^{(3)}+y'=2x+\sin(x)+\cos(x)$.

${\text{Homogeneous Case:}}~~~~~~~~~~~~~~~~~~~~$ $y^{(5)}+2y^{(3)}+y'=0$.

${\text{Characteristic Polynomial:}}~~~~~~~~~$ $r^5+2r^3+r=0$.

${\text{Solved Roots of polynomial:}}~~~~~~$ $\bigg[\{r\rightarrow 0\},\; \{r\rightarrow -i\},\; \{r\rightarrow -i\},\; \{r\rightarrow i\},\; \{r\rightarrow i\}\bigg]$

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$

$${\text{General Form of the Homogeneous Solution}}$$

$$y_{h}(x)=C_{1}e^{r_{1}x}+e^{ax}\Big(C_{2}\cos(bx)+C_{3}\sin(bx)+C_{4}x\cos(bx)+C_{5}x\sin(bx) \Big)$$

$${\text{Homogeneous Solution to the Differential Equation}}$$ $$y_{h}(x)=C_{1}+C_{2}\cos(x)-C_{3}\sin(x)+C_{4}x\cos(x)-C_{5}\sin(x);~~\Big(~\because \sin(-x)=-\sin(x)~\Big).$$

Now we shall seek a particular solution.

${\text{Non-Homogeneous Case:}}~~~~~~~~~~~~~~~~$ $y^{(5)}+2y^{(3)}+y'=2x$
$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$

$$f(x)=2x$$

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$Let,

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{array}{llll} y_{p}(x)=Ax+b \\ y_{p}'(x)=A \\ y_{p}''(x)=0 \\ y_{p}^{(3)}(x)=0 \\ y_{p}^{(4)}(x)=0 \\ y_{p}^{(5)}(x)=0 \end{array}$

Substituting derivatives into differential equation:

$(0)+2(0)+(A)=2x$.

After equating the undetermined coefficient ${\underline{A}}$ we get:

$\begin{array}{l} A=~0 \end{array}$

Making our particular solution to become,

$$y_{p}(x)=0.$$

(2)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~y^{(5)}+2y^{(3)}+y'=\sin(x)$ $~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$

$$f(x)=\sin(x)$$

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$Let,

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{array}{llll} y_{p}(x)=A\sin(x)+B\cos(x) \\ y_{p}'(x)=A\cos(x)-B\sin(x) \\ y_{p}''(x)=-A\sin(x)-B\cos(x) \\ y_{p}^{(3)}(x)=-A\cos(x)+B\sin(x) \\ y_{p}^{(4)}(x)=A\sin(x)+B\cos(x) \\ y_{p}^{(5)}(x)=A\cos(x)-B\sin(x) \end{array}$

Substituting derivatives into differential equation:

$A\cos(x)-B\sin(x)+2\Big(-A\cos(x)+B\sin(x)\Big)+\Big(A\cos(x)-B\sin(x)\Big)=\sin(x)$.

After equating the undetermined coefficients ${\underline{A}}$ and ${\underline{B}}$ we get:

$\begin{array}{l} A=~0 \\ 0\cdot B=1~~ ????~~ {\text{Huh}} \end{array}$

Making our particular solution to become,

$$y_{p}(x)=0~~??$$

I guessed it will be the same situation for the $\cos(x)$ on the RHS when finding the particular solution, though I could be missing an important fact.

Thanks.

-

Because $\sin(x)$ and $\cos(x)$ solve the homogeneous equation, you don't try solutions $y_p(x) = A\cos(x) + B\sin(x)$ when the right hand side is a multiple of $\sin(x)$ or $\cos(x)$.
Instead, you count the multiplicity $m$ of the root $i$ of the characteristic polynomial $r(r+i)^2(r-i)^2$, in this case $2$, and use $$y_p(x) = Ax^m\cos(x) + Bx^m\sin(x) = Ax^2\cos(x) + Bx^2\sin(x)$$ The calculations might be annoying but you'll eventually be able to solve for $A$ and $B$.
Another thing you can do is try $y_p(x) = Ax^2e^{ix}$, and solve for $A$. The real part of this will give the particular solution for $\cos(x)$ on the right-hand side, and the imaginary part will give the particular solution for $\sin(x)$. The calculations will likely be a lot easier. Note $A$ will be a complex number this time.
Thanks Zarrax for the detailed info. Is this some special case of D.E. or sprecial evaluating technique or is it just when you have multiples of $\cos(x)$ and $sin(x)$ on the RHS? I remember doing something similar with Euler Cauchy equations. – night owl Jul 4 '11 at 17:24
It can be used whenever you have a right-hand side of the form $p(x)e^{ax}$ where $p(x)$ is a polynomial and $a$ is any number, real or complex. If $p(x)$ is of degree $n$ and $a$ is a root of the characteristic polynomial of multiplicity $m \geq 0$, you can try $y_p(x) = q(x)x^me^{ax}$ where $q(x)$ is a polynomial of degree $n$ with undetermined coefficients which you solve for after plugging it in to the equation. In your case $a = i$, $m = 2$, and $n= 0$. This method shows up in various Diff Eqns textbooks. – Zarrax Jul 4 '11 at 17:32