How Can I Use Variation of Parameters to Solve Differential Equations?

Click For Summary
The discussion focuses on using the method of variation of parameters to solve the differential equation y'' + 2y' + y = e^(-x)(2 + 1/x^2). The user expresses confusion about the method, particularly regarding the need to guess solutions, which is more relevant to the method of undetermined coefficients. The correct approach involves solving the homogeneous part first and then using functions of x for the coefficients in the general solution. It is noted that while undetermined coefficients can simplify certain parts, variation of parameters is necessary for non-standard right-hand side functions like e^(-x)/x^2. The conversation emphasizes that both methods have their place, with variation of parameters being more general but computationally intensive.
Rubik
Messages
95
Reaction score
0
I am trying to solve a problem along the lines of y'' + 2y' + y = e^(-x) (2 + 1/x^2).. The actual one I am trying to solve differs slightly.

I was trying to solve it using the method of variation of parameters.. However it is new to me and was too confusing.

So first I get:

y comlpiment = C1e^(-x) + C2xe^(-x)

Then do I solve

y'' + 2y' + y = 2e^(-x)

and

y'' + 2y' + y + e^(-x)/x^2

The only thing is with this method I stuggle to 'guess' the solution?
 
Physics news on Phys.org
Variation of parameters doesn't involve guessing a solution - this is the undetermined coefficients method.

Variation of parameters works like this: You solve the homogeneous part of your linear ODE, and you suppose your coefficients are functions of x. For a second order linear ODE, the solution of the homogeneous part should look like

y_h(x) = A y_1(x) + B y_2(x)​

Now, you assume that your general solution is

y(x) = A(x) y_1(x) + B(x) y_2(x)​

We differentiate (these are all functions of x, but to make the notation cleaner, I will not write the (x) explicitly):

y' = A'y_1 + A y'_1 + B' y_2 + B y'_2​

Now, since we have two unknowns, A(x) and B(x), we set the following condition so that A(x) and B(x) behave partially as if they were constant:

A'y_1 + B' y_2 = 0​

Plugging this into the equation for the first derivative, and differentiating again, we arrive at the following system of equations for A(x) and B(x):

y_1 A' + y_2 B' = 0

y'_1 A' + y'_2 B' = f(x)​

where f(x) is the non-homogenous term of your ODE, in this case,

f(x) = e^{-x} \left(2 + \frac{1}{x^2}\right)​

From here, you solve for A' and B' and you can easily (in theory) integrate to find A(x) and B(x).

Hope this helps. :)
 
Last edited:
And even "undetermined coefficients" does not really require "guessing" the solution.

As long as the "right hand side" function is one of those we expect as solutions to linear d.e.s with constant coefficients (exponentials, sine and cosine, polynomials, and combinations of those) there are pretty strict "rules" for which functions to use.

In your example, the "right hand side" function is e^{-x}(2+ 1/x^2) which is NOT one of those type. However, a nice thing about "linear" problems in general is that you can solve separate "parts" and then use those to find a solution to the whole problem. You do that, for example, when you use the general solution to the associated homogeneous equation to find the general solution to the entire equation.

Here, for example, yes, you could use "undetermined coefficients" to find a particular solution to y''+ 2y'+ y= 2e^{-x} (Using y= Ax^2e^{-x}) and then use "variation of parameters" to find a particular solution to y''+ 2y'+ y= e^{-x}/x^2. The sum of those will be a particular solution to the entire equation. I recommend "undetermined coefficients" for the first because, when it can be used it is always simpler than "variation of parameters". I recommend "variation of parameters" for the second simply because "undetermined coefficients cannot be used- e^{-x}/x^2 could never be the solution to a linear de with constant coeficients.
 
HallsofIvy said:
And even "undetermined coefficients" does not really require "guessing" the solution.

This is true, however you have to guess intelligently, since if the solutions of the homogeneous part actually show up on the RHS as your f(x), you have to resort to tricky "guess" functions; otherwise, this method won't work.

Variation of parameters even works for linear ODEs where the coefficients are not constant, so in this sense, it is more general - however, it requires more computational effort because some integrals are involved.

On a sidenote, there's a "second" variation of parameters method (attributed to Liouville I believe) which works when only one solution to the homogeneous equation is known. Assuming this solution is y_1, we write the solution as

y(x) = A(x) y_1(x).​

Differentiating twice,

y'(x) = A'(x) y_1(x) + A(x) y'_1(x),

y''(x) = A''(x) y_1(x) +2 A'(x) y'_1(x) + A(x) y''_1(x).​

Now, if you plug these results into the original linear ODE, you'll get something like

g(x) A''(x) + h(x) A'(x) = f(x).​

If we define A'(x) \equiv u(x), we have the following first-order linear ODE:

g(x) u'(x) + h(x) u(x) = f(x),​

which can be solved in any way one pleases. Once one has u(x), we only need to integrate it to get A(x) and plug this into y(x) = A(x) y_1(x) to get the general solution of the differential equation.
 
Hmm okay so if I begin by using the method of undetermined coefficients to solve y''+2y'+y=2e^(-x) using y=Ax^2e^(-x)

does this then mean:

y' = -Ax^2e^(-x) + 2A'xe^(-x) ?
y'' = Ax^(2)e^(-x) - 4xA'e^(-x) + A''xe^(-x) ?
 
Also by substituting back into the equation y''+2y'+y=2e^(-x) using y=Ax^2e^(-x) a lot of it cancels out and I am left with:

2 = A''x (Does this seem right?)

Also from this equation I am stuck?
 
I then did this:

A'' = 2/x
A' = 2 ln(x)
A = 2x ln(x) - 2x (Is this even remotely right?)
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
773
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K