Lecture 16
1.9.4 $r(x)$ is a polynomial times an exponential
Example: Find a particular solution to $\,y''+y'-2y=4xe^{2x}$.
We have a degree one polynomial, multiplied by $e^{2x}.$ Let's guess that $y_p$ is of the form
$\ds y_p =(ax+b)e^{2x}. $
This means
$\ds y_p'=(2ax+2b+a)e^{2x} $
$\ds y_p''=(4ax+4b+4a)e^{2x} $
1.9.4 $r(x)$ is a polynomial times an exponential
Substituting these into the ODE, we have
$\ds y_p''+y'_p-2y_p =4xe^{2x} $
$\ds (4ax+4b+4a)e^{2x} $ $\ds +\,(2ax+2b+a)e^{2x} $ $ \ds -\,2(ax+b)e^{2x} $ $\ds =4xe^{2x} $
$\ds \Ra 4ax+4b+5a =4x+0.$
This gives us two equations, and two unknowns
$\ds 4a =4 $ $\ds \Ra a=1 $
$\ds 4b+5a =0 $ $\ds \Ra b=-\frac{5}{4}. $
1.9.4 $r(x)$ is a polynomial times an exponential
Hence, $\displaystyle y_p=\left(x-\frac{5}{4}\right)e^{2x}.$
Where did this guess come from?
Theorem: Consider an ODE of the form $ay^{\prime\prime}+by^\prime+cy=r(x)$.
If $\ds r(x)=e^{\alpha x}\sum_{j=0}^n \beta_jx^j,$
$\ds y_p=e^{\alpha x}\sum_{j=0}^n \gamma_jx^j$ for undetermined coefficients $\gamma_j.$
(subject to some caveats, discussed below)
1.9.4 $r(x)$ is a polynomial times an exponential
To prove this, suppose we have an ODE of the form
$\ds ay^{\prime\prime}+by^\prime+cy =e^{\alpha x}\sum_{j=0}^n \beta_jx^j.$
Let
$\ds \; y_p =u(x)e^{\alpha x}\qquad \quad $
$\ds \implies y_p^\prime =(u^\prime +\alpha u) e^{\alpha x}\qquad \quad\; $
$\ds \implies y_p^{\prime\prime} =(u^{\prime\prime}+2\alpha u^\prime +\alpha^2 u)e^{\alpha x}. $
1.9.4 $r(x)$ is a polynomial times an exponential
$\ds ay^{\prime\prime}+by^\prime+cy =e^{\alpha x}\sum_{j=0}^n \beta_jx^j.$ $\ds \;\; \left\{ \begin{align*} y_p &=u(x)e^{\alpha x}\\ y_p^\prime &=(u^\prime +\alpha u) e^{\alpha x}\\ y_p^{\prime\prime} &=(u^{\prime\prime}+2\alpha u^\prime +\alpha^2 u)e^{\alpha x}. \end{align*} \right. $
Substituting these into the left hand side of the ODE, we have
$\ds e^{\alpha x}\bigg[ \bigg. $ $\ds \left( au^{\prime\prime}+2a\alpha u^\prime +a\alpha^2 u\right) $
$\ds \bigg. + \left(bu^\prime+b\alpha u\right) \bigg. $ $\ds + \left(cu \right) $ $\ds \bigg. \bigg] $ $\ds =e^{\alpha x} \sum_{j=0}^n \beta_jx^j $
1.9.4 $r(x)$ is a polynomial times an exponential
Dividing both sides by the exponential and grouping like terms of $u$, we have:
$\ds au^{\prime\prime}+ (2a\alpha+b)u^\prime + (a\alpha^2+b\alpha +c)u =\sum_{j=0}^n \beta_jx^j.$
This is a second order ODE, where the RHS is a polynomial. But we've previously established that this means $u(x)$ is a polynomial of degree $n$.
Thus, the theorem is proved. 😃
1.9.5 $r(x)$ is the sum of the previous two cases
Example: Find the general solution of
$y''+y'-2y=x^2-2x+3+4x e^{2x}$.
$ \ds y_p = \left( -\frac{1}{2}x^2 +\frac{1}{2}x-\frac{7}{4}\right) $ $+$ $\ds\left(x - \frac{5}{4}\right)e^{2x}$
Check it! 📝 See Section 1.9.3 and Section 1.9.4.
Find $\,y_H$: $\,\ds y_H''+ y'_H - 2y_H= 0$
$y_H = c_1 e^{-2x}+ c_2 e^{x}.$ 📝
1.9.5 $r(x)$ is the sum of the previous two cases
Example: Find the general solution of $\,y''+y'-2y=x^2-2x+3+4x e^{2x}$.
General solution:
$y= y_H + y_p$
$\;\;\, = c_1 e^{-2x}+ c_2 e^{x} $
$\qquad\quad \ds +\, \left( -\frac{1}{2}x^2 +\frac{1}{2}x-\frac{7}{4}\right) + \left(x - \frac{5}{4}\right)e^{2x}$
1.9.5 $r(x)$ is the sum of the previous two cases
Theorem: If $y_{P_1}$ is a particular solution of $\,ay''+by'+cy=r_1(x)$ and $y_{P_2}$ is a particular solution of $\,ay''+by'+cy=r_2(x),$ then $y_P=y_{P_1}+y_{P_2}$ is a particular solution of $\,ay''+by'+cy=r_1(x)+r_2(x).$
👉 Check Lecture 11
1.9.5 $r(x)$ is the sum of the previous two cases
To prove this, suppose we know $y_{P_1}$ and $y_{P_2}$ such that
$\begin{align*} ay_{P_1}^{\prime\prime}+by_{P_1}^\prime +cy_{P_1}&=r_1(x)\\ ay_{P_2}^{\prime\prime}+by_{P_2}^\prime +cy_{P_2}&=r_2(x). \end{align*}$
Let $z(x)=y_{P_1}(x)+y_{P_2}(x).$ Then
$ z^\prime = y_{P_1}^\prime+y_{P_2}^\prime $
$ z^{\prime\prime} = y_{P_1}^{\prime\prime}+y_{P_2}^{\prime\prime}, $
1.9.5 $r(x)$ is the sum of the previous two cases
👉 $\;\; z = y_{P_1}+y_{P_2},\; $ $ z^\prime = y_{P_1}^\prime+y_{P_2}^\prime,\; $ $ z^{\prime\prime} = y_{P_1}^{\prime\prime}+y_{P_2}^{\prime\prime}. $
and
$az''+bz' + cz $
$\quad = a\left(y_{P_1}^{\prime\prime}+y_{P_2}^{\prime\prime}\right)+b\left(y_{P_1}^\prime+y_{P_2}^\prime\right)+c\left(y_{P_1}+y_{P_2}\right)$
$ \quad =\left( ay_{P_1}^{\prime\prime}+b y_{P_1}^\prime + cy_{P_1} \right)+\left( ay_{P_2}^{\prime\prime}+b y_{P_2}^\prime + cy_{P_2} \right)$
$\quad =r_1(x)+r_2(x).\quad \bs$
1.9.6 $r(x)$ is a simple trigonometric function
Example: Find a particular solution to
$y'' + 4 y' + 5 y = 12 \cos x+4 \sin x.$
Our guess is $\ds\, y_p = a \cos x + b \sin x$
Then $\,y_p' = -a \sin x + b \cos x$
and $\,y_p'' = -a \cos x - b \sin x$
1.9.6 $r(x)$ is a simple trigonometric function
Example: Find a particular solution to $y'' + 4 y' + 5 y = 12 \cos x+4 \sin x.$
$y_p = a \cos x + b \sin x,\;y_p' =- a \sin x + b \cos x,\; y_p'' = -a \cos x - b \sin x$
$\ds y_p'' + 4 y_p' + 5 y_p$
$\quad \ds = \left( -a \cos x - b \sin x\right)$ $ + \,4\left( -a \sin x + b \cos x\right)$
$\qquad \qquad + \,5\left(a \cos x + b \sin x\right)$
$\quad \ds = \left( 4a + 4b\right)\cos x + \left( -4a + 4b\right)\sin x$
$\quad \ds = 12 \cos x+4 \sin x$
1.9.6 $r(x)$ is a simple trigonometric function
Example: Find a particular solution to $y'' + 4 y' + 5 y = 12 \cos x+4 \sin x.$
We obtain a system of equations
$ \left\{ \begin{align*} 4a+4b &= 12\\ -4a+4b &=4 \end{align*} \right. $ $\Ra \left\{ \begin{align*} 8b &= 16\\ 8a &= 8 \end{align*} \right. $ $\Ra \left\{ \begin{align*} b &= 2\\ a &= 1 \end{align*} \right. $
Hence $\,y_p = \cos x + 2 \sin x.$
Once again, where did our guess come from?
1.9.6 $r(x)$ is a simple trigonometric function
Theorem: Consider an ODE of the form $ay^{\prime\prime}+by^\prime+cy=r(x)$, with $a,b,c \ne 0.$
If $r(x)$ is a linear combination of $\cos$ and $\sin$ terms, then so is $y_p.$
(subject to some caveats, discussed below)
1.9.6 $r(x)$ is a simple trigonometric function
Consider the ODE
$\begin{align*} ay^{\prime\prime}+by^\prime+cy&=\alpha \cos (nx) +\beta \sin (nx) \diamond \end{align*}$
First, let's observe that
$\begin{align*} \cos (nx)&=\frac{e^{inx}+e^{-inx}}{2}\\ \sin (nx)&=\frac{e^{inx}-e^{-inx}}{2i}. \end{align*}$
(To see why, recall Euler's formula, $e^{ix}=\cos x+i\sin x.$)
1.9.6 $r(x)$ is a simple trigonometric function
Thus $\; r(x) =\alpha \cos (nx) +\beta \sin (nx)\qquad \qquad\qquad\qquad$
$\;\;\;=\ds \alpha \left(\frac{e^{inx}+e^{-inx}}{2}\right)+\beta \left( \frac{e^{inx}-e^{-inx}}{2i} \right)$
$\;\;\;=\ds\left(\frac{\alpha}{2}+\frac{\beta}{2i}\right)e^{inx}+\left(\frac{\alpha}{2}-\frac{\beta}{2i}\right)e^{-inx}.\quad$
From section 1.9.4, we know that the simplified ODE
$ \ds ay^{\prime\prime}+by^\prime+cy =\left(\frac{\alpha}{2}+\frac{\beta}{2i}\right)e^{inx}, $
has solution $y_{p_1}=\gamma e^{inx},$ for some $\gamma.$
1.9.6 $r(x)$ is a simple trigonometric function
From section 1.9.4, we know that the simplified ODE
$ \ds ay^{\prime\prime}+by^\prime+cy =\left(\frac{\alpha}{2}+\frac{\beta}{2i}\right)e^{inx}, $
has solution $y_{p_1}=\gamma e^{inx},$ for some $\gamma.$
Furthermore, $y_{p_2}=\delta e^{-inx}$ solves
$\begin{align*} ay^{\prime\prime}+by^\prime+cy&=\left(\frac{\alpha}{2}-\frac{\beta}{2i}\right)e^{-inx}. \end{align*}$
1.9.6 $r(x)$ is a simple trigonometric function
👉 $\;y_{p_1}=\gamma e^{inx},\,$ $\,y_{p_2}=\delta e^{-inx}$
Thus, using section 1.9.5 the solution to
$\ds ay^{\prime\prime}+by^\prime+cy =\alpha \cos (nx) +\beta \sin (nx) $ $\diamond$
is:
$y_{P_1} + y_{P_2}$ $= \gamma e^{in x} + \delta e^{-inx}$
$= \gamma \big(\cos (nx) + i \sin (nx)\big) + \delta \big(\cos (nx) - i \sin (nx)\big)$
$= \left(\gamma + \delta\right) \cos nx + i\left(\gamma - \delta\right) \sin nx$
and the theorem is proved.
1.9.7 Main points
Examples of $r(x)$ | Choice for $y_p$ |
---|---|
$x^2$ | $ax^2+bx+c$ |
$e^{3x}$ | $Ae^{3x}$ |
$\sin (2x)$ | $A\sin (2x) + B\cos (2x)$ |
$xe^{-2x}$ | $\left(ax+b\right)e^{-2x}$ |