Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose $y''-4y=xe^{2x}$.

Solution of the homogenous equation is $y_H(x) = C_{1} e^{2x} + C_{2} e^{-2}$, after solving the characteristic equation with the guess $y=e^{rx}$.

Now my instructor insists that the one solution is either

$y(x) = Ax^{2} e^{2x} + Bxe^{2x}$


$y(x) = Ax^{2}e^{2x} + Bxe^{2x}+Ce^{2x}$

...and then I get the solution $y(x) = y_{H}(x) +\frac{1}{8}x^{2}e^{2x}-\frac{1}{16}xe^{2x}$

but I cannot understand the choices. Why do just the forms work? I have tried many different forms there and get lost/wasted a lot time -- and my instructor just says that it is a "guess" and smiles. How can I find the one solution without guessing? For one solution, things such as $y(x)=e^{2x}$ or $y(x)=xe^{2x}$ work so I am a bit lost why the more complex form is "the solution" and why it provides all solutions.

For example, the case $y=e^{2x}$. We get $y'=2e^{2x}$ and $y''=4e^{2x}$ so

$y''-4y = 4e^{2x} - 4 e^{2x} = 0$

so $RHS = xe^{2x} = 0$ so $x=0$, a solution?! If not why? Ok it is naive, it does not contain all cases but how can I know that some form contains all?

share|cite|improve this question
At the "guess" level, $Bxe^{2x}+Ce^{2x}$ is very reasonable. And it would work nicely, with anything other than $-4y$, like $-3y$, or $7y$. But substituting the "guess" in $y''-4y$ shows that the $-4y$ makes the $xe^{2x}$ term disappear. Now maybe one realizes that if you add $Ax^2e^{2x}$ to the guess, and calculate $y''-4y$, the $x^2e^{2x}$ term will similarly disappear, which now is a good thing! (As you can imagine, there is also general theory available, but playing around and paying attention to structure works well in this case.) – André Nicolas May 14 '11 at 19:47
@ahh: What is now at the end of the post is not right, and seems to show a misunderstanding of the process. You want a "guess" $y$ such that $y'' -4y$ is identically equal to $xe^{2x}$, that is, equal for all $x$. The "solving" for $x$ that you did is totally irrelevant, has nothing to do with the question. You want a "guess" $y$ such that $y'' -4y$, when simplified, is $xe^{2x}$. – André Nicolas May 14 '11 at 19:56
@user6312: sorry I don't follow. (x^{2}e^{2x})' = 2xe^{2x} + 2x^{2}e^{2x}$ and $(x^{2}e^{2x}) = 6xe^{2x} + 4x^{2}e^{2x} + 2e^{2x}$ -- I get just more terms, nothing really disappearing?! If there is, how can you see it so quickly? – hhh May 14 '11 at 19:58
the solution to your non-homogeneous equation should be looked on those of the form $Ap(x)e^{rx}$ if $r$ is not a solution to your characteristic polynomial. Unfortunately, 2 is; so you should look for a solution of the form $Ax^qp(x)e^{rx}$, where $q$ is the multiplicity of your root r. (Adding of course the one to the homogeneous equation) – Andy May 14 '11 at 21:12
755 views but only one up vote? – user66360 Dec 15 '13 at 17:40
up vote 2 down vote accepted

Another way to do this is using the Exponential Shift Theorem (see e.g. For any polynomial $P$, constant $k$ and function $u$, $P(D) e^{kx} u = \exp(k x) P(D+k) u$ (where $D$ stands for derivative). In your case $P(t) = t^2 - 4$, $k=2$, and $P(t+2) = (t+2)^2 - 4 = t^2 + 4 t$ so if $y = e^{2x} u$ we have $y'' - 4 y = e^{2x} (u'' + 4 u')$. Now you want $y'' - 4 y = x e^{2x}$ so $u'' + 4 u' = x$. Writing $v = u'$, we have the first-order linear equation in $v$: $v' + 4 v = x$, which has a solution $v = \frac{x}{4} - \frac{1}{16}$. An antiderivative of this is $u = \frac{x^2}{8} - \frac{x}{16}$, corresponding to the particular solution $y = e^{2x} \left(\frac{x^2}{8} - \frac{x}{16}\right)$ of your original equation.

share|cite|improve this answer
I am stuck to this point in the example on the site "We have $y=e^{-x}u$. We have $P(D-1)u = D^{2}u = 4$, so one solution is $u=2x^{2}$.", not evident to me. When I calculated it open, I got $(D+1)^{2}=4e^{-x} \rightarrow (D+1)^{2}e^{x}=4$ and then by the theorem, let $P(D)=(D+1)^{2}$, $P(D)e^{x}=e^{x}P(D+1)=e^{x}(D+2)^{2}$ but $P(D)e^{x} = 4$. Did I do s/thing wrong or can I still get to the general solution? – hhh May 15 '11 at 17:25
The example was $y'' + 2 y' + y = 4 e^{-x}$. Thus $P(t) = t^2 + 2 t + 1 = (t+1)^2$. Since $e^{-x}$ is on the right side, we take $k=-1$. Now $P(t-1) = (t-1+1)^2 = t^2$. So take $y = e^{-x} u$, and the theorem says $P(D) y = e^{-x} P(D-1) u = e^{-x} D^2 u$. We want this to be $4 e^{-x}$, so $D^2 u = 4$. – Robert Israel May 15 '11 at 18:42
When the solutions $xe^{-x}$, $e^{-x}$ and $2x^{2}e^{-x}$ are known, how do you know that the general solution is just their sum $y_{G} = 2C_{1}x^{2}e^{-x}+C_{2}xe^{-x}+C_{3}e^{-x}$? – hhh May 15 '11 at 19:33
From $D^2 u = 4$, integrate once to get $D u = 4 x + C_1$, then integrate again to get $u = 2 x^2 + C_1 x + C_0$, where $C_1$ and $C_0$ are arbitrary constants. – Robert Israel May 16 '11 at 4:11

I believe this can be done without guesswork.

One way to get this mechanically is to use the method of Laplace Transforms.

Of course, I haven't tried out it out myself, but given that

$$\mathcal{L}[t^n e^{at}] = \frac{n!}{(s-a)^{n+1}}$$

I believe the approach will work for your problem.

share|cite|improve this answer
...but does that return all solutions if you take the laplace transform and then the inverse? – hhh May 15 '11 at 10:20
@hhh: I believe it does. Why do you think it might not? – Aryabhata May 15 '11 at 14:31

The "right" approach is highly context-dependent. What follows is from the perspective of an introduction to differential equations attached to a first-year calculus course.

We describe an informal procedure, in which we make a plausible guess as to $y$, and test how well the guess works by calculating $y''-4y$ for this guess. We then use the information obtained from the calculation of $y''-4y$ to improve our guess. Of course more formal procedures are available, but it is nice to see how far one can get by playing a little.

A very reasonable "guess" for a particular solution is $y=xe^{2x}$. Let's check whether it works. If $y=xe^{2x}$, then $y'=2xe^{2x}+e^{2x}$, and $y''=4xe^{2x}+4e^{2x}$. Then $$y''-4y=4e^{2x}$$

But $4e^{2x}$ is definitely not the same function as $xe^{2x}$. And multiplying the guess $xe^{2x}$ by a constant $k$ will do nothing useful.

Note that things would have worked out nicely if the differential equation had, for example, $y''-3y$ on the left instead of $y''-4y$. But the $-4y$ is exactly the right thing to make the $xe^{2x}$ term disappear. When the person posing the problem chose $-4$, (s)he chose the only constant that would make our lives difficult. Nasty!

However, this gives us an idea. If we try $y=x^2e^{2x}$, and calculate $y''-4y$, maybe the $x^2e^{2x}$ term will disappear, which is exactly what we want. Calculate. If $y=x^2e^{2x}$, then $y'=2x^2e^{2x}+ 2xe^{2x}$ and $y''=4x^2e^{2x}+8xe^{2x} +2e^{2x}$. Thus $$y''-4y=8xe^{2x} +2e^{2x}$$

Close! We should clearly multiply our guess by $(1/8)$ to get the $xe^{2x}$ term right. And we will not be quite there, since then there will still be an unwanted $(1/4)e^{2x}$ term in $y''-4y$ to get rid of.

Look back on the work we did at the beginning with $y=xe^{2x}$. Then $y''-4y$ turned out to be $4e^{2x}$. So to get rid of the unwanted $(1/4)e^{2x}$, we can simply add $(-1/16)xe^{2x}$ to the "guess" $(1/8)x^2e^{2x}$.

So we end up with the particular solution $$y =\frac{x^2e^{2x}}{8}-\frac{xe^{2x}}{16}$$

share|cite|improve this answer

Perhaps it would help to see the general method.

You want to solve an equation $Ly=x^n e^{\lambda x}$, where $L$ is a constant linear differential operator - in your case $Ly=y''-4y$. Let us solve $Ly=e^{(\lambda+\epsilon) x}$ instead: if we substitute $y=c(\epsilon)e^{(\lambda+\epsilon) x}$, we get $c(\epsilon)p(\lambda+\epsilon)=1$ (where $p$ is the characteristic polynomial of $L$, in your case $p(t)=t^2-4$), i.e. $c(\epsilon)=1/p(\lambda+\epsilon)$. We now expand $$L\frac{e^{(\lambda+\epsilon) x}}{p(\lambda+\epsilon)}=e^{(\lambda+\epsilon) x}$$ to a power series in $\epsilon$, look at the term at $\epsilon^n$, and get a solution of $Ly=x^n e^{\lambda x}/n!$.

In your case $\lambda=2$, $p(t)=t^2-4$, and $c(\epsilon)=1/(\epsilon(4+\epsilon))$. We thus get

$$L\bigl((\epsilon^{-1}4^{-1}+(4^{-1}x-4^{-2})+\epsilon(4^{-1}x^2/2-4^{-2}x+4^{-3}) +\dots )e^{2 x}\bigr)=$$ $$=(1+\epsilon x+\epsilon^2 x^2/2 +\dots)e^{2 x}.$$ Looking at the term at $\epsilon$, we get $$L((4^{-1}x^2/2-4^{-2}x+4^{-3})e^{2 x})=xe^{2 x},$$ i.e. $y=(4^{-1}x^2/2-4^{-2}x+4^{-3})e^{2 x}$ is a solution of your equation (we can drop $4^{-3}e^{2 x}$ from the solution, as it solves the homogeneous equation).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.