Second-order nonhomogeneous differential equations initial value problems

 
 
Nonhomogeneous initial value problems.jpeg
 
 
 

Steps for solving a second-order nonhomogeneous differential equation initial value problem

To solve an initial value problem for a second-order nonhomogeneous differential equation, we’ll follow a very specific set of steps.

Krista King Math.jpg

Hi! I'm krista.

I create online courses to help you rock your math class. Read more.

 

We can summarize these steps as follows:

  1. Find the complementary solution yc(x)y_c(x).

  2. Find the particular solution yp(x)y_p(x).

  3. Put them together to find the general solution y(x)=yc(x)+yp(x)y(x)=y_c(x)+y_p(x).

  4. Find the derivative of the general solution y(x)=yc(x)+yp(x)y'(x)=y_c'(x)+y_p'(x).

  5. Plug the given initial conditions into the general solution and its derivative to create a system of linear equations.

  6. Solve the system in order to find values for c1c_1 and c2c_2.

  7. Plug c1c_1 and c2c_2 back into the general solution to solve the initial value problem.

 
 

Example of a nonhomogeneous differential equation with an exponential function


 
Krista King Math Signup.png
 
Differential Equations course.png

Take the course

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

 
 

 
 

Finding the general solution of the second-order nonhomogeneous differential equation given a set of initial conditions

Example

Find the general solution of the differential equation, if y(0)=0y(0)=0 and y(0)=1y'(0)=1.

y+y=x2exy''+y'=x-2e^{-x}

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

y+y=0y''+y'=0

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

r2+r=0r^2+r=0

r(r+1)=0r(r+1)=0

So the roots are

r1=0r_1=0

r2=1r_2=-1

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

yc(x)=c1er1x+c2er2xy_c(x)=c_1e^{r_1x}+c_2e^{r_2x}

yc(x)=c1e(0)x+c2e1xy_c(x)=c_1e^{(0)x}+c_2e^{-1x}

yc(x)=c1(1)+c2exy_c(x)=c_1(1)+c_2e^{-x}

yc(x)=c1+c2exy_c(x)=c_1+c_2e^{-x}

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, xx, and an exponential function, 2ex-2e^{-x}. We’ll use Ax+BAx+B as our guess for the polynomial function, and we’ll use CexCe^{-x} as our guess for the exponential function. Putting these together, our guess for the particular solution will be

yp(x)=Ax+B+Cexy_p(x)=Ax+B+Ce^{-x}

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

yp(x)=Ax+B+Cxexy_p(x)=Ax+B+Cxe^{-x}

We also need to realize that c1c_1 from the complementary solution and BB from the particular solution are overlapping terms. To fix this, we’ll multiply the polynomial portion of the particular solution by xx, such that our guess becomes

yp(x)=Ax2+Bx+Cxexy_p(x)=Ax^2+Bx+Cxe^{-x}

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

yp(x)=2Ax+B+CexCxexy_p'(x)=2Ax+B+Ce^{-x}-Cxe^{-x}

yp(x)=2A2Cex+Cxexy_p''(x)=2A-2Ce^{-x}+Cxe^{-x}

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

2A2Cex+Cxex+2Ax+B+CexCxex=x2ex2A-2Ce^{-x}+Cxe^{-x}+2Ax+B+Ce^{-x}-Cxe^{-x}=x-2e^{-x}

(2A+B)+2AxCex=x2ex(2A+B)+2Ax-Ce^{-x}=x-2e^{-x}

Nonhomogeneous initial value problems for Differential Equations

To solve an initial value problem for a second-order nonhomogeneous differential equation, we’ll follow a very specific set of steps.

Equating coefficients from the left and right side, we get

2A+B=02A+B=0

2(12)+B=02\left(\frac12\right)+B=0

B=1B=-1

and

2A=12A=1

A=12A=\frac12

and

C=2-C=-2

C=2C=2

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

yp(x)=12x2x+2xexy_p(x)=\frac12x^2-x+2xe^{-x}

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

Y(x)=yc(x)+yp(x)Y(x)=y_c(x)+y_p(x)

Y(x)=c1+c2ex+12x2x+2xexY(x)=c_1+c_2e^{-x}+\frac12x^2-x+2xe^{-x}

Now we’ll take the derivative of the general solution.

Y(x)=c2ex+x1+2ex2xexY'(x)=-c_2e^{-x}+x-1+2e^{-x}-2xe^{-x}

We can now plug the given initial conditions y(0)=0y(0)=0 and y(0)=1y'(0)=1 into the general solution and its derivative to create a system of linear equations.

Y(x)=c1+c2ex+12x2x+2xexY(x)=c_1+c_2e^{-x}+\frac12x^2-x+2xe^{-x}

0=c1+c2e(0)+12(0)20+2(0)e(0)0=c_1+c_2e^{-(0)}+\frac12(0)^2-0+2(0)e^{-(0)}

0=c1+c2(1)0=c_1+c_2(1)

0=c1+c20=c_1+c_2

and

Y(x)=c2ex+x1+2ex2xexY'(x)=-c_2e^{-x}+x-1+2e^{-x}-2xe^{-x}

1=c2e(0)+01+2e(0)2(0)e(0)1=-c_2e^{-(0)}+0-1+2e^{-(0)}-2(0)e^{-(0)}

1=c2(1)1+2(1)1=-c_2(1)-1+2(1)

1=c2+11=-c_2+1

0=c20=-c_2

0=c20=c_2

Plugging c2=0c_2=0 into 0=c1+c20=c_1+c_2 to solve the system of linear equations gives

0=c1+00=c_1+0

0=c10=c_1

Plugging these values for c1c_1 and c2c_2 back into the general solution gives

Y(x)=0+(0)ex+12x2x+2xexY(x)=0+(0)e^{-x}+\frac12x^2-x+2xe^{-x}

Y(x)=12x2x+2xexY(x)=\frac12x^2-x+2xe^{-x}

 
Krista King.png
 

Get access to the complete Differential Equations course