Krista King Math | Online math help

View Original

Undetermined coefficients for second-order nonhomogeneous equations

What steps do we use to solve an undetermined coefficients problem

Undetermined coefficients is a method you can use to find the general solution to a second-order (or higher-order) nonhomogeneous differential equation.

Remember that homogenous differential equations have a ???0??? on the right side, where nonhomogeneous differential equations have a non-zero function on the right side.

The general solution ???Y(x)??? to a nonhomogeneous differential equation will always be the sum of the complementary solution ???y_c(x)??? and the particular solution ???y_p(x)???.

???Y(x)=y_c(x)+y_p(x)???

We’ll start by finding the complementary solution by pretending that the nonhomogeneous equation is actually a homogenous equation. In other words, we just replace ???g(x)??? with ???0??? and then solve for the values of ???x??? that are solutions to the homogenous equation.

Depending on the values of ???x??? that we find, we’ll generate the complementary solution to the differential equation.

Once we find the complementary solution, it’s time to make a guess about the particular solution using the right side of the differential equation. It takes practice to get good at guessing the particular solution, but here are some general guidelines.

  • For a polynomial function like ???x^2+1???, guess ???Ax^2+Bx+C???, making sure to include all lower degree terms than the highest degree term in the polynomial.

  • For an exponential function like ???e^{3x}???, guess ???Ae^{3x}???.

  • For sine or cosine like ???3\sin{4x}??? or ???2\cos{4x}???, guess ???A\sin{4x}+B\cos{4x}???.

If the right side of the differential equation is the sum or product of these types of functions, then we need to multiply or add our guesses together, making sure that we have distinct constants, and that we’ve simplified the products of constants. For example,

The last step with your guess of the particular solution is to make sure that none of the terms in the guess of the particular solution overlap with any terms in the complementary solution. For any terms that do overlap, you’ll need to multiply that section of the particular solution by ???x??? in order to eliminate the overlap. For example, if the complementary solution includes the term ???e^{3x}???, and your guess for the particular solution includes ???Ae^{3x}???, then you’ll need to change ???Ae^{3x}??? in the particular solution to ???Axe^{3x}??? to eliminate the overlap. For exponential terms like these, an overlap only exists if the exponents match exactly. So ???e^{3x}??? and ???Ae^{3x}??? are overlapping, but ???e^{3x}??? and ???Ae^{5x}??? are not.

With a finalized guess for the particular solution, take the derivative and second derivative of your guess, then plug the guess into the original differential equation for ???y(x)???, plug its derivative in for ???y'(x)???, and plug the second derivative in for ???y''(x)???. 

Then you’ll be able to combine like-terms and equate coefficients on both sides to solve for the constants, and ultimately get a particular solution that you can combine with the complementary solution in order to get a general solution for the differential equation.

Solving a second-order nonhomogeneous differential equation using undetermined coefficients


Take the course

Want to learn more about Differential Equations? I have a step-by-step course for that. :)


Finding the general solution by combining the complementary and particular solutions

Example

Find the general solution of the differential equation.

???y''+2y'=4x-6e^{-2x}???

First we need to work on the complementary solution, which we’ll do by substituting ???0??? for the entire right side and focusing only the left side.

???y''+2y'=0???

Then we’ll make the substitution ???y'=r???.

???r^2+2r=0???

???r(r+2)=0???

So the roots are

???r_1=0???

???r_2=-2???

These are distinct real roots, so we’ll use the formula for the complementary solution with distinct real roots and get

???y_c(x)=c_1e^{r_1x}+c_2e^{r_2x}???

???y_c(x)=c_1e^{(0)x}+c_2e^{-2x}???

???y_c(x)=c_1(1)+c_2e^{-2x}???

???y_c(x)=c_1+c_2e^{-2x}???

We’ll hold on to the complementary solution and switch over to the particular solution. The first thing we notice is that we have a polynomial function, ???4x???, and an exponential function, ???-6e^{-2x}???. We’ll use ???Ax+B??? as our guess for the polynomial function, and we’ll use ???Ce^{-2x}??? as our guess for the exponential function. Putting these together, our guess for the particular solution will be

???y_p(x)=Ax+B+Ce^{-2x}???

Comparing this to the complementary solution, we can see that ???c_2e^{-2x}??? from the complementary solution and ???Ce^{-2x}??? from the particular solution are overlapping terms. To fix this, we’ll multiply ???Ce^{-2x}??? from the particular solution by ???x???, such that our guess becomes

???y_p(x)=Ax^2+Bx+Cxe^{-2x}???

Taking the first and second derivatives of this guess, we get

???y_p'(x)=2Ax+B+Ce^{-2x}-2Cxe^{-2x}???

???y_p''(x)=2A-4Ce^{-2x}+4Cxe^{-2x}???

Plugging the first two derivatives into the original differential equation, we get

???2A-4Ce^{-2x}+4Cxe^{-2x}+2\left(2Ax+B+Ce^{-2x}-2Cxe^{-2x}\right)=4x-6e^{-2x}???

???2A-4Ce^{-2x}+4Cxe^{-2x}+4Ax+2B+2Ce^{-2x}-4Cxe^{-2x}=4x-6e^{-2x}???

???(2A+2B)+4Ax-2Ce^{-2x}=4x-6e^{-2x}???

Equating coefficients from the left and right side, we get

???2A+2B=0???

???2(1)+2B=0???

???2B=-2???

???B=-1???

and

???4A=4???

???A=1???

and

???-2C=-6???

???C=3???

We’ll plug the results into our guess for the particular solution to get

???y_p(x)=(1)x^2+(-1)x+(3)xe^{-2x}???

???y_p(x)=x^2-x+3xe^{-2x}???

Putting this together with the complementary solution gives us the general solution to the differential equation.

???Y(x)=y_c(x)+y_p(x)???

???Y(x)=c_1+c_2e^{-2x}+x^2-x+3xe^{-2x}???


Get access to the complete Differential Equations course