When to use Variation of Parameters / Method of Undetermined Coefficients

There are two methods to solve 2nd order linear Non-homogenous D.E.: Variation of Parameters and Method of Undetermined Coefficients. (see this notes for details)

A common question is: when to use which method?

Simple Guideline: If r(x) (the right-hand side of the D.E. y''+p(x)y'+q(x)y=r(x)) is a

  • Polynomial
  • Exponential (e^{kx})
  • Sine or Cosine (\sin kx or \cos kx)
  • Or combinations of the above

use Method of Undetermined Coefficients for fast solution. Note: It is 100% correct to use Variation of Parameters for the above cases, but it is usually slower due to the integration involved.

For all other cases not covered above, use Variation of Parameters.

Examples from Midterm

(2016 Q10) y''-2y'-3y=4e^x+4e^{3x}. Use Method of Undetermined Coefficients since r(x) is a sum of exponential functions.

(2015 Q9) y''+4y=\cos 2x. Use Method of Undetermined Coefficients since r(x) is a cosine function.

(2015 Q10) y''-4y=e^{x^2}. Although r(x)=e^{x^2} is an exponential, it is not of the form e^{kx}. Also, the fact that A(x) and B(x) are integrals clearly suggests that they are related to the u,v in the method of Variation of Parameters. So we use Variation of Parameters.

(2014 Q10) y''-2y'+y=e^x\cosh x. On the surface, e^x\cosh x does not fall into the category of polynomial/exponential/cos/sine, so we use Variation of Parameters as shown in the official answer.

However, if we know the identity \cosh(x)=\frac 12(e^x+e^{-x}), we can actually rewrite the equation as y''-2y'+y=\frac 12 e^{2x}+\frac 12 and use Method of Undetermined Coefficients.

Outline of solution using Method of Undetermined Coefficients:

Guess y_p=Ae^{2x}+B. Then y_p''-2y_p'+y_p=Ae^{2x}+B, where we can clearly see that A=B=\frac 12. Then y=c_1e^x+c_2xe^x+\frac 12 e^{2x}+\frac 12. Upon plugging in the initial conditions, we find that c_1=c_2=1.

Hence y(2)=e^2+2e^2+\frac 12 e^4+\frac 12=49.966\approx 50.

The Brachistochrone

Entertaining video to (hopefully) increase your interest in math.

Recently, I saw this video in the “Trending” section of YouTube (3 million views). It is actually related to differential equations.

The basic question behind this is: What is the shape of the curve that will allow a ball to slide frictionlessly (under gravity) to a given end point in the shortest time? Rather surprisingly, the answer is not a straight line, even though a straight line is the shortest distance between two points.

Perhaps even more surprising is that such a curve is a tautochrone curve, where the time taken by an object sliding without friction in uniform gravity to its lowest point is independent of its starting point

Note: Do not worry, this is not tested.