User:Egm4313.s12.team8/R2

=R2.1 - Find and plot the solution to an ODE, and write 3 ODEs with the same roots=

Problem Statement
Part i) Find the non-homogeneous L2-ODE-CC in standard form and the solution for the ODE in terms of the initial conditions ($$\displaystyle y(0)=1$$ $$\displaystyle y'(0)=0$$) and the general excitation where $$\displaystyle r(x)=0$$, and plot the solution.

Part ii) Generate 3 non-standard, non-homoegeneous L2-ODE-CC that yield the same two roots of the characteristic equation as in Part i.

Part i
The standard form of a standard non-homogeneous L2-ODE-CC is: $$\displaystyle y''+ay'+by=r(x)$$

First, we use the given lambas to find the characteristic equation for the homogeneous solution:

Since,

then,

So,

The answer will be in the form of:

Differentiating the homogeneous solution gives:

By substituting Eqn. 1a into Eqn. 1b, we get:

By multiplying and combining like terms we get $$\displaystyle c_1$$:

Then we substitute $$\displaystyle c_1$$ back into Eqn 2a to get $$\displaystyle c_1$$:

So the solution to the ODE is:



This is a graph of the solution to the ODE: $$\displaystyle y(x)=\frac{5}{7}e^{-2x}+\frac{2}{7}e^{5x}$$
 * }

Part ii
=R2.2 - Find and plot solution to homogeneous ODE=

Problem Statement
Find and plot the solution for the L2-ODE-CC Eqn. 4 ($$\displaystyle y''-10y'+25y=r(x)$$) on p. 5-5 in the lecture notes. The initial conditions are $$\displaystyle y(0)=1$$,  $$\displaystyle y'(0)=0$$ with no excitation ($$\displaystyle r(x)=0$$)

Solution
Also because $$\displaystyle r(x)=0$$, the ODE becomes:

Which can be written as the characteristic equation:

Factoring the characteristic equation gives:

Which solves giving a double real root:

The double real root means the solution will have the form:

The first homogeneous solution is:

The second homogeneous solution for a double real root takes the form:

The final homogeneous solution is:

Applying the initial condition $$\displaystyle y(0)=1$$ to the solution gives:

The updated solution is: Differentiting the solution gives: Applying the second initial condition, $$\displaystyle y'(0)=0$$ gives:

The final solution is:



The graph above is a MATLAB plot of the solution to the ODE: $$\displaystyle y(x)=e^{5x}-5xe^{5x}$$

=R2.3 - General solution to 2 ODEs with real roots and complex roots=

Problem Statement
Find a general solution. Check your answer by substitution. a) $$\displaystyle y+6y'+8.96y=0$$    (3-1)  b)$$\displaystyle y+4y'+(\pi^2+4)y=0$$    (3-2)

Solution
The quadratic formula is necessary for these solutions: $$\displaystyle \frac{-b\pm \sqrt{b^2-4ac}}{2a}$$

Part a
Plugging into the quadratic formula: $$\displaystyle \frac{-6\pm \sqrt{6^2-(4)(1)(8.96)}}{2(1)}=\frac{-6\pm .4}{2}$$ This shows us that the roots of the equation are: $$\displaystyle \lambda_{1} =-2.8, \lambda _{2}=-3.2$$ Therefore, the general equation is: $$\displaystyle y=c_{1}e^{-2.8x}+c_{2}e^{-3.2x}$$    (3-3)

Substitution
We need to first find the first and second derivatives of equation (3-3): $$\displaystyle y'=-3.2c_{1}e^{-3.2x}-2.8c_{2}e^{-2.8x}$$ $$\displaystyle y''=10.24c_{1}e^{-3.2x}+7.84c_{2}e^{-2.8x}$$ Plugging into equation (3-1), we find: $$\displaystyle (10.24c_{1}e^{-3.2x}+7.84c_{2}e^{-2.8x})+6(-3.2c_{1}e^{-3.2x}-2.8c_{2}e^{-2.8x})+8.96(c_{1}e^{-3.2x}+c_{2}e^{-2.8x})=0$$    (3-4) Continuing to solve: $$\displaystyle 19.2c_{1}e^{-3.2x}+16.8c_{2}e^{-2.8x} -19.2c_{1}e^{-3.2x}-16.8c_{2}e^{-2.8x}=0$$    (3-5) This shows that the general equation is correct, since everything cancels out to 0.

Part b
Plugging into the quadratic formula: $$\displaystyle \frac{4\pm\sqrt{4^{2}-4(1)(\pi^2 +4)}}{2(1)}=\frac{-4\pm (-4)(1))(pi^2+4)}{2(1)} $$ The roots are, therefore:  $$\displaystyle \lambda _{1}=-2-\pi i, \lambda _{2}=-2+\pi i$$  Therefore, the general solution to (3-2) is:  $$\displaystyle y=c_{1}\cos(\pi x)e^{-2x} + c_{2}\sin(\pi x)e^{-2x}$$     (3-6)

Substitution
We must first find the first and second derivatives of equation (3-6): $$\displaystyle y'= -2(c_{1} \cos (\pi x) + c_{2} \sin (\pi x))e^{-2x} + (-c_{1} \pi \sin (\pi x) + c_{2} \pi \cos (\pi x))e^{-2x}$$ $$\displaystyle y''= - 2(-c_{1} \pi \sin (\pi x) + c_{2}\pi \cos (\pi x))e^{-2x} + (-c_{1} \pi ^2 \cos (\pi x) - c_{2} \pi ^2 \sin (\pi x))e^{-2x}$$ Plugging into equation (3-2): $$\displaystyle - 2(-c_{1} \pi \sin (\pi x) + c_{2}\pi \cos (\pi x))e^{-2x} + (-c_{1} \pi ^2 \cos (\pi x) - c_{2} \pi ^2 \sin (\pi x))e^{-2x}...$$ $$\displaystyle+4[-2(c_{1} \cos (\pi x) + c_{2} \sin (\pi x))e^{-2x} + (-c_{1} \pi \sin (\pi x) + c_{2} \pi \cos (\pi x))e^{-2x}]+(\pi^2+4)(c_{1}\cos(\pi x)e^{-2x} + c_{2}\sin(\pi x)e^{-2x})=0$$ Finally, plugging (3-6) and it's first and second derivatives into equation (3-2), we find: $$\displaystyle 4(c_{1} \cos (\pi x) + c_{2} \sin (\pi x))e^{-2x} - 2(-c_{1} \pi \sin (\pi x) + c_{2} \pi \cos (\pi x))e^{-2x} - 2(-c_{1} \pi \sin (\pi x) + c_{2} \pi \cos (\pi x))e^{-2x}...$$ $$\displaystyle+(-c_{1}\pi ^2 \cos (\pi x) - c_{2} \pi ^2 \sin (\pi x))e^{-2x} +4 -2(c_{1} \cos (\pi x) + c_{2} \sin (\pi x))e^{-2x}) +...$$ $$\displaystyle (-c_{1} \pi \sin (\pi x) + c_{2} \pi \cos (\pi x))e^{-2x}+(\pi^{2}+4)((c_{1}\cos(\pi x) + c_{2}\sin(\pi x))e^{-2x})=0$$  Since this equals 0, we know that the general equation (3-6) is correct.

=R2.4 - General solution to 2 ODEs with repeated roots=

Problem Statement
Find a general solution. Check your answer by substitution. (Advanced Engineering Mathematics, Tenth Edition, Kresyzig, Problem set 2.2 pg.59)

5. $$y''+2{\pi}y'+{\pi}^2y=0$$
Find the characteristic equation:

$$r^2+2{\pi}r+{\pi}^2=0$$

A single real root exists at $$r={-\pi}$$ leading to a general solution of:

$$y=C_1e^{rx}+C_2xe^{rx}$$

Substituting $$r={-\pi}$$ gives the general solution:



To check by substitution first express $$y$$, $$y'$$, and $$y''$$:

$$y=C_1e^{{-\pi}x}+C_2xe^{{-\pi}x}$$

$$y'=-C_1{\pi}e^{{-\pi}x}-C_2x{\pi}e^{{-\pi}x}+C_2e^{{-\pi}x}$$

$$y''=C_1{\pi}^2e^{{-\pi}x}+C_2x{\pi}^2e^{{-\pi}x}-2C_2{\pi}e^{{-\pi}x}$$

Substitute into the original equation:

$$C_1{\pi}^2e^{{-\pi}x}+C_2x{\pi}^2e^{{-\pi}x}-2C_2{\pi}e^{{-\pi}x}+2{\pi}(-C_1{\pi}e^{{-\pi}x}-C_2x{\pi}e^{{-\pi}x}+C_2e^{{-\pi}x})+{\pi}^2C_1e^{{-\pi}x}+C_2xe^{{-\pi}x}=0$$

Canceling like terms leaves 0=0, showing the general solution is correct.

6. $$10y''-32y'+25.6y=0$$
First divide each term by the $$y''$$ coefficient of 10 to get the equation in standard form:

$$y''-3.2y'+2.56y=0$$

Find the characteristic equation:

$$r^2-3.2r+2.56=0$$

A single real root exists at $$r=1.6$$ leading to a general solution of:

$$y=C_1e^{rx}+C_2xe^{rx}$$

Substituting $$r=1.6$$ gives the general solution:



To check by substitution first express $$y$$, $$y'$$, and $$y''$$:

$$y=C_1e^{1.6x}+C_2xe^{1.6x}$$

$$y'=C_1{1.6}e^{1.6x}+C_2x{1.6}e^{1.6x}+C_2e^{1.6x}$$

$$y''=C_1{1.6}^2e^{1.6x}+C_2x1.6^2e^{1.6x}+2C_21.6e^{1.6x}$$

Substitute into the original equation:

$$C_1{1.6}^2e^{1.6x}+C_2x1.6^2e^{1.6x}+2C_21.6e^{1.6x}-3.2(C_1{1.6}e^{1.6x}+C_2x{1.6}e^{1.6x}+C_2e^{1.6x})+2.56(C_1e^{1.6x}+C_2xe^{1.6x})=0$$

Canceling like terms leaves 0=0, showing the general solution is correct.

=R2.5 - Determine ODE from provided basis=

Problem Statement
Kreyszig 2011 p.59 pbs.16-17

For the given basis, find an ODE of the form:
 * $$\displaystyle y'' + ay' + by = 0 $$    (1)  

16. $$ \displaystyle e^{2.6x}, e^{-4.3x} $$

17. $$ \displaystyle e^{- \sqrt{5}x}, xe^{- \sqrt{5}x} $$

Problem 16
Note: Given $$ \displaystyle y = e^{\lambda x} $$ as a solution of the second-order homogeneous linear ODE, the characteristic equation (or auxiliary equation) is defined as

$$ \displaystyle \lambda^2 + a\lambda + b = 0. $$  [K2011 p54]

The problem gives us two distinct real-roots:

$$ \displaystyle \lambda_{1} = 2.6 $$ and $$ \displaystyle \lambda_{2} = -4.3. $$

Solving the quadratic equation above gives us $$ \displaystyle \lambda_{1} = \frac {-a + \sqrt{a^2 - 4b}} 2 = \frac {1}{2} (-a + \sqrt{a^2 - 4b}) = 2.6, $$ and $$ \displaystyle \lambda_{2} = \frac {-a - \sqrt{a^2 - 4b}} 2 = \frac {1}{2} (-a - \sqrt{a^2 - 4b}) = -4.3 $$

or $$ \displaystyle \lambda_{1} = (-a + \sqrt{a^2 - 4b}) = 5.2, $$ and $$ \displaystyle \lambda_{2} = (-a - \sqrt{a^2 - 4b}) = -8.6. $$

Summing $$ \displaystyle \lambda_{1} $$ and $$ \displaystyle \lambda_{2} $$ we can eliminate the discriminant $$ -a + \sqrt{a^2 - 4b} $$ and solve for $$ \displaystyle a $$ $$ \displaystyle -2a = -3.4 $$ $$ \displaystyle a = 1.7 $$

Plugging $$ \displaystyle a $$ back into either $$ \displaystyle \lambda_1 $$ or $$ \displaystyle \lambda_2, $$ we can solve for $$ \displaystyle b $$

$$ \displaystyle -1.7 + \sqrt{1.7^2-4b} = 5.2$$ $$ \displaystyle     \sqrt{2.89-4b} = 6.9$$ $$ \displaystyle 2.89 - 4b = 44.61$$ $$ \displaystyle -4b = 44.72$$ $$ \displaystyle b = -11.18$$

Now plugging $$ \displaystyle a $$ and $$ \displaystyle b $$ back into the general ODE, we have $$ \displaystyle y'' + 1.7y' - 11.18y = 0 $$

Problem 17
Given the basis: $$ \displaystyle e^{- \sqrt{5}x}, xe^{- \sqrt{5}x}, $$ we know we get only one root $$ \displaystyle \lambda = \lambda_1 = \lambda_2 = - \frac {a}{2}. $$ [K2011 p.55]

Thus, the discriminant $$ \displaystyle a^2 - 4b = 0. $$    (2)  

Knowing $$ \displaystyle \lambda = - \frac {a}{2} $$ for the given basis, we can say $$ \displaystyle e^{- \frac {a}{2} x} = e^{- \sqrt{5}x} $$

to solve for unknown $$ \displaystyle a. $$

$$ \displaystyle - \frac {a}{2} = - \sqrt {5} $$ $$ \displaystyle a = 2 \sqrt {5} $$

Plugging $$ \displaystyle a $$ into the discriminant gives us $$ \displaystyle ({2 \sqrt {5}})^2 - 4b = 0 $$ $$ \displaystyle b = \frac {20}{4} = 5. $$

Now substituting $$ \displaystyle a $$ and $$ \displaystyle b $$ into the general ODE gives us our solution: $$ \displaystyle y'' + 2 \sqrt{5} y' + 5y = 0 $$

=R2.6 - Solve for parameters of a spring-dashpot system with given characteristic equation=

Problem Statement
Realize spring-dashpot-mass systems in series as shown in Fig. 1 below with the given characteristic equation and double real roots $$ \lambda = -3 $$. Find the values for the parameters k,c,m.

Given
from [[media:iea.s12.sec1.djvu|R1.1 in Sec 1 p. 1-5]]

The equation of motion of the spring-dashpot-mass system is as follows: $$\displaystyle m(y_k''+\frac{k}{c}y_k')+ky_k=f(t) $$

Double real roots: $$\displaystyle \lambda=-3 $$

Solution
Since we know the roots of the system we obtain the following characteristic equation:

$$\displaystyle (\lambda+3)^2=\lambda^2+6\lambda+9$$ (1) The equation of motion is: $$\displaystyle m(y_k''+\frac{k}{c}y_k')+ky_k=f(t) $$ (2)

We can get (1) and (2) to be in the same form by distributing the m in (2). $$\displaystyle my_k''+\frac{mk}{c}y_k'+ky_k=f(t) $$ (2a)

Now we can use coefficient matching to equate the coefficients of (1) and (2):

$$\displaystyle m=1$$ $$\displaystyle \frac{mk}{c}=6$$ $$\displaystyle k=9$$

Therefore: $$\displaystyle m=1,$$ $$\displaystyle c=\frac{3}{2},$$ $$\displaystyle k=9$$

=R2.7 - Maclaurin Series of $$e^t$$, $$\cos{t}$$ and $$\sin{t}$$=

Problem Statement
Develop the Maclaurin series (Taylor Series at t=0) for $$\displaystyle e^{t},cos(t),sin(t)$$ a) $$\displaystyle e^{t}$$    (7-1)  b)$$\displaystyle cos(t)$$    (7-2) c)$$\displaystyle sin(t)$$    (7-3)

Solution
For a Taylor series at any point t, the general form is as follows (to make it more clear, I have changed the usual t in (t-a) to a capital T): $$ \sum_{n=0}^{\infty} \frac{f^n(a)}{n!} (T-a)^n=f(a) + \frac{f'(a)}{1!}(T - a) + \frac{f^2(a)}{2!}(T - a)^2 + \frac{f^3(a)}{3!}(T- a)^3 + \frac{f^4(a)}{4!}(T - a)^4 ... (7-4)$$

Part a solution
Using (7-4) as applied to (7-1) at time t=0 gives us the Maclaurin series for (7-1): $$\displaystyle e^t = \sum_{n=0}^{\infty} \frac{T^n}{n!}=e^0 + \frac{e^0}{1!}(T) + \frac{e^0}{2!}(T)^2 + \frac{e^0}{3!}(T)^3 + \frac{e^0}{4!}(T)^4 ... (7-6)$$ Simplifying this result, we obtain our final solution: $$\displaystyle e^t = 1 + T + \frac{T^2}{2} + \frac{T^3}{6} + \frac{T^4}{24} ... (7-7) $$

Part b solution
Using (7-4) as applied to (7-2) at time t=0 gives us the Maclaurin series for (7-2): $$\displaystyle cos(t) = \sum_{n=0}^{\infty} \frac{(-1)^nT^{2n}}{(2n)!} = cos(0) + \frac{-sin(0)}{1!}(T) + \frac{-cos(0)}{2!}(T)^2 + \frac{sin(0)}{3!}(T)^3 + \frac{cos(0)}{4!}(T)^4 + ... (7-8)$$ Simplifying this result, we obtain our final solution: $$\displaystyle cos(t) = \sum_{n=0}^{\infty} \frac{(-1)^nT^{2n}}{(2n)!} = 1-\frac{T^2}{4}+\frac{T^4}{24} ... (7-9)$$

Part c solution
Using (7-5) as applied to (7-3) at time t=0 gives us the Maclaurin series for (7-3): $$\displaystyle sin(t) = \sum_{n=0}^{\infty} \frac{(-1)^nT^{2n + 1}}{(2n + 1)!} = sin(0) + \frac{cos(0)}{1!}(T) + \frac{-sin(0)}{2!}(T)^2 + \frac{-cos(0)}{3!}(T)^3 + \frac{sin(0)}{4!}(T)^4 + ... (7-10)$$ Simplifying this result, we obtain our final solution: $$\displaystyle sin(t) = T - \frac{T^3}{6} + ... (7-11)$$

=R2.8 - General solution to 2 ODEs with complex roots=

Problem Statement
Find a general solution. Check your answer by substitution.

Part A:
 * $$\displaystyle y'' + y' + 3.25y = 0$$

Part B:
 * $$y'' + 0.54 y' + \left(0.0729 + \pi\right) y = 0$$

Finding the General Solution
Assume solutions are proportional to $$e^{rt}$$:
 * $$e^{rt}\left(r^2 + r + 3.25\right) = 0$$

Observe $$e^{rt} \neq 0$$ for any $$t$$:
 * $$\displaystyle r^2 + r + 3.25 = 0$$

Solve for $$r$$:
 * $$r = -\frac{1}{2} \pm \sqrt{3} i$$

Substitute in $$r$$ for initial assumption:
 * $$y(t) = c_1 e^{\left(-\frac{1}{2} + \sqrt{3} i\right) t} + c_2 e^{\left(-\frac{1}{2} - \sqrt{3} i\right) t}$$

Expand the solution using Euler's identity ($$e^{a + bi}=e^{a}\left(\cos{b} + i\sin{b}\right)$$):
 * $$\begin{align}

y(t) &= c_1 e^{-\frac{1}{2} t} \left(\cos{\sqrt{3} t} + i\sin{\sqrt{3} t}\right) \\ &+ c_2 e^{-\frac{1}{2} t} \left(\cos{\sqrt{3} t} - i\sin{\sqrt{3} t}\right) \end{align}$$ Collect like terms:
 * $$\begin{align}

y(t) &= \left(c_1 + c_2\right) e^{-\frac{1}{2} t} \cos{\sqrt{3} t} \\ &+ \left(c_1 - c_2\right) i e^{-\frac{1}{2} t} \sin{\sqrt{3} t} \end{align}$$ Define new constants $$c'_1 = c_1 + c_2$$ and $$c'_2 = \left(c_1 - c_2\right) i$$: $$y(t) = c'_1 e^{-\frac{1}{2} t} \cos{\sqrt{3} t} + c'_2 e^{-\frac{1}{2} t} \sin{\sqrt{3} t}$$

Checking by Substitution
Determine $$3.25 y$$, $$y'$$, and $$y''$$ from $$y(t)$$:
 * $$\begin{array}{rllrlrllcrrlcll}

3.25 & y  & = e^{-\frac{1}{2} t} (   &  \frac{13}{4} & c'_1 &               &        & \cos{\sqrt{3} t} & + &   &           &      &   \frac{13}{4} & c'_2   & \sin{\sqrt{3} t} ) \\ & y' & = e^{-\frac{1}{2} t} ( ( & -\frac{1}{2}  & c'_1 & + \; \sqrt{3} & c'_2 ) & \cos{\sqrt{3} t} & + & ( & -\sqrt{3} & c'_1 & - \frac{1}{2}  & c'_2 ) & \sin{\sqrt{3} t} ) \\ & y'' & = e^{-\frac{1}{2} t} ( ( & -\frac{11}{4} & c'_1 & - \; \sqrt{3} & c'_2 ) & \cos{\sqrt{3} t} & + & ( & \sqrt{3} & c'_1 & - \frac{11}{4} & c'_2 ) & \sin{\sqrt{3} t} ) \end{array}$$ Substitute into original ODE:
 * $$\begin{array}{rrrcrllrlrlll}

( e^{-\frac{1}{2} t} & ( ( & -\frac{11}{4} & c'_1 & - \; \sqrt{3} & c'_2 ) & \cos{\sqrt{3} t} + ( & \sqrt{3} & c'_1 & - \frac{11}{4} & c'_2 ) & \sin{\sqrt{3} t} ) ) & \\ + \; ( e^{-\frac{1}{2} t} & ( ( & -\frac{1}{2} & c'_1 & + \; \sqrt{3} & c'_2 ) & \cos{\sqrt{3} t} + ( & -\sqrt{3} & c'_1 & - \frac{1}{2}  & c'_2 ) & \sin{\sqrt{3} t} ) ) & \\ + \; ( e^{-\frac{1}{2} t} & (  &  \frac{13}{4} & c'_1 &               &        & \cos{\sqrt{3} t} +   &           &      &   \frac{13}{4} & c'_2   & \sin{\sqrt{3} t} ) ) & = 0 \end{array}$$ Reduce: $$\displaystyle 0 = 0$$

Finding the General Solution
Assume solutions are proportional to $$e^{rt}$$:
 * $$e^{rt}\left(r^2 + 0.54 r + \left(0.0729 + \pi\right)\right) = 0$$

Observe $$e^{rt} \neq 0$$ for any $$t$$:
 * $$r^2 + 0.54 r + \left(0.0729 + \pi\right) = 0$$

Rearrange by completing the square:
 * $$\left(r + 0.27\right)^2 + \pi = 0$$

Solve for $$r$$:
 * $$r = -0.27 \pm \sqrt{\pi} i$$

Substitute in $$r$$ for initial assumption:
 * $$y(t) = c_1 e^{\left(-0.27 + \sqrt{\pi} i\right) t} + c_2 e^{\left(-0.27 - \sqrt{\pi} i\right) t}$$

Expand the solution using Euler's identity ($$e^{a + bi}=e^{a}\left(\cos{b} + i\sin{b}\right)$$):
 * $$\begin{align}

y(t) &= c_1 e^{-0.27 t} \left(\cos{\sqrt{\pi} t} + i\sin{\sqrt{\pi} t}\right) \\ &+ c_2 e^{-0.27 t} \left(\cos{\sqrt{\pi} t} - i\sin{\sqrt{\pi} t}\right) \end{align}$$ Collect like terms:
 * $$\begin{align}

y(t) &= \left(c_1 + c_2\right) e^{-0.27 t} \cos{\sqrt{\pi} t} \\ &+ \left(c_1 - c_2\right) i e^{-0.27 t} \sin{\sqrt{\pi} t} \end{align}$$ Define new constants $$c'_1 = c_1 + c_2$$ and $$c'_2 = \left(c_1 - c_2\right) i$$: $$\displaystyle y(t) = c'_1 e^{-0.27 t} \cos{\sqrt{\pi} t} + c'_2 e^{-0.27 t} \sin{\sqrt{\pi} t}$$

Checking by Substitution
Determine $$( 0.0729 + \pi ) y$$, $$0.54 y'$$, and $$y''$$ from $$y(t)$$:
 * $$\begin{array}{rllrlrllcrrlcll}

( 0.0729 + \pi ) & y  & = e^{-0.27 t} (   &  ( 0.0729 + \pi )  & c'_1 &                        &        & \cos{\sqrt{\pi} t} & + &   &                     &      & ( 0.0729 + \pi )  & c'_2   & \sin{\sqrt{\pi} t} ) \\ & y' & = e^{-0.27 t} ( ( &            -0.27   & c'_1 & + \;               \sqrt{\pi} & c'_2 ) & \cos{\sqrt{\pi} t} & + & ( &                -\sqrt{\pi} & c'_1 &       - \; 0.27   & c'_2 ) & \sin{\sqrt{\pi} t} ) \\ 0.54 & y' & = e^{-0.27 t} ( ( & -2 \times  0.0729  & c'_1 & + \; 2 \times 0.27 \sqrt{\pi} & c'_2 ) & \cos{\sqrt{\pi} t} & + & ( & - 2 \times 0.27 \sqrt{\pi} & c'_1 & - \; 2 \times 0.0729 & c'_2 ) & \sin{\sqrt{\pi} t} ) \\ & y'' & = e^{-0.27 t} ( ( & ( 0.0729 - \pi ) & c'_1 & - \; 2 \times 0.27 \sqrt{\pi} & c'_2 ) & \cos{\sqrt{\pi} t} & + & ( &  2 \times 0.27 \sqrt{\pi} & c'_1 & + \; (0.0729 - \pi) & c'_2 ) & \sin{\sqrt{\pi} t} ) \end{array}$$ Substitute into original ODE:
 * $$\begin{array}{rrrlrlllrrllll}

( e^{-0.27 t} & ( ( & ( -\pi + 0.0729 )  & c'_1 & - \; 2 \times 0.27 \sqrt{\pi} & c'_2 ) & \cos{\sqrt{\pi} t} & + \; ( &   2 \times 0.27 \sqrt{\pi} & c'_1 & + \; ( 0.0729 - \pi) & c'_2 ) & \sin{\sqrt{\pi} t} ) ) & \\ + \; ( e^{-0.27 t} & ( ( & -2 \times 0.0729   & c'_1 & + \; 2 \times 0.27 \sqrt{\pi} & c'_2 ) & \cos{\sqrt{\pi} t} & + \; ( & - 2 \times 0.27 \sqrt{\pi} & c'_1 & - \; 2 \times 0.0729 & c'_2 ) & \sin{\sqrt{\pi} t} ) ) & \\ + \; ( e^{-0.27 t} & (  &  ( 0.0729 + \pi  )  & c'_1 &                               &        & \cos{\sqrt{\pi} t} & +   &                            &      & ( 0.0729 + \pi )  & c'_2   & \sin{\sqrt{\pi} t} ) ) & = 0 \end{array}$$ Reduce: $$\displaystyle 0 = 0$$

=R2.9 - Particular solution to a homogeneous ODE=

Problem Statement
$$ \displaystyle \lambda^{2}+4\lambda+13=0  $$

Initial Conditions:

$$ \displaystyle y(0)=1   $$    and    $$ \displaystyle  {y}'(0)=0   $$

No excitation:

$$ \displaystyle r(x)=0   $$

Solution
Written in standard form:

$$ \displaystyle {y}''+4 {y}'+13 y=0  $$

The equation follows the characteristic equation:

$$ \displaystyle {y}''+a {y}'+b y=0  $$

Therefore:

$$ \displaystyle   a=4   $$  and  $$ \displaystyle    b=13   $$

Calculating the discriminant, we can then decide which case this problem follows.

$$ \displaystyle   a^{2}-4b =  4^{2}-4(13) = 16-52 = -36   $$

Since the discriminant is less than 0, the problem will follow Case III, complex conjugate roots.

The general solution will then take the form of:

$$ \displaystyle  y=e^{-ax/2}(Acos(wx)+Bsin(wx))  $$

Where:

$$ \displaystyle   w= \sqrt{b-\frac{1}{4}a^{2}}    $$    and    $$   \displaystyle   a=4   $$ (as previously stated)

Therefore:

$$ \displaystyle   w= \sqrt{13-\frac{1}{4}(4)^{2}} =  \sqrt{9}  = 3 $$

We can now substitute these values back into the general solution, obtaining:

$$ \displaystyle  y=e^{-2x}(Acos(3x)+Bsin(3x))  $$

We now take the general solution's derivative.

$$ \displaystyle  y(x)=e^{-2x}(Acos(3x)+Bsin(3x))  $$

$$ \displaystyle  {y}'(x)=e^{-2x}(-3Asin(3x)+3Bcos(3x))-2e^{-2x}(Acos(3x)+Bsin(3x)) $$

We can now use the given initial conditions to solve for the unknown constants A and B.

$$ \displaystyle  y(0)=1,  {y}'(0)=0   $$

$$ \displaystyle  y(0)=e^{-2(0)}(Acos(3(0))+Bsin(3(0)))=1  $$

$$ \displaystyle  {y}'(0)=e^{-2(0)}(-3Asin(3(0))+3Bcos(3(0)))-2e^{-2(0)}(Acos(3(0))+Bsin(3(0)))=0 $$

Reducing to the following system of equations:

$$ \displaystyle  A=1   $$

$$ \displaystyle  3B-2A=0 $$

Solving this system, the constants A and B can be found as:

$$ \displaystyle  A=1, B=\frac{2}{3} $$

Replacing these constants back into the equation, we can obtain the final solution:

Figures
Graph of Solution to 2.9

Matlab code:

>> x=linspace(-3,2);

>> f= exp(-2*x).*(cos(3*x)+.666*sin(3*x))

>> plot(x,f)

>> xlabel('x')

>> ylabel('y')



Graph of 2.9, 2.6, and 2.1

a) from R2.9 (blue) $$ \displaystyle y(x)=e^{-2x}(cos(3x)+\frac{2}{3}sin(3x))   $$

b) from R2.6 (green) $$ \displaystyle y(x)=e^{-3x}+3xe^{-3x}      $$

c) from R2.1 (red) $$ \displaystyle   y(x)=\frac{5}{7}e^{-2x}+\frac{2}{7}e^{5x}     $$

Matlab code:

x = linspace(-3,2);

f = exp(-2*x).*(cos(3*x)+2/3*sin(3*x)); g = exp(-3*x) + 3 * x .* exp(-3*x); h = 5/7 * exp(-2*x) + 2/7*exp(5*x);

fl=sign(f) .* log(abs(f) + 1); gl=sign(g) .* log(abs(g) + 1); hl=sign(h) .* log(abs(h) + 1);

plot(x,f,x,g,x,h) xlabel('x') ylabel('y')



plot(x,fl,x,gl,x,hl) xlabel('x') ylabel('sign(y) * log(abs(y) + 1)')



=R2.10 - Solution to a non-homogeneous ODE=

Problem Statement
Consider the same system as in the Example p.7-3, i.e., with the same L2-ODE-CC (4) p.5-5 and initial conditions (2) p.3-4, but with the following excitation:
 * $$r(x)\;=\;7e^{5x}\,-\,2x^2$$

(4) p.5-5: $$y''\,-\,10y'\,+\,25\;=\;r(x)$$

(2) p.3-4: $$\displaystyle y(0) = 4\text{, }y'(0) = -5$$

Find the homogeneous solution
Solve the characteristic equation:
 * $$\left(\lambda - 5\right)^2 = 0$$


 * $$\displaystyle\lambda = 5$$

The homogeneous solution is then:
 * $$\displaystyle y_h(x) = K_1 e^{5x} + K_2 x e^{5x}$$

Find the particular solution
Following the sum and modification rule from p.7-2:
 * $$\begin{align}

7e^{5x} &\Rightarrow C_1 x^2 e^{5x} \\ -2x^2 &\Rightarrow C_2 x^2 + C_3 x + C_4 \end{align}$$

By the sum rule:
 * $$\displaystyle y_p(x) = C_1 x^2 e^{5x} + C_2 x^2 + C_3 x + C_4$$

Taking derivatives:
 * $$\begin{align}

y'_p(x) &= C_1 e^{5x} \left(5 x^2 + 2 x\right) + 2 C_2 x + C_3 \\ y''_p(x) &= C_1 e^{5x} \left(5\left(5 x^2 + 2 x\right) + 10 x + 2\right) + 2 C_2 \\ &= C_1 e^{5x} \left(25 x^2 + 20 x + 2\right) + 2 C_2 \end{align}$$

Substitute particular solution and its derivatives into the original ODE:
 * $$\begin{align}

&\left(C_1 e^{5x} \left(25 x^2 + 20 x + 2\right) + 2 C_2\right) \\ - 10 &\left(C_1 e^{5x} \left(5 x^2 + 2 x\right) + 2 C_2 x + C_3\right) \\ + 25 &\left(C_1 x^2 e^{5x} + C_2 x^2 + C_3 x + C_4\right) \\ &= 7 e^{5x} - 2 x^2 \end{align}$$

Reduce:
 * $$2 C_1 e^{5x} + 25 C_2 x^2 + \left(-20 C_2 + 25 C_3\right) x + \left(2 C_2 - 20 C_3 + 25 C_4\right) = 7 e^{5x} - 2 x^2$$

Equate coefficients from each side:
 * $$\begin{align}

2 C_1 &= 7 \\ 25 C_2 &= -2 \\ -20 C_2 + 25 C_3 &= 0 \\ 2 C_2 - 20 C_3 + 25 C_4 &= 0 \end{align}$$

Solve for constants:
 * $$\begin{align}

C_1 &= \frac{7}{2} \\ C_2 &= -\frac{2}{25} \\ C_3 &= -\frac{8}{125} \\ C_4 &= -\frac{12}{625} \end{align}$$

Substitute in constants to find particular solution:
 * $$y_p(x) = \frac{7}{2} x^2 e^{5x} - \frac{2}{25} x^2 - \frac{8}{125} x - \frac{12}{625}$$

Finding the solution

 * $$\begin{align}

y(x) &= y_h(x) + y_p(x) \\ &= \left(K_1 e^{5x} + K_2 x e^{5x}\right) + \left(\frac{7}{2} x^2 e^{5x} - \frac{2}{25} x^2 - \frac{8}{125} x - \frac{12}{625}\right) \end{align}$$

Find the first derivative:
 * $$y'(x) = 5 K_1 e^{5x} + K_2 e^{5x} + 5 K_2 x e^{5x} + \frac{7}{2} e^{5x} \left(5 x^2 + 2 x\right) - 2 \frac{2}{25} x - \frac{8}{125}$$

Solve for constants using initial conditions:
 * $$\begin{align}

y(0) = 4 = K_1 - \frac{12}{625} &\Rightarrow K_1 = \frac{2512}{625} \\ y'(0) = -5 = 5 \frac{2512}{625} + K_2 - \frac{8}{125} &\Rightarrow K_2 = -\frac{3129}{125} \end{align}$$

Therefore: $$y(x) = \frac{2512}{625} e^{5x} - \frac{3129}{125} x e^{5x} + \frac{7}{2} x^2 e^{5x} - \frac{2}{25} x^2 - \frac{8}{125} x - \frac{12}{625}$$

=Team Contributions=