# Help with $y'' + ay'+ by= h(x)$ and finding solutions.

I need help with the equation $y'' + ay'+ by= h(x)$ and how to find certain solutions to it.

My mathbook state:

That if $h(x) = constant$

we can see that $y'' + ay'+ by = c$

and that:

(a) if $b \neq 0$ then $y = \frac{c}{b}$ is a solution.

(b) $b = 0, a \neq 0$ then $y = \frac{c}{a}x$ is a solution.

(c) $b = a = 0$then $y = \frac{c}{2}x^2$ is a solution.

Can somebody please explain to me how they arrive at these solutions and what their line of thinking is? That would make my day :)

Thank you!

-
Plug in those solutions into your equation and see if they are solutions. –  diimension Nov 26 '12 at 21:02
Maybe this is relevant. –  Ian Nov 26 '12 at 21:06

For your first equation, $y''+ay'+by=c$ with $b\ne 0$, we know that if $y$ is a polynomial, that it must be constant. If it had any higher degree, then there would be a non-constant term on the LHS, which does not make sense. Does it make more sense now?

-
Makes a lot of sense! Thank you for the answer! –  Lukas Arvidsson Nov 26 '12 at 21:11

One approach we can take to actually find (and not simply check) solutions to equations like this is the method known as Variation of Parameters. (Some knowledge of linear algebra may be required for full understanding of what's going on.) Since your various terms are either constants, $y$, or some derivative of $y$, this is less difficult than it might otherwise be. Let me work through some alternate approaches, as well. (The $b\neq 0$ case is most complicated, so I'll save it for last.)

Case 2: $b=0$, $a\neq 0$.

First, put $u=y'$, so that we can rewrite our equation as $$u'+au=c.$$ Ideally, we'd like to deal with an equivalent equation such that both sides are just first derivatives of some functions, so that we can just integrate and go from there. To do this, we'll use what's called an integrating factor. Observe that $e^{ax}$ is a positive function, so multiplying that on both sides gives us the equivalent equation $$e^{ax}u'+ae^{ax}u=ce^{ax}.$$ Observe that we can rewrite this as $$\left(e^{ax}u\right)'=ce^{ax}.$$ [Hint: Product rule.] Integrating both sides with respect to $x$ then gives us $$e^{ax}u=\frac{c}{a}e^{ax}+C_1,$$ where the constant $C_1$ is there because we're taking an indefinite integral. Thus, $$u=\frac{c}{a}+C_1e^{-ax},$$ which means that $$y'=\frac{c}{a}+C_1e^{-ax}.$$ Integrating again with respect to $x$ then gives us $$y=\frac{c}{a}x-\frac{C_1}{a}e^{-ax}+C_2,$$ which is the general form of the solution to the equation $$y''+ay'=c$$ for $a\neq 0$ and $c$ some constant. The solution that your book gave you to check certainly has this form, with $C_1=C_2=0$.

Case 3: $b=a=0$.

Here, we'll start out in the same way as Case 2, by putting $u=y'$, so the equation becomes $$u'=c.$$ There's no need for an integrating factor to clean this up, so we immediately integrate with respect to $x$, getting $$y'=u=cx+C_1,$$ whence another integration with respect to $x$ gives us $$y=\frac{c}{2}x^2+C_1x+C_2$$ as the general form of the solution to $$y''=c.$$ The solution your book gave you to check once again is of the appropriate form, with $C_1=C_2=0$.

Case 1: $b\neq 0$.

We'll start by seeing if there is a polynomial solution to the differential equation. Let $p(x)=\sum_{k=0}^nd_kx^k$ (since we're dealing with second order derivatives, let's assume that $n\geq 2$ so we have enough parameters $d_k$ to play with). Then $y=p(x)$ is a solution if and only if \begin{align}c &= \frac{d^2}{dx^2}\left(\sum_{k=0}^nd_kx^k\right)+a\frac{d}{dx}\left(\sum_{k=0}^nd_kx^k\right)+b\sum_{k=0}^nd_kx^k\\ &= \sum_{k=2}^nk(k-1)d_kx^{k-2}+\sum_{k=1}^nakd_kx^{k-1}+\sum_{k=0}^nbd_kx^k\\ &= \sum_{k=0}^{n-2}(k+2)(k+1)d_{k+2}x^k+\sum_{k=0}^{n-1}a(k+1)d_{k+1}x^k+\sum_{k=0}^nbd_kx^k\\ &= \sum_{k=0}^{n-2}\left[bd_k+a(k+1)d_{k+1}+(k+2)(k+1)d_{k+2}\right]x^k+\left(bd_{n-1}+and_n\right)x^{n-1}+bd_nx^n.\end{align}

Since $b\neq 0$, then we can divide through by $b$ to get an equivalent chain of equations. Thus, $y=p(x)$ is a solution to the given differential equation if and only if $$\frac{c}{b}=\sum_{k=0}^{n-2}\left[d_k+\frac{a(k+1)}{b}d_{k+1}+\frac{(k+2)(k+1)}{b}d_{k+2}\right]x^k+\left(d_{n-1}+\frac{an}{b}d_n\right)x^{n-1}+d_nx^n.$$

Now, since polynomials in $x$ are equal if and only if their coefficients match, then we can conclude that $y=p(x)$ is a solution to the given differential equation if and only if the following system of $n+1$ linear equations is satisfied: \begin{align}\frac{c}{b} &= d_0+\frac{a}{b}d_1+\frac{2}{b}d_2\\0 &= d_1+\frac{2a}{b}d_2+\frac{6}{b}d_3\\ &\:\vdots\\0 &= d_k+\frac{a(k+1)}{b}d_{k+1}+\frac{(k+2)(k+1)}{b}d_{k+2}\\ &\:\vdots\\0 &= d_{n-2}+\frac{a(n-1)}{b}d_{n-1}+\frac{n(n-1)}{b}d_{n}\\0 &= d_{n-1}+\frac{an}{b}d_n\\0 &= d_n\end{align}

The last equation tells us that $d_n=0$, and back-substitution into the second-to-last equation tells us that $d_{n-1}=0$. Continuing this pattern of back-substitution up the list of equations, we find that all of $d_n,d_{n-1},...,d_1=0$, and that $d_0=\frac{c}{b}$. In other words, the only polynomial solution to the given differential equation is the constant polynomial $\frac{c}{b}$--this, of course, is the solution that your book gave you to check.

Now, note that if $f(x)$ is any solution to $y''+ay'+by=0$, then setting $y(x)=f(x)+\frac{c}{b}$ gives us $$y''+ay'+by=f''(x)+af'(x)+bf(x)+b\cdot\frac{c}{b}=c.$$ On the other hand, if $g(x)$ is any solution to $y''+ay'+by=c$, then setting $y(x)=g(x)-\frac{c}{b}$ gives us $$y''+ay'+by=g''(x)+ag'(x)+bg(x)-b\cdot\frac{c}{b}=c-c=0.$$ This gives us a correspondence between the solutions to the given differential equation and its homogeneous counterpart $y''+ay'+by=0$. In particular, if we can find the general solution to $y''+ay'+by=0$, then we'll simply add $\frac{c}{b}$ to that to get the general solution to the given differential equation.

Note that since $b\neq 0$, then there exist constants $t_1,t_2$ such that $a=t_1+t_2$ and $b=t_1t_2.$ In particular, $t_1$ and $t_2$ will be the (possibly equal) solutions to the quadratic $t^2+at+b=0$.) Then $$y''+ay'+by=y''+t_1y'+t_2y'+t_1t_2y=(y'+t_2y)'+t_1(y'+t_2y),$$ so letting $u=y'+t_2y$, our homogeneous equation becomes $$u'+t_1u=0.$$ Proceeding in much the same way as in Case 2, we'll use the integrating factor $e^{t_1x}$ to determine that $$u=C_1e^{-t_1x}$$ for some constant $C_1$, meaning $$y'+t_2y=C_1e^{-t_1x}.$$ Now, we'll do the same kind of thing, using the integrating factor $e^{t_2x},$ so $$\left(e^{t_2x}y\right)'=e^{t_2x}y'+t_2e^{t_2x}y=e^{t_2x}(y'+t_2y)=e^{t_2x}\cdot C_1e^{-t_1x}=C_1e^{(t_2-t_1)x}.$$ This gives us $$e^{t_2x}y=\begin{cases}\frac{C_1}{t_2-t_1}e^{(t_2-t_1)x}+C_2 & t_1\neq t_2\\C_1x+C_2 & t_1=t_2\end{cases}$$ for some constant $C_2$, and so $$y=\begin{cases}\frac{C_1}{t_2-t_1}e^{-t_1x}+C_2e^{-t_2x} & t_1\neq t_2\\(C_1x+C_2)e^{-t_2x} & t_1=t_2.\end{cases}$$ In the former case, $C_1$ is an arbitrary constant, and $t_2-t_1$ is a nonzero constant, so we may as well allow $C_1$ to "absorb" the $t_2-t_1$. Thus, our general solution to the homogeneous equation is $$y=\begin{cases}C_1e^{-t_1x}+C_2e^{-t_2x} & t_1\neq t_2\\(C_1x+C_2)e^{-t_2x} & t_1=t_2,\end{cases}$$ and so the general solution to the given differential equation is $$y=\begin{cases}C_1e^{-t_1x}+C_2e^{-t_2x}+\frac{c}{b} & t_1\neq t_2\\(C_1x+C_2)e^{-t_2x}+\frac{c}{b} & t_1=t_2,\end{cases}$$ where $t_1,t_2$ are as described above.

-
(+1) For the thourough explanation :) –  Pragabhava Nov 27 '12 at 2:12
Thank you Cameron for the Great explanation! Very much appreciated! –  Lukas Arvidsson Dec 9 '12 at 16:57
You're quite welcome, @Lukas. –  Cameron Buie Dec 9 '12 at 17:09

You have $y'' + ay'+ by = c$ and the conditions are:

• if $b \neq 0$ then $y = \frac{c}{b}$ is a solution: Lets plug this in into our second order differential equation. We get:

$$(\frac{c}{b})'' + a(\frac{c}{b})'+ b(\frac{c}{b}) = c$$

• Since $\frac{c}{b}$ is just a constant you get $c = c$ which is a solution.

Now do that same method with your other two solutions. Let me know if you still do not understand it.

-
I think Lukas wanted to know how the answer was arrived at, not that it works. –  Daniel Littlewood Nov 26 '12 at 21:12
Thank you for your answer! I understand that the solutions are solutions. But what was hard was how to see that they are a solution before "plugging" them in. The book writes it like it is these solutions are "obvious". –  Lukas Arvidsson Nov 26 '12 at 21:12
@DanielLittlewood oops! And Lukas, my bad. Daniel's answer is very good actually. –  diimension Nov 26 '12 at 21:16

I think the study of differential equations is notorious (at least at an undergraduate level) for being filled with 'divine inspiration' - ie. there are many things involved that were discovered hundreds of years ago by mathematical greats that are given and which you are not expected to derive yourself but simply to take for granted. I too found this frustrating.

Really, what it amounts to is solution by inspection (it's unfortunate schools don't try and have students do this themselves...). Given the equation, you think to yourself, "what could I possibly put in here to make this true?" For some forms of differential equations (particularly linear ones), this type of reasoning can get you very far. Consider how the derivative operator affects different functions, and try to piece together what kind of function would work.

In your example, say for b not=0, we know that, if the RHS is constant, then so must be the left. We know that the derrivative of a constant is 0, so the y'' and y' terms vanish, so its feasible that we can find a constant k that will work as a solution, ie. y = k. Plugging in y = k and rearranging, we find k = c/b.

For b=a=0, we think "okay, so now the second derrivative of my function y must give me a constant.' Well, what kind of functions have second derrivatives that are constant? clearly, quadratics. So we assume something like y = kx^2, plug in, and again solve for k.

Starting to make sense? Try thinking about y' = ky . What kind of function y satisfies this - ie. what kind of function has a derivative that is proportional to itself?

This is really the type of reasoning that is used to build up much of the framework for studying the solutions to ODEs.

-

This seems to concern the particular solution for such problems. If you assume $y$ equals some constant $k$, the first, second, and any higher derivatives are all $0$. The solution then becomes algebra: $bk=c,k=\frac cb$.

For the second case, make the substitution $z=y'$, leaving you with $z'+az=c$. The same logic yields that $z=y'=\frac ca$ is a solution, or $y=\frac{cx}a$.

If $a$ and $b$ are both $0$, you can just integrate twice to find the general solution immediately, the particular solution of which is $\frac{cx^2}2$.

-