Variation of parameter VS Undetermined Coefficients

Click For Summary

Homework Help Overview

The discussion revolves around solving the ordinary differential equation (ODE) 2y'' + y' - y = x + 7 using two methods: undetermined coefficients and variation of parameters. The original poster presents their findings for both methods, noting a discrepancy in the particular solution obtained through variation of parameters.

Discussion Character

  • Mixed

Approaches and Questions Raised

  • The original poster attempts to solve the ODE using both undetermined coefficients and variation of parameters, providing their calculations for each method. Some participants question the validity of the solutions and the application of the variation of parameters method, particularly regarding the necessary conditions for the coefficients.

Discussion Status

Participants are actively engaging with the original poster's calculations, offering suggestions for checking the solutions against the ODE. There is a recognition of a potential mistake in the application of the variation of parameters method, with some participants indicating that the coefficients must be normalized before applying the formula.

Contextual Notes

There is an emphasis on the requirement that the coefficient of the second-order term in the ODE must equal 1 for the variation of parameters method to be applied correctly. The original poster acknowledges this constraint and expresses a desire to clarify their understanding.

Davidian
Messages
4
Reaction score
2
TL;DR Summary: Variation of parameter VS Undetermined Coefficients

Hi all,

Suppose we want to solve the following ODE
2y''+y'-y=x+7
with two different methods: undetermined coefficients and variation of parameters.
The solutions to the homogeneous problem are given by y_1(x)=exp(-x) and y_2(x)=exp(x/2) and their Wronskian is (3/2)exp(-x/2).
Undetermined coefficients: by assuming the particular solution to be of the form Ax+B, we find y_p(x)=-x-8 so that the solution is given by
y(x)=c1exp(-x)+c2exp(x/2)-x-8

Variation of parameters: by applying the formula we have u1(x)=-(2/3)(x+6)exp(x) and u2(x)=-(2/3)(2x+18)exp(-x/2) so that if we write
y(x)=u1(x)y1(x)+u2(x)y2(x)=c1exp(-x) +c2exp(x/2) -2x-16
so there is a mismatch of a factor 2 in the particular solution.

Am I doing something silly?

Thanks,
Davide
 
Physics news on Phys.org
Have you checked which of your solutions actually satisfies the ODE?

That aside, if you don't show your working we can't find where or why you went wrong. I suspect, however, that to use variation of parameters you must rewrite the ODE as <br /> y&#039;&#039; + \tfrac12y&#039; - \tfrac12 y = \tfrac12(x + 7) so that the coefficient of y&#039; is 1.
 
Last edited:
Hello @Davidian ,
:welcome: ##\qquad##!​

Davidian said:
TL;DR Summary: Variation of parameter VS Undetermined Coefficients

Hi all,

Suppose we want to solve the following ODE
$$2y''+y'-y=x+7$$
with two different methods: undetermined coefficients and variation of parameters.
Notice how the legibility improves by using a little ##\LaTeX## ?
The link is to the lower left of the editing window :smile:

The solutions to the homogeneous problem are given by ##y_1(x)=e^{-x} ## and ##y_2(x)=e^{x/2}## and their Wronskian is ##{3\over 2} e^{-x/2}##.

Undetermined coefficients: by assuming the particular solution to be of the form ##Ax+B##, we find ##y_p(x)=-x-8## so that the solution is given by $$y(x)=c_1\,e^{-x}+c_2\, e^{x/2}-x-8$$
Agree.

Variation of parameters: by applying the formula we have $$\begin{align*} u_1(x)&=-{\textstyle {2\over 3}}(x+6)\,e^{x}\qquad \sf \text{and} \\u_2(x)&=-{\textstyle {2\over 3}} (2x+18)\, e^{x/2}\end{align*}$$
I'm lost. What formula is that ? In my book (Stewart, Calculus, 5e) ##u_1## and ##u_2## have to satisfy$$u_1' y_1+ u_2' y_2 = 0 \quad{\sf\text{and}}\quad u_1'y_1' + u_2' y_2' ={\textstyle {1\over 2}}(x+7)$$but your ##u## don't satisfy the first one ...
(so I didn't bother to check the second :smile:)

##\ ##
 
Thanks for the reply: here are the calculations.
The characteristic polynomial is given by
$$
\lambda^2+\lambda-1=0,
$$
whose roots are ##\lambda=-1## and ##\lambda=-1/2##. The solution to the homogeneous problem is
$$
y(x)=c_1e^{-x}+c_2e^{x/2}.
$$
and the Wronskian is
$$
e^{-x}\frac{1}{2}e^{x/2} +e^{-x}e^{x/2}=\frac{3}{2}e^{-x/2}.
$$
Assuming the particular solution of the form
$$
y_p(x)=Ax+B,
$$
and inserting in the original problem gives
$$
A-Ax-B=x+7,
$$
which gives ##A=-1## and ##B=-8##. Combining these results gives
$$
y(x)=c_1e^{-x}+c_2e^{x/2}-x-8.
$$
I want to solve the same problem with the Variation of Parameters method. So I start by assuming ##\ y_1(x)=e^{-x}## and ##\ y_2(x)=e^{x/2}##, and thus the first coefficient is
$$
u_1(x)=-\int \frac{e^{x/2}(x+7)}{W(x)}dx=-\frac{2}{3}\int e^{x}(x+7)dx=-\frac{2}{3}(x+6)e^x+c_1
$$
while the second is
$$
u_2(x)=\int \frac{e^{-x}(x+7)}{W(x)}dx=-\frac{2}{3}\int e^{-x/2}(x+7)dx=-\frac{2}{3}(2x+18)e^{-x/2}+c_2
$$
Combining all pieces gives
$$
y(x)=\left(-\frac{2}{3}(x+6)e^x+c_1\right)e^{-x}+\left(-\frac{2}{3}(2x+18)e^{-x/2}+c_1\right)e^{x/2}
$$
which becomes
$$
-\frac{2}{3}x-4+c_1e^{x}-\frac{4}{3}x-12 +c_2e^{x/2}.
$$
Combining all terms gives
$$
y(x)=c_1e^{-x}+c_2e^{x/2}-2x-16
$$
so a mismatch of a factor two in the particular solution.

The solution obtained with the Undetermined Coefficients method satisfies the differential equation, while the solution obtained with the Variation of the Parameters method does not satisfy the differential equation. In fact it gives the rest ##(x+7)## which depends on the factor two that I found in the solution with the second method.

Davide
 
Last edited by a moderator:
BvU said:
Hello @Davidian ,
:welcome: ##\qquad##!​
Notice how the legibility improves by using a little ##\LaTeX## ?
The link is to the lower left of the editing window :smile:Agree.I'm lost. What formula is that ? In my book (Stewart, Calculus, 5e) ##u_1## and ##u_2## have to satisfy$$u_1' y_1+ u_2' y_2 = 0 \quad{\sf\text{and}}\quad u_1'y_1' + u_2' y_2' ={\textstyle {1\over 2}}(x+7)$$but your ##u## don't satisfy the first one ...
(so I didn't bother to check the second :smile:)

##\ ##
Thank you for your reply.

The formula is the generic one for the method
$$
u_1(x)=-\int\frac{y_2(x)g(x)dx}{W(x)}+c_1,
$$
while for
$$
u_2(x)=\int\frac{y_1(x)g(x)dx}{W(x)}+c_2,
$$
where ##\ g(x)## is the non homogeneous term. It is the same as the solution of the two conditions you posed, apart from the factor 1/2 in front of the second.

Thanks,
Davide
 
Last edited:
Good to see you speak ##\TeX## :smile:. But: enclose in double $ for displayed math and in double # for in-line math.
Tex tip: {\textstyle {1\over 2 }} (##{\textstyle {1\over 2 }}##) in displayed math looks better than {\displaystyle {1\over 2 }} (##{\displaystyle {1\over 2 }}##) .

Davidian said:
..
The characteristic polynomial is given by ##\lambda^2+\lambda-1=0,##
whose roots are ##\lambda=-1## and ##\lambda=-1/2##. The solution to the homogeneous problem is
$$
y(x)=c_1e^{-x}+c_2e^{x/2} $$and the Wronskian is
$$
e^{-x}\frac{1}{2}e^{x/2} +e^{-x}e^{x/2}=\frac{3}{2}e^{-x/2}.
$$
Assuming the particular solution of the form ##y_p(x)=Ax+B##, and inserting in the original problem gives ##
A-Ax-B=x+7##, which gives ##A=-1## and ##B=-8##. Combining these results gives
$$
y(x)=c_1e^{-x}+c_2e^{x/2}-x-8.
$$
And agreed.

I want to solve the same problem with the Variation of Parameters method. So I start by assuming ##y_1(x)=e^{-x}## and ##y_2(x)=e^{x/2}##, and thus the first coefficient is $$
u_1(x)=-\int \frac{e^{x/2}(x+7)}{W(x)}dx=-\frac{2}{3}\int e^{x/2}(x+7)dx=-\frac{2}{3}(x+6)e^x+c_1
$$while the second is$$
u_2(x)=\int \frac{e^{-x}(x+7)}{W(x)}dx=-\frac{2}{3}\int e^{-x/2}(x+7)dx=-\frac{2}{3}(2x+18)e^{-x/2}+c_2
$$Combining all pieces gives $$
y(x)=\left(-\frac{2}{3}(x+6)e^x+c_1\right)e^{-x}+\left(-\frac{2}{3}(2x+18)e^{-x/2}+c_1\right)e^{x/2}
$$which becomes$$
-\frac{2}{3}x-4+c_1e^{x}-\frac{4}{3}x-12 +c_2e^{x/2}.
$$Combining all terms gives$$
y(x)=c_1e^{-x}+c_2e^{x/2}-2x-16
$$so a mismatch of a factor two in the particular solution.

The solution obtained with the Undetermined Coefficients method satisfies the differential equation, while the solution obtained with the Variation of the Parameters method does not satisfy the differential equation. In fact it gives the rest ##(x+7)## which depends on the factor two that I found in the solution with the second method.
Well, there must be a bug in there somewhere, but I have to chew on it (rusty... :frown: )

##\ ##
 
I think I understood my mistake.
The solutions ##\ u_1(x)## and ##\ u_2(x)## can be obtained by using the formula I posted only if the coefficients of the second order term is equal to 1. In my example, I need to divide everything by a factor 2.

Thanks for your help!
Davide
 
Last edited:
  • Like
Likes   Reactions: berkeman and BvU
Good thing you found it... would have taken me a while...

##\ ##
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
12
Views
2K
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
2
Views
1K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
985
  • · Replies 3 ·
Replies
3
Views
2K