# Differential Equations - complementary function

## Homework Statement

y'' - 4y = -4e^x

a) find the complementary function
b) find the particular integral
c) write down the solution, given y(0) = 2 and y'(0) = 0

2. The attempt at a solution

Yesterday I learned how to do simpler differential equations of the form y'' + ay' + by = 0.
I Tried some others this morning and solved them quite happily without using any reference material.

Here is what I have so far for this problem, I'm quite sure I'm going about it the wrong way:

y(x)=e^rx
y''(x)=r^2*e^rx
r^2*e^rx - 4e^rx = -4e^x

This seemed to be the the most straightforward way to determine r. Next I factorised the left hand side and divided through by e^x as follows:

(r^2 - 4)e^rx = -4e^x
(r^2 - 4)e^r = -4

I am unsure where to go from there. Would I take the natural logarithm? It's been a long time since I've used logs so if that is the correct way to find r I'd be grateful if somebody took me through it. I'm still not quite clear on what exactly is meant by the particular integral, if someone could show me this too it would be very helpful. Thanks in advance.

Related Calculus and Beyond Homework Help News on Phys.org
Defennder
Homework Helper
First do you know what "complementary function" and "particular integral" means? Because I don't.

Wikipedia has this to say:
The case where f = 0 is called a homogeneous equation and its solutions are called complementary functions. It is particularly important to the solution of the general case, since any complementary function can be added to a solution of the inhomogeneous equation to give another solution (by a method traditionally called particular integral and complementary function).

Defennder
Homework Helper
Oh I see. Well for such problems you have to find the homogenous solution first. Solve for the case where the RHS=0.

For the particular integral, there are a number of ways to find it. The method which works almost every time is variation of parameters. Have you learnt that yet?

Last edited:
dx
Homework Helper
Gold Member
Gwilim, any linear combination of derivatives of $$e^{rx}$$ will be of the form $$Ae^{rx}$$. But the exponent of $$e$$ on the right side is just $$x$$, not $$rx$$. Can you see now what function you should try for the particular integral?

Oh I see. Well for such problems you have to find the homogenous solution first. Solve for the case where the RHS=0.

For the particular integral, there are a number of ways to find it. The method which works almost every time is variation of parameters. Have you learnt that yet?
Okay, so r^2 - 4 = 0 => r = 2 or -2, so the complementary function is e^2x + e^(-2x)

I don't know the variation of parameters method, can you provide a link to a page explaining this or give a brief explanation yourself?

Gwilim, any linear combination of derivatives of $$e^{rx}$$ will be of the form $$Ae^{rx}$$. But the exponent of $$e$$ on the right side is just $$x$$, not $$rx$$. Can you see now what function you should try for the particular integral?
The exponent of e in right side of all the equations in the (incorrect) workings I gave was x, rather than rx. Have I misunderstood your reply?

dx
Homework Helper
Gold Member
You included the right hand side in your calculation, so I assume youre trying to find the particular integral. In that case, yes you misunderstood my reply. I was saying that the function you tried for the particular integral doesnt have the correct form.

If you were trying to find the complementary function, then you shouldnt have the right hand side in the equation. The complementary function is a solution to the equation y'' - 4y = 0.

Defennder
Homework Helper
Okay, so r^2 - 4 = 0 => r = 2 or -2, so the complementary function is e^2x + e^(-2x)

I don't know the variation of parameters method, can you provide a link to a page explaining this or give a brief explanation yourself?
Try this:
http://www.sosmath.com/diffeq/second/variation/variation.html

You don't have to use the method of variation of parameters if the RHS is an expression of the form which can be 'guessed' using the method of undetermined coefficients.
http://www.sosmath.com/diffeq/second/guessing/guessing.html

lurflurf
Homework Helper
y'' - 4y = -4e^x

QUOTE]
so we have in operator notation
(D^2-4)y=-4exp(x)
we reduce to a homogeneous equation by knowing
(D-1)[-4exp(x)]
so
(D-1)(D^2-4)y=(D-a)[-4exp(x)]=0
(D-1)(D^2-4)y=0
thus
y={1/[(D-1)(D^2-4)]}0
(note we have used the fact that the operators commute)
our solution will have a free parameter because multiplication by (D-1) introduces it
specify the free parameter by substidution into the original equation

also if (D-1) and (D^2-4) are relatively prime
{1/[(D-1)]}0 will be the form a particular solution
and
{1/[(D^2-4]}0 will be the form of a complementary solution

re

y(x)=e^rx
y''(x)=r^2*e^rx
r^2*e^rx - 4e^rx = -4e^x
this will not work out
most likely r!=1 thus there will be no solution
even if r=1 higher order terms will be needed
(r^2 - 4)e^rx = -4e^x
(r^2 - 4)e^r = -4
this is incorect e^(rx)/e^x=e^[(r-1)x]!=e^r

I will sum up the usual process
solve
p(D)y=f(x)
where there exist
q(D)f(x)=0
find a q(D)

solve
q(D)p(D)y=0
decompose y=u+v where
p(D)u=0
v=y-u
compute p(D)v
find particular v

perhaps
solve
(D-1)(D-2)y=11exp(3x)
we note that
(D-3)[11*exp(3x)]=0
solve
(D-3)(D-1)(D-2)y=0
y=a*exp(x)+b*exp(2x)+c*exp(3x)
we see that
(D-1)(D-2)[a*exp(x)+b*exp(2x)]=0
solve
(D-1)(D-2)[c*exp(3x)]=11*exp(3x)
(3-1)(3-2)c*exp(3x)=11*exp(3x)
2c=11
c=11/2
y=a*exp(x)+b*exp(2x)+(11/2)*exp(3x)
the care to not merely seperate into two equations is that if the two operators are not realatively prime we will fail consider
(D-1)y=54*exp(x)
(D-1)(D-1)y=0
solving (D-1) twice fails we must solve (D-1)^2
y=(a+b*x)*exp(x)
(D-1)(a+b*x)*exp(x)=54*exp(x)
b=54
y=(a+54x)*exp(x)

tiny-tim
Homework Helper
… I'm quite sure I'm going about it the wrong way:

y(x)=e^rx
Hi Gwilim! The particular solution usually has no connection whatever with the complementary solution.

I was never much good at particular solutions, but I vaguely recall that one just makes intelligent guesses … in this case (only), it seems obvious to me that the p.s. must be a polynomial times the RHS … which of course is the way lurflurf has shown you. Generally, in future problems, get the c.s first … then forget it and start again … make an intelligent guess for the p.s., and keep plugging away.