352 - Topic 12 - Undetermined Coefficients

30 days ago by Professor352

John Travis

Mississippi College

Solve $y'' + 9y = \sin(3t)$

$(D^2 + 1) y = \sin(3t)$

yields solutions for the homogeneous part of

$y_1 = \sin(3t)$ and $y_2 = \cos(3t)$.

Operating on both sides with operator $D^2 + 1$ makes the original DE also homogeneous.

$(D^2 + 1)^2 y = (D^2+1)\sin(3t) = 0$

Thus, we have new solutions $y_3 = t \sin(3t)$ and $y_4 = t \cos(3t)$.

Therefore, try the particular solution

$y_p = A t \sin(3t) + B t \cos(3t)$.

var('t,A,B') y = A*t*sin(3*t)+B*t*cos(3*t) yprime = diff(y,t) ypp = diff(yprime,t) equation = ypp + 9*y == sin(3*t) equation.show() #soln = solve(equation,[A,B]) #show(soln) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}6 \, A \cos\left(3 \, t\right) - 6 \, B \sin\left(3 \, t\right) = \sin\left(3 \, t\right)
\newcommand{\Bold}[1]{\mathbf{#1}}6 \, A \cos\left(3 \, t\right) - 6 \, B \sin\left(3 \, t\right) = \sin\left(3 \, t\right)

Solving this using our own heads yields:

$A = 0$ and $B = -1/6$.

Let's check the general solution:

var('t,C1,C2') y = 0*t*sin(3*t)+(-1/6)*t*cos(3*t)+C1*sin(3*t)+C2*cos(3*t) yprime = diff(y,t) ypp = diff(yprime,t) equation = ypp + 9*y == sin(3*t) equation.show() html('<font color="blue"><b>%s</b></font>'%bool(equation)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\sin\left(3 \, t\right) = \sin\left(3 \, t\right)
True
                                
                            
\newcommand{\Bold}[1]{\mathbf{#1}}\sin\left(3 \, t\right) = \sin\left(3 \, t\right)
True
                                

Below, you can check your own differential equation by changing the appropriate parts from above and letting Sage take care of the nitty gritty details....

# To determine the equation for finding the undetermined coefficients var('t,A,B') y = A*e^(3*t) yprime = diff(y,t) ypp = diff(yprime,t) equation = ypp - yprime - 2*y == 5*e^(3*t) equation.show() #soln = solve(equation,[A,B]) #show(soln) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}4 \, A e^{\left(3 \, t\right)} = 5 \, e^{\left(3 \, t\right)}
\newcommand{\Bold}[1]{\mathbf{#1}}4 \, A e^{\left(3 \, t\right)} = 5 \, e^{\left(3 \, t\right)}
# To check that your general solution actually works var('t,C1,C2') y = (5/4)*e^(3*t)+C1*e^(2*t)+C2*e^(-t) yprime = diff(y,t) ypp = diff(yprime,t) equation = ypp - yprime - 2*y == 5*e^(3*t) equation.show() if ypp - yprime - 2*y == 5*e^(3*t): print "YES!" 
       
\newcommand{\Bold}[1]{\mathbf{#1}}5 \, e^{\left(3 \, t\right)} = 5 \, e^{\left(3 \, t\right)}
YES!
\newcommand{\Bold}[1]{\mathbf{#1}}5 \, e^{\left(3 \, t\right)} = 5 \, e^{\left(3 \, t\right)}
YES!
# Playing around... var('t,A,B') y = A*t*cos(3*t)+B*t*sin(3*t) yprime = diff(y,t) ypp = diff(yprime,t) equation = ypp + 9*y == cos(3*t)+sin(3*t) equation.show() #soln = solve(equation,[A,B]) #show(soln)