Itnitial value problems are solved by applying the initial conditions to the general solution of a differential equation. Note that the initial conditions are applied only to the general solution and not to the homogeneous solution yh, even though it is yh that possesses all the arbitrary constants to be evaluated. The only exception is when the general solution is the homogeneous solution, that is when the differential equation under consideration is itself homogeneous.
Example 1. Solve y′′+y′−2y=0, y(0)=1, y′(0)=2.
This is a homogeneous differential equation. The characteristic equation is r2+r−2=0, or (r+2)(r−1)=0, which has the roots r1=−2, r2=1.
So, the general solution is y=c1e−2x+c2ex.
Thus, y′=−2c1e−2x+c2ex.
Applying the initial conditions gives
{y(0)=1=c1e−2⋅0+c2e0y′(0)=2=−2c1e−2⋅0+c2e0,
Or
{c1+c2=1−2c1+c2=2.
Subtracting the second equation from the first gives 3c1=−1, or c1=−31.
From the first equation, c2=1−c1=1−(−31)=34.
So, the solution is y=−31e−2x+34ex.
Now, let's do some more practice.
Example 2. Solve y′′+2y′+y=cos(t), y(0)=3, y′(0)=0.
First, solve the corresponding homogeneous equation y′′+2y′+y=0. The characteristic equation is r2+2r+1=0, or (r+1)2=0, which has the roots r1=−1,r2=−1.
There is one root of the multiplicity 2; so, the solution of the homogeneous equation is yh=c1e−t+c2te−t.
Once again, we don't apply the initial conditions on this stage. We first have to find the general solution (in this case, yh+yp) and only then apply the initial conditions.
To find the particular solution, use the method of undetermined coefficients.
Assume that yp=Acos(t)+Bsin(t). Then, yp′=−Asin(t)+Bcos(t), and yp′′=−Acos(t)−Bsin(t).
Plugging this into the equation gives
−Acos(t)−Bsin(t)+2(−Asin(t)+Bcos(t))+Acos(t)+Bsin(t)=2Bcos(t)−2Asin(t).
Equating the like terms with cos(t) gives
{2B=1−2A=0,
Which has solution A=0,B=21.
So, yp=21sin(t).
Thus, the general solution is y=yh+yp=c1e−t+c2te−t+21sin(t).
Now, we can use the initial conditions.
For this, find the derivative of the general solution: y′=−c1e−t+c2e−t−c2te−t+21cos(t).
So,
{y(0)=3=c1e−0+c2⋅0⋅e−0+21sin(0)y′(0)=0=−c1e−0+c2e−0−c2⋅0⋅e−0+21cos(0),
Or
{c1=3−c1+c2=−21,
Which has the solution c1=3, c2=25.
Finally, the solution is y=3e−t+25te−t+21sin(t).