Hello everyone. This is the second part of our series to generate the exact solution of a second order ODE. In this video, specifically, we solve examples to reinforce the computation of the constants associated with the homogeneous solution and the particular solution. So here we have a second order differential equation, and we are given the initial condition for y and y', and we would like to generate the exact solution y(t). We know that the exact solution has two components: a homogeneous part and a particular part. The homogeneous part depends on the roots of the characteristic polynomial, and it will have an exponential form. The particular part depends on the right-hand side of this equation, which is a sinusoid, so we expect that the particular solution also be a sinusoid according to the schedule presented at the previous lecture. So let's start with the homogeneous solution. To get the homogeneous solution, we have to construct our characteristic polynomial. So, we are going to replace the second derivative by s², and the coefficient of the second derivative was two. We are going to replace the first derivative by S, and the coefficient of the first derivative was three. And the linear term Y, we just take the coefficient associated with it, and we set the right-hand side to zero. Now we get the roots of this equation, roots of s, and based on the root distribution, we have one of three possibilities for the homogeneous solution. Okay, so the two roots, alpha 1 and alpha 2, can be obtained as -3 +/- -3 +/- sqrt(3² - 4 * 2 * 3.25) / (2 * 2), and this gives us a complex number whose value is -0.75 +/- j1. So now you can see that our two roots are complex conjugate pairs. The real part is -0.75, the imaginary part is 1. So now we have this form associated to complex conjugate pair roots. So the homogeneous solution is equal to e^(-alpha e^(-alpha*t) (K1 cos(beta t) + K2 sin(beta t)), where alpha and beta are the real and imaginary parts of the two roots. So this is equal to e^(-0.75 t) (K1 cos(t) + K2 sin(t)). Beta is equal to 1. Okay, so this is our homogeneous solution. We have K1 and K2; there are two unknowns, and we are going to use the provided values of the two initial conditions to solve for them once we have the form of the complete solution. For the particular solution, the particular solution should take a similar form to the right-hand side of the differential equation. So here we have a sinusoid, and therefore the proposed particular solution should also be a sinusoid. According to the table from the previous slide, it would be a superposition of sine and cosine: A sin(t) + B cos(t). Now A and B are two constants; they are unknown right now, and we need to solve for them. The way to solve for them is to substitute this proposed solution for the particular part into the differential equation and solve for the value of A and B that make that equality hold. So now we need to compute the first derivative with respect to time. So from here, it is equal to A cos(t) - B sin(t). So here we have an expression for the first derivative. We do the same for the second derivative. So we need to compute the second derivative so that we can substitute the second derivative expression into the differential equation. So the second derivative is the first derivative of the first derivative, so this is equal to -A sin(t) - B cos(t). Now I have the proposed Y_p, I have the derivative. Substitute Y_p and its derivatives into that differential equation and solve for A and B that make that equation hold. So let's do the substitution together. So we have 2 times the second derivative, so second derivative is -A sin(t) - B cos(t), and then plus 3 times the first derivative, so that is A cos(t) - B sin(t), and then we have plus 3.125 Y_p, so it is A sin(t) + B cos(t). This part here is the second derivative, this part here is the first derivative, this part here is Y_p, and then the right-hand side was simply sin(t). Now you can see that the left-hand side has sinusoids: sines and cosines. So let's combine the coefficients that belong to sin(t) and the coefficients that belong to cos(t). So here we have a sin(t), a sin(t), a sin(t) here—and I made a table—this should be a cos(t). Okay, so adding up the coefficients of the sin(t) function, I have (1.125*A - 3*B). Those are the coefficients of sin(t). And then I do the same for the cos(t) function. So I have a cos(t) here, a cos(t) here, and a cos(t) here. So add these coefficients together. This would give me (1.125*B + 3*A)*cos(t). So let me rewrite it onto a different line. So it would be (1.125 B + 3 A)*cos(t). So this is how I combine the left-hand side of that equation: a sin(t) component and a cos(t) component. Then the right-hand side is equal to sin(t). Now, for the equality to hold, I have to choose the value of A and B to satisfy that equation. Now you can see that on the left-hand side we have a cos(t), but on the right-hand side we don't have any cos(t). So this suggests that this term has to be equal to zero such that this equation holds. So, I have (1.125 B + 3 A), which is the coefficient of cos(t) on the left-hand side, should equal zero because we don't have any cos(t) on the right-hand side. This is the first equation in the two unknowns A and B. The second equation that we have is that we compare the coefficient of the sin(t). On the right-hand side, the coefficient of sin(t) is one, and on the left-hand side, this is the coefficient of the sin(t). For equality to hold, we need this boxed expression to equal one. So this gives us (1.125 A - 3 B) has to equal one, and this is the second equation in the two unknowns A and B. So now we have two equations in two unknowns. We can solve simultaneously for A and B, and the solution for that is A = 0.109 and B = -0.292. So now we can complete our particular solution: Y_p equals 0.109*sin(t) - 0.292*cos(t). So now we have an expression for the homogeneous part, we have an expression for the particular part. We combine them together for the exact solution. So this is equal to e^(-0.75 e^(-0.75t) (K1 cos(t) + K2 sin(t))—this is the homogeneous part—plus (0.109*sin(t) - 0.292*cos(t)). Okay, so this gives us the exact solution. However, we still have these two unknowns, K1 and K2, which are the constants corresponding to the homogeneous solution. What we do now is that we use the initial conditions, apply them into that exact solution to solve for K1 and K2. We have two values for the initial condition. So we have Y(0) = 5, and we have dY/dt when t = 0 equal to 3 (dY(0)/dt = 3). From the expressions that we have for Y, we substitute everything equal to zero. So we have 5 = e^(-0.75 * 0) (K1 cos(0) + K2 sin(0)) + 0.109*sin(0) - 0.292*cos(0). So I use the expressions that I have for the exact solution, I substitute every t by 0 and equate to five. Now you can see that this term cancels, this is zero, and we can immediately solve for K1. So I have on the left-hand side five, this (RHS) is 1 * K1 - 0.52. From here, we have K1 = 5.292. So this is the first coefficient that we have. Now we need to get the derivative dY/dt so that we can use the second initial condition. Okay, so we already have an expression for Y(t). We take the derivative dY/dt is equal to -0.75 e^(-0.75 t) (K1 cos(t) + K2 sin(t)) + e^(-0.75 t) (-K1 sin(t) + K2 cos(t)). So this is the derivative of the homogeneous part. And then we take the derivative of the particular part. It would give us 0.109 cos(t) + 0.292 sin(t). So this part here is the derivative of the particular part. Now we use the initial condition dY/dt when t = 0 was given to us as three. So in this expression for the derivative, we substitute every t = 0. So we have -0.75 e^(-0) (K1 cos(0) + K2  sin(0)) + e^(0) (-K1 sin(0) + K2 cos(0)) + 0.109 cos(0) + 0.292 sin(0). So now this is an equation. We have the values of the sines and cosines. We already solved for K1 in the previous step, so the only unknown in this equation is K2. So let's just clean up this equation. It will give us three on the left-hand side, and from our expression we have -0.75 K1 + K2 + 0.109. We already know K1 from the previous step, so substitute the value that we have for K1. So we get 3 = -0.75 * 5.292 + K2 + 0.109. The only unknown here is K2, and this gives us K2 equals to 6.859. So now we have a solution for K1 and K2. Then the complete solution can be given as follows. We already had the expression; the only missing part was K1 and K2. We solved for them, so we add them here. So this is e^(-0.75 t) (K1 = 5.292 cos(t) + K2 = 6.859 sin(t)). So this completes the homogeneous solution plus the particular solution, which was 0.19 sin(t) - 0.292 cos(t). So this is the complete solution after solving for all the unknowns, and this completes the solution for this problem. Thank you.