User:Egm4313.s12.team11.sheider/R3.3: Lecture 7 p.7-11

Problem Statement
Find the complete solution to the ODE with the given initial conditions. Plot the solution y(x).

Given
$${y}''-3{y}'+2y = 4x^2\!$$

$$y(0) = 0, {y}'(0) = 0\!$$

Solution
First let us analyze the homogenous solution to the given ODE:

$${y}''-3{y}'+2y = 0\!$$

The characteristic equation for this ODE is therefore:

$$\lambda^2 - 3\lambda + 2 = 0\!$$

Solving for $$\lambda\!$$:

$$(\lambda-2)(\lambda-1) = 0\!$$

$$\lambda = {1,2}\!$$

$$\lambda_{1} = 1\!$$ and $$\lambda_{2} = 2\!$$

Therefore the equation has two real roots and a homogenous solution of the following form (from Kreyszig 2011, p.54-57):

$$ y_{h} = c_{1}e^{\lambda_{1}x} + c_{2}e^{\lambda_{2}x}\!$$

And finally we find the general homogenous solution:

$$ y_{h} = c_{1}e^{x} + c_{2}e^{2x}\!$$

Next let us evaluate the particular solution to the given ODE:

$${y}''-3{y}'+2y = 4x^2\!$$

The function on the right hand side of this equation implies that the particular solution has the following form based on Table 2.1 (from Kreyszig 2011, p.82):

$$ y_{p} = K_{n}x^n + K_{n-1}x^{n-1} + ... + K_{1}x + K_{0} \!$$

Therefore for this ODE we have:

$$ y_{p} = K_{2}x^2+K_{1}x+K_{0}\!$$

Differentiating $$ y_{p}\!$$ to obtain $${y_{p}}'\!$$ and $${y_{p}}''\!$$ respectively:

$$ {y}' = 2K_{2}x+K_{1}\!$$

$$ {y}'' = 2K_{2}\!$$

Substituting these equations into the original ODE yields:

$$ (2K_{2}) -3(2K_{2}x+K_{1}) + 2(K_{2}x^2+K_{1}x+K_{0}) = 4x^2\!$$

$$ 2K_{2} -6K_{2}x-3K_{1} + 2K_{2}x^2+2K_{1}x+2K_{0} = 4x^2\!$$

And we know that the coefficients of the variables on each side of the equation must be equal:

$$ (2K_{2})x^2 + (2K_{1}-6K_{2})x + (2K_{2} - 3K_{1} + 2K_{0}) = 4x^2\!$$

Therefore we find:

$$ 2K_{2} = 4\!$$

$$ K_{2} = 2 \!$$

Now, solving for $$ K_{1}\!$$ and $$ K_{0}\!$$:

$$ 2K_{1} - 6K_{2} = 0 \!$$

$$ 2K_{1} = 6(2) \!$$

$$ K_{1} = 6\!$$

And also: $$ 2K_{2} - 3K_{1} + 2K_{0} = 0 \!$$

$$ 2K_{0} = 3(6) - 2(2)\!$$

$$ K_{0} = 7\!$$

Finally we arrive at the particular solution:

$$ y_{p} = 2x^2 + 6x + 7\!$$

By superposition, we can find the complete general solution:

$$ y = y_{h} + y_{p}\!$$

$$ y = c_{1}e^{x} + c_{2}e^{2x} + 2x^2 + 6x + 7\!$$

Using the given initial conditions, we can solve for $$ c_{1}\!$$ and $$c_{2}\!$$, first by using the initial conditions for $$y\!$$:

$$ y(0) = c_{1} + c_{2} + 7 = 0\!$$

Differentiating the complete general solution and using the given initial condition for $${y}'\!$$:

$$ {y}' = c_{1}e^{x} + 2c_{2}e^{2x} + 4x + 6\!$$

$$ {y}'(0) = c_{1} + 2c_{2} + 6 = 0\!$$

Solving this system of equations, by solving the first equation for $$c_{1}\!$$:

$$c_{1} = -7 - c_{2}\!$$

Plugging this into the second equation yields:

$$ (-7 - c_{2}) +2c_{2} + 6 = -1 + c_{2} = 0\!$$

$$ c_{2} = 1\!$$

And therefore:

$$ c_{1} = -7 - (1)\!$$

$$ c_{1} = -8\!$$

Finally we have the complete general solution that evaluates the given initial conditions:

$$ y(x) = -8e^{x} + e^{2x} +2x^2+6x+7\!$$

A plot of $$y(x)\!$$ from $$x = -3\!$$ to $$x = 3\!$$ is shown using MatLAB:



Checking
Differentiating the solution to find $$ {y}'\!$$ and $$ {y}''\!$$ respectively:

$$ y = -8e^{x} + e^{2x} +2x^2+6x+7\!$$

$$ {y}' = -8e^{x} + 2e^{2x} +4x+6\!$$

$$ {y}'' = -8e^{x} + 4e^{2x} +4\!$$

Substituting into the original ODE yields:

$$ {y}'' - 3{y}'+2y = 4x^2\!$$

$$ (-8e^{x} + 4e^{2x} +4) -3(-8e^{x} + 2e^{2x} +4x+6) +2(-8e^{x} + e^{2x} +2x^2+6x+7) = 4x^2\!$$

$$ -8e^{x} + 4e^{2x} +4 +24e^{x} - 6e^{2x} -12x-18 -16e^{x} + 2e^{2x} +4x^2+12x+14 = 4x^2\!$$

$$ (-8+24-16)e^{x} + (4-6+2)e^{2x} + (-12+12)x + (-18+4+14) +4x^2 = 4x^2\!$$

$$ 4x^2 = 4x^2\!$$

Therefore this solution is correct.

--Egm4313.s12.team11.sheider 21:30, 21 February 2012 (UTC)