Recap from last class#

For the 2nd order, linear, constant coefficients, homogeneous differential equation \(y'' + ay' + by = 0\) where \(a^2-4b \[\begin y(x) &= e^x>[A\sin(\omega x) + B\cos(\omega x)] && \omega = \sqrta^2> \end\]

where \(A\) and \(B\) are our arbitrary constants. All components of the solution are real.

Example#

$y’’ + 2y’ + 3y = 0 \( ; \) \hspacey(0) = 2 \( and \) y’(0) = -3$\

(249)# \[\begin \lambda^2 + 2\lambda + 3 = 0\\ a = 2, \hspace b = 3 \end\]

(250)# \[\begin \lambda &= -\fraca \pm i\sqrt\\ &= -\fraca \pm i \omega \implies \omega = \sqrt\\ \lambda &= -1 \pm i\sqrt \end\]

(252)# \[\begin y'(x) &= -e^[A\cos(\sqrtx) + B\sin(\sqrtx)] + + e^[-\sqrt A\sin(\sqrtx) + \sqrt B\cos(\sqrtx)]\\ &= e^[(\sqrt B - A) \cos(\sqrtx) - (\sqrtA + B)\sin(\sqrtx)] \end\]

Using Initial Conditions:

(253)# \[\begin y(0) = 2 &= e^[A\cos(0) + B\sin(0)]\\ 2&=A \end\] (255)# \[\begin \therefore y(x) = e^[2 \cos(\sqrtx) -\frac<\sqrt>\sin(\sqrtx)] \implies \text \end\]

\(\underline>\) : Homogeneous, linear \(2^\circ\) ODEs with constant coefficients

(256)# \[\begin y'' + ay' + by = 0 \end\] (257)# \[\begin y(x) = c_1 ^ <\lambda_1x>+ c_2 e^ <\lambda_2x>&& \text \lambda = \frac(-a \pm \sqrt) \end\]
  1. Real, double roots
(258)# \[\begin y(x) = c_1 e^ <\lambda x>+ c_2 x e^ <\lambda x>\end\]
  1. Complex roots

In each case, we have a basis of \(\underline>\) linearly independent solutions (for \(2^\) order). \(\rightarrow\) in case there’s just one, this necessitates that \(\lambda_1 \neq \lambda_2\) , which is the definition of the case

Non-homogeneous Linear \(2^\circ\) ODEs (sec 2.8)#

(260)# \[\begin y'' + p(x) y' + q(x) y = r(x) \end\] (261)# \[\begin y(x) = y_H(x) + y_P(x) \end\]

where \(y_H(x) = c_1y_1(x) + c_2y_2(x)\) , which is the “homogeneous solution” for \(r(x)\equiv 0\) and \(y_P(x)\) is the “particular solution” which accounts for non-homogeneous part and has no arbitrary constants (we need only two for a \(2^\circ\) ODE)

Example#

(262)# \[\begin y'' + 4y = 0 \implies \text$> \end\]

(263)# \[\begin \lambda ^ 2 + 4 = 0 \implies \lambda = \pm 2i\\ a = 0, b = 4 \implies \omega = \sqrta^2> = 2 \end\]

\(\implies\) for imaginary roots, we know the solution is:

Now, I will tell you that

(265)# \[\begin y_P(x) &= \frace^x\\ \therefore y(x) &= y_H(x) + \frace^x\\ y'(x) &= y_H'(x) + \frace^x\\ y''(x) &= y_H''(x) + \frace^x \end\]

Plugging these into original non-homogeneous equation:

(266)# \[\begin y_H'' + \frace^x + 4(y_H + \frace^x) = e^x\\ y_H'' + \frace^x + 4y_H + \frace^x = e^x\\ y_H'' + 4y_H + e^x = e^x && \implies \text y_P(x) = \frace^x \text \end\]

(267)# \[\begin y(0) = \frac &= c_1 \sin(2\cdot 0) + c_2 \cos (2\cdot 0) + \frac e^0\\ \frac &= c_2 + \frac\\ c_2 &= \frac \end\]

  1. We need expression for \(y'(x)\) for \(2^\) I.C.

(268)# \[\begin y'(x) &= 2c_1\cos(2x) - 2c_2 \sin(2x) + \frace^x\\ y'(0) = \frac &= 2c_1 \cos(2\cdot 0) - 2c_2 \sin(2\cdot 0) + \frace^0\\ \frac &= 2c_1 + \frac\\ c_1 &= \frac \end\]

(269)# \[\begin \therefore y(x) = \frac \sin(2x) + \frac \cos(2x) + \frac e^x \implies \text \end\]

Method of Undetermined Coefficients (sec 2.9)#

(270)# \[\begin y'' + ay' + by = r(x) \end\]

Rules (from textbook)#

\(K_nx^n + K_x^ + . + K_1x + K_0\)

\(k\cos(\omega x)\) or \(k\sin(\omega x)\)

\(K\cos(\omega x) + M\sin(\omega x)\)

Here are some additional rules; we’ll see why these are important later:

(271)# \[\begin y(x) = c_1y_1 + c_2y_2 + y_P\\ y'(x) = c_1y_1' + c_2y_2' + y_p'\\ y''(x) = c_1y_1'' + c_2y_2'' + y_p'' \end\]

(272)# \[\begin (c_1y_1'' + c_2y_2'' + y_P'') + a(c_1y_1' + c_2y_2' + y_P') + b(c_1y_1 + c_2y_2 + y_P) = r(x)\\ c_1(y_1'' + ay_1' + by_1) + c_2(y_2'' + ay_2' + by_2) + y_P'' + ay_P' + by_P = r(x) \end\]

Therefore, \(y_P'' + ay_P' + by_P = r(x)\) and \(y_P\) is a linear solution to the problem (which is why only some functions work)

Example: \(y'' + 2y' - 3y = 4e^\) #

(273)# \[\begin y(x) = y_H(x) + y_P(x) \end\]
  1. Find \(y_H(x)\)
(275)# \[\begin \therefore y_H(x) = c_1e^x + c_2 e^ \end\]
  1. Choose \(y_P(x)\) based on \(r(x)\)
    \(\implies\) Since \(r(x) = 4e^\) , let’s pick \(y_p(x) = Ke^\) , where \(K\) is the undetermined coefficient (not arbitrary)
  2. Find \(K\) from non-homogeneous ODE
(276)# \[\begin y_P'' + 2y_p' - 3y_p = 4e^\\ y_p' = 2Ke^\\ y_P'' = 4Ke^ \end\] (277)# \[\begin \implies 4Ke^ + 4Ke^ - 3Ke^ = 4e^\\ 5K = 4\\ K = \frac \end\]
  1. Write down general solution
(278)# \[\begin y(x) = y_H(x) + y_P(x)\\ y(x) = c_1e^x + c_2e^ + \frace^ \end\]

Still need 2 IC’s to find \(c_1\) and \(c_2\)

In-class problem#

Consider the differential equation $ \(y''+y=0.001x^2\) \( The homogeneous solution is \) \(y_h=A\cos x+B\sin x\) $, as we saw in class last week. Find a particular solution to this differential equation using the MoUC rules above.

Non-homogeneous Linear \(2^\circ\) ODEs Continued#

\(\underline>\) : If you choose a \(y_P(x)\) that is not linearly independent of \(y_1\) and \(y_2\) , things will go wrong.

Example: \(y'' - 4y = 4e^\) #

  1. Solve \(y'' - 4y = 0\)
  1. Choose \(y_P(x)\) based on \(r(x)\)
    Since \(r(x) = 4e^\) , choose \(y_P(x) = Ke^\) as before.
    SPOILER: \(Ke^\) is not linearly independent of \(y_1(x) = e^\)
  2. Find \(K\) from non-homogeneous ODE

(280)# \[\begin y_P'' - 4y_P = 4e^\\ y_P' = 2Ke^\\ y_P'' = 4Ke^\\ \implies 4Ke^ - 4Ke^ = 4e^\\ 0 = 4e^ \hspace ?? \end\]

(281)# \[\begin y(x) &= c_1e^ + c_2e^ + Ke^\\ &= (c_1 + K)e^ + c_2 e^ \implies \text \end\] (282)# \[\begin y_P'(x) &= Ke^ + 2Kxe^\\ y_P''(x) &= 2Ke^ + 2Ke^ + 4Kxe^\\ &= 4Ke^ + 4Kxe^ \end\]
  1. Find \(K\)

(283)# \[\begin y_P'' - 4y_P = 4e^\\ 4Ke^ + 4Kxe^ - 4Kxe^ = 4e^\\ 4K = 4\\ K=1\\ \therefore y_P(x) = xe^ \end\]

  1. General Solution
(284)# \[\begin y(x) &= y_H(x) + y_P(x)\\ y(x) &= c_1e^ + c_2e^ + xe^ \end\] (285)# \[\begin y_H(x) = c_1e^ <\lambda x>+ c_2xe^ <\lambda x>\end\]

\(\implies\) Again, you must be careful to select \(y_P(x)\) s.t. it is linearly independent.
\(\implies\) if \(r(x) \propto e^ <\lambda x>\) or \(xe^<\lambda x>\) , then \(y_P(x) = Kx^2e^<\lambda x>\) (Obtained from a second reduction of order)

More complex example: \(y'' + 2y' -3y = -3x^2 + \sin(x)\) #

  1. Solve the homogeneous ODE

(286)# \[\begin y'' + 2y' - 3y = 0\\ \lambda^2 + 2\lambda -3 = 0\\ (\lambda+3)(\lambda-1) = 0 && \implies \lambda_1 = 1, \hspace \lambda_2 = -3\\ y_H(x) = c_1e^x + c_2e^ \end\]

  1. Choose \(y_P(x)\) based on \(r(x)\)
    \(\underline>\) : If \(r(X)\) is a sum of wo functions, then \(y_P(x)\) should be a sum of the corresponding functions.

(287)# \[\begin r(x) &= -3x^2 + \sin(x)\\ \therefore y_P(x) &= Ax^2 + Bx + C + K\sin(x) + M\cos(x) \end\]

  1. Find undetermined coefficients from ODE
(288)# \[\begin y_P' &= 2Ax + B + K\cos(x) - M\sin(x)\\ y_P'' &= 2A - K\sin(x) - M\cos(x) \end\]

(289)# \[\begin 2A - K\sin(x) - M\cos(x) + 2[2Ax + B + K\cos(x) - M\sin(x)] - 3[Ax^2 + Bx + C + K\sin(x) + M\cos(x)] = -3x^2 + \sin(x) \end\]

(290)# \[\begin -3Ax^2 + (4A - 3B)x + (2A + 2B - 3C) + (-K -2M -3K)\sin(x) + (-M + 2K -3M)\cos(x) = -3x^2 + \sin(x) \end\]

(291)# \[\begin -M + 2K -3M = 0\\ 2K = 4M\\ K = 2(-2K-\frac) = -4K-1\\ \implies K = -\frac\\ \implies M = -\frac \end\]

(292)# \[\begin \therefore y_P(x) = -3x^2 + \fracx + \frac-\frac(2\sin x + \cos x) \end\]
  1. Write down the general solution
(293)# \[\begin y(x) &= y_H(x) + y_P(x)\\ &= c_1e^x + c_2e^ + y_P(x) \end\]

Second Order Differential Equations

Method of Undetermined Coefficient and Variations of Parameters

By Zachary Ulissi
© Copyright 2022.