# Differential equation problem: y" + y' - 2y = x^2

• ChiralSuperfields
In summary: Many thanks!In summary, the solution to this problem is to find the coefficients of the given polynomial which makes the function on the left identically equal to the function on the right.
ChiralSuperfields
Homework Statement
Relevant Equations
For this,

The solution is,

However, why did they not move the x^2 to the left hand side to create the term ##(-2A - 1)x^2##? Is it possible to solve it this way?

Many thanks!

Yes you can solve it that way.
By subtracting the ## (1)x^2 ## from both sides, we have ## (0)x^2 ## on the RHS. Now equating coefficients we get:

## -2A - 1 = 0 ##
## -2A = 1 ##
## A = -1/2 ##

Just as in the given solution

ChiralSuperfields
YouAreAwesome said:
Yes you can solve it that way.
By subtracting the ## (1)x^2 ## from both sides, we have ## (0)x^2 ## on the RHS. Now equating coefficients we get:

## -2A - 1 = 0 ##
## -2A = 1 ##
## A = -1/2 ##

Just as in the given solution

Is there not a way of solving without comparing coefficients?

Many thanks!

ChiralSuperfields said:

Is there not a way of solving without comparing coefficients?

Many thanks!
There might be, but I don't know of it. With three unknowns ## A, B ## and ## C ## we usually need three equations to find their values. The only way to extract three equations from the given equation is to equate the three coefficients.

ChiralSuperfields
ChiralSuperfields said:
Is there not a way of solving without comparing coefficients?

Set $u = y' + 2y$. Then $$\begin{split} u' - u &= (y'' + 2y') - (y' + 2y) \\ &= y'' + y' - 2y \\&= x^2. \end{split}$$ This gives you two first order linear ODEs to solve.

(This works because $\lambda^2 + \lambda - 2 = (\lambda - 1)(\lambda + 2)$.)

chwala and ChiralSuperfields
ChiralSuperfields said:
However, why did they not move the ##x^2## to the left hand side to create the term ##(−2A−1)x^2##? Is it possible to solve it this way?
It has already been shown that it can be solved as you describe. As for why they didn't move the ##x^2## term to the left side, it's likely that they are setting the stage for talking about homogeneous vs. nonhomogeneous differential equations.

For the given problem, the homogeneous equation is ##y'' + y' - 2y = 0## for which the general solution is ##y = c_1e^{-2x} + c_2e^x##.

For the nonhomogeneous equation, (the equation above, but with an ##x^2## term on the right side), it turns out that a particular solution is ##y_p = Ax^2 + Bx + C##. What they've described in the solution is finding the coefficients of ##y_p## so that ##y_p'' + y_p' - 2y_p = x^2##.

Note that the term "homogeneous" has two different meanings as regards to differential equations. The meaning I'm using here is in DEs in which the left side consists of all terms involving the unknown function and its derivatives on the left side, with zero on the right side.

The usual terminology for a solution of the nonhomogeneous problem is "particular solution."

chwala and ChiralSuperfields
ChiralSuperfields said:

For this,
View attachment 325616
The solution is,
View attachment 325617
However, why did they not move the x^2 to the left hand side to create the term ##(-2A - 1)x^2##? Is it possible to solve it this way?

Many thanks!
The point here is that you are not solving some linear equation for the one value of ##x## which gives you equality. Neither are you solving a quadratic equation or an absolute value equation for the (possibly) two values of ##x## giving equality.

Here you are solving for the values of the coefficients which make the function (polynomial, in this case) on the left identically equal to the function on the right, for all values of ##x##.

ChiralSuperfields
You should be aware that you have "solved" the equation in the sense of finding some solutions. You have only found all the solutions of the form ##y = Ax^2+Bx+C##. But they are not all of the solutions of that differential equation. There are other solutions of a different form. Any solution of ##y''+y'-2y = 0## can also be added to the solutions you found and that function would also satisfy the equation.

vanhees71 and ChiralSuperfields
FactChecker said:
...
There are other solutions of a different form.
...
True enough, but the Problem Statement deals only with finding the coefficients of the given polynomial.

ChiralSuperfields and FactChecker
Ultimately, for homogeneous, linear(Edit) ODEs, solution set is a vector space. So it's either the 0 vector or infinite in cardinality.

Last edited:
chwala, ChiralSuperfields and FactChecker
SammyS said:
True enough, but the Problem Statement deals only with finding the coefficients of the given polynomial.
Good point. I just wanted to dispel the idea that those were the only solutions. I didn't notice that this problem was before chapter 9, where differential equations would be studied.

ChiralSuperfields
pasmith said:
Set $u = y' + 2y$. Then $$\begin{split} u' - u &= (y'' + 2y') - (y' + 2y) \\ &= y'' + y' - 2y \\&= x^2. \end{split}$$ This gives you two first order linear ODEs to solve.

(This works because $\lambda^2 + \lambda - 2 = (\lambda - 1)(\lambda + 2)$.)
The algebra behind why this works is absolutely beautiful and I recommend learning it if you haven't seen it. (It's essentially the fundamental theorem of algebra, a nullity inequality that works even in infinite dimensions and knowing the kernel of d/dx - c for a fixed complex constant c).

ChiralSuperfields
WWGD said:
Ultimately, for homogeneous, linear PDEs, solution set is a vector space.
Did you mean ODEs here? That is the type of equation being discussed in this thread.

ChiralSuperfields and WWGD
Here is another way to solve it. A warning it is not for the faint hearted.

The equations is ##y''+y-2y=x^2##. Change the notations, so that derivatives are denoted by ##D## i.e. the first derivative is ##Dy## instead of ##y'## and the second derivative is ##D^2y## instead of ##y''##.

Now the equation is ##D^2y+Dy-2y=x^2##. The goal is to solve for ##y##, so let's do precisely that.

Factorize and get ##(D^2+D-2)y=x^2##, then divide, so you have ##y=\frac{x^2}{D^2+D-2}## or ##y=\frac{1}{D^2+D-2}x^2##.

Now we focus on ##\frac{1}{D^2+D-2}##. Rewrite it as ##-\frac12\frac{1}{1-\frac12(D+D^2)}##. And using the geometric series ##\frac1{1-r}=1+r+r^2\cdots## we have

##\frac{1}{1-\frac12(D+D^2)}=1+\left[ \frac12(D+D^2)\right]+\left[ \frac12(D+D^2)\right]^2+\left[ \frac12(D+D^2)\right]^3+\cdots##.

We can ignore all terms after the first three because we are applying this to ##x^2## and ##D^nx^2=0## for ##n\ge 3##.

So we have ##-\frac12\frac{1}{1-\frac12(D+D^2)}=-\frac12\left(1+\left[ \frac12(D+D^2)\right]+\left[ \frac12(D+D^2)\right]^2\right)=-\frac12-\frac14D-\frac38D^2##.

In the last step I ignored terms of ##D## to power three or higher agian.

Finally we have ##y=-\frac12\frac{1}{1-\frac12(D+D^2)}x^2=(-\frac12-\frac14D-\frac38D^2)x^2=-\frac12x^2-\frac12x-\frac34##.

Where in the last step we remembered that ##D## means derivative. So ##A=-\frac12##, ##B=-\frac12## and ##C=-\frac34##4.

chwala and ChiralSuperfields
martinbn said:
Here is another way to solve it. A warning it is not for the faint hearted.

The equations is ##y''+y-2y=x^2##. Change the notations, so that derivatives are denoted by ##D## i.e. the first derivative is ##Dy## instead of ##y'## and the second derivative is ##D^2y## instead of ##y''##.

Now the equation is ##D^2y+Dy-2y=x^2##. The goal is to solve for ##y##, so let's do precisely that.

Factorize and get ##(D^2+D-2)y=x^2##, then divide, so you have ##y=\frac{x^2}{D^2+D-2}## or ##y=\frac{1}{D^2+D-2}x^2##.

Now we focus on ##\frac{1}{D^2+D-2}##. Rewrite it as ##-\frac12\frac{1}{1-\frac12(D+D^2)}##. And using the geometric series ##\frac1{1-r}=1+r+r^2\cdots## we have

##\frac{1}{1-\frac12(D+D^2)}=1+\left[ \frac12(D+D^2)\right]+\left[ \frac12(D+D^2)\right]^2+\left[ \frac12(D+D^2)\right]^3+\cdots##.

We can ignore all terms after the first three because we are applying this to ##x^2## and ##D^nx^2=0## for ##n\ge 3##.

So we have ##-\frac12\frac{1}{1-\frac12(D+D^2)}=-\frac12\left(1+\left[ \frac12(D+D^2)\right]+\left[ \frac12(D+D^2)\right]^2\right)=-\frac12-\frac14D-\frac38D^2##.

In the last step I ignored terms of ##D## to power three or higher agian.

Finally we have ##y=-\frac12\frac{1}{1-\frac12(D+D^2)}x^2=(-\frac12-\frac14D-\frac38D^2)x^2=-\frac12x^2-\frac12x-\frac34##.

Where in the last step we remembered that ##D## means derivative. So ##A=-\frac12##, ##B=-\frac12## and ##C=-\frac34##4.
this is not a valid proof, and I helped the guy on the video where you probably saw that

ChiralSuperfields
TurtleKrampus said:
this is not a valid proof, and I helped the guy on the video where you probably saw that
What proof! I solved an equation, I didn't prove a statement. What video! I learnt this from Heaviside, no videos during his time.

By the way didn't you see the warning?!

ChiralSuperfields
martinbn said:
What proof! I solved an equation, I didn't prove a statement. What video! I learnt this from Heaviside, no videos during his time.

By the way didn't you see the warning
Nevermind then, anyway while that gives a correct solution, since it's not really valid you should sub back to see that it works (which it probably does, I cba to check).
It's basically abusing an interesting 'coincidence' of the derivative as a linear operator

ChiralSuperfields
Maybe we can use some type of functional calculus( Borel, etc)to formalize it?

ChiralSuperfields
WWGD said:
Maybe we can use some type of functional calculus( Borel, etc)to formalize it?
If you only look at polynomials, which seems to be the case for this problem, then the operator has an inverse.

ChiralSuperfields and WWGD
martinbn said:
If you only look at polynomials, which seems to be the case for this problem, then the operator has an inverse.
The problem is that as an operator, it doesn't have null kernel. While this has probably been formalized there are also ways of obtaining an answer using linear algebra (may be a bit surprising, but finite nullity is a king), which are easier to prove they work. Not sure which is easier in practice. (I also suspect that the way this works is because of how this problems translates to a linear algebra problem)

ChiralSuperfields
TurtleKrampus said:
The problem is that as an operator, it doesn't have null kernel. While this has probably been formalized there are also ways of obtaining an answer using linear algebra (may be a bit surprising, but finite nullity is a king), which are easier to prove they work. Not sure which is easier in practice. (I also suspect that the way this works is because of how this problems translates to a linear algebra problem)
When would nullity be infinite-dimensional in a finite order ODE?
Edit: or maybe you mean## C^2(\mathbb R)##?

Last edited:
ChiralSuperfields
WWGD said:
When would nullity be infinite-dimensional in a finite order ODE?
Edit: or maybe you mean## C^2(\mathbb R)##?
Proving that the solution space is a finite dimension affine space (that's embedded in a finite dimension vector space), so that you can translate the problem to a problem in linear algebra, you'd need to know beforehand that the differential operator is of finite nullity, which will intuitive is not (?) entirely obvious. [Maybe you'd know how to translate this into a linear matrix differential equation Y' = AY + C, in which case it will be somewhat obvious]
This at first hand does not seem like linear algebra would be enough to solve it, after all most of the results of linear algebra hinge on the fact that we work on finite dimensional vector spaces. HOWEVER, the following nullity theorem:
$$\dim(\ker(AB)) \leq \dim(\ker(A)) + \dim(\ker(B))$$
Works even for infinite dimensions, though it's mostly useless if the linear operators don't have finite nullity (dim ker).
Plus the fact that you can manipulate it to prove a solution ##y## must be ##C^\infty## and thus the derivative is an endomorphism (linear transform onto the same vector space). This allows you to use the fundamental theorem of algebra, since as a ring the operator algebra generated by the derivative is going to be isomorphic to the ring of polynomials with complex coefficients, and split a differential operator into a product of linear differential operators and prove that it is in fact also finite nullity. (And in particular you can find the exact kernel by splitting the differential operator into distinct powers of linear terms. And whose kernels are always distinct so the kernel of the composition is just the direct sum of all the kernels of the distinct powers).
In particular if the equation is of the form ##p(D)y = z## and there exists a differential operator ##q(D)## with ##q(D)z =0## you have that ##y \in \ker(q(D)p(D))## which is finite dimensional. And much easier, to calculate a particular solution ##y_0## will be in a space that's isomorphic to ##\ker(q(D)p(D))/\ker(p(D))## (this avoids what physicists may call resonance) and the problem naturally translates into a matrix equation of the form ##Ax = b##.

In practice one doesn't do all of this, you just decompose the polynomial, find a good basis for the embedding space (usually the best ones are given by monomials of the form ##e^{ax} \cdot {x^k \over k!}##), remove the basis elements that are in the basis of the kernel ##\ker(p(D))##, write a matrix form for the derivative operator restricted to this space (technically the operator which makes a certain diagram commute, but this is a physics forum) and finish writing the matrix equation ##Ax = b##. This is probably much easier done than said, this is also much easier for computing several solutions for similar problems ##p(D)y = w## where ##w## also satsifies ##q(D)w = 0## is immediately translated into some ##Ax = c## after writing ##w## as a sum of the basis elements.

Last edited:
ChiralSuperfields

• Calculus and Beyond Homework Help
Replies
7
Views
412
• Calculus and Beyond Homework Help
Replies
18
Views
1K
• Calculus and Beyond Homework Help
Replies
10
Views
525
• Calculus and Beyond Homework Help
Replies
7
Views
726
• Calculus and Beyond Homework Help
Replies
7
Views
577
• Calculus and Beyond Homework Help
Replies
3
Views
941
• Calculus and Beyond Homework Help
Replies
2
Views
316
• Calculus and Beyond Homework Help
Replies
2
Views
550
• Calculus and Beyond Homework Help
Replies
6
Views
910
• Calculus and Beyond Homework Help
Replies
12
Views
460