352 - Topic 11 - Linear Constant Coefficient DEs with operators

30 days ago by Professor352

Creating the Differential Operator Formulas for solving Linear Constant Coefficient Differential Equations


John Travis

Mississippi College

var('a,t') y = e^(a*t) pretty_print(html("$$D[%s]$$"%(latex(y)) )) show(diff(y,t)) 
       

                                
                            

                                
reset() var('a,t,n') assume(n>0) assume(n, 'integer') y = e^(a*t) pretty_print(html("$$D^n[%s]$$"%(latex(y)) )) for k in range(2,10): y = diff(e^(a*t),t,k) pretty_print(html("$$D^{%s}"%str(k)+"[e^{at}] = %s$$"%(latex(y)) )) 
       

                                
                            

                                
var('a,t') y = e^(a*t) pretty_print(html("$$(D-a)[%s]$$"%(latex(y)) )) show(diff(y,t) - a*y ) 
       

                                
                            

                                
var('a,t') y = function('y')(t) pretty_print(html("$$(D-a)[e^{at}%s]$$"%(latex(y)) )) show(diff(e^(a*t)*y,t) - a*e^(a*t)*y ) 
       

                                
                            

                                
var('a,t') y = function('y')(t) Y = e^(a*t)*y for k in range(1,5): pretty_print(html("$$(D-a)^%s"%str(k)+"[e^{at}%s]$$"%(latex(y)) )) Y = diff(Y,t) - a*Y show(Y) 
       

                                
                            

                                
var('a,t') n=10 for r in range(n+1): # all but the last should be 0 Y = e^(a*t)*t^r for k in range(n): # take n derivatives Y = diff(Y,t) - a*Y pretty_print(html("$$(D-a)^%s"%str(n)+"[e^{at}t^{%s}]$$"%(r) )) show(Y) 
       

                                
                            

                                
var('b,c,t') pretty_print(html("Solve $$(D^2 + 2bD + c^2 + b^2)[y]=0$$")) pretty_print(html("$$(D^2 + 2b + c^2 + b^2)[%s]$$"%(latex(y)) )) result = diff(y,t,2) + 2*b*diff(y,t) +(c^2+b^2)*y show(result.simplify_full()) 
       
Solve 

                                
                            
Solve 

                                
var('b,c,t') y = e^(-b*t)*cos(c*t) pretty_print(html("$$(D^2 + 2bD + c^2 + b^2)[%s]$$"%(latex(y)) )) result = diff(y,t,2) + 2*b*diff(y,t) +(c^2+b^2)*y show(result.simplify_full()) 
       

                                
                            

                                
var('b,c,t') y = e^(-b*t)*sin(c*t) pretty_print(html("$$(D^2 + 2bD + c^2 + b^2)[%s]$$"%(latex(y)) )) result = diff(y,t,2) + 2*b*diff(y,t) +(c^2+b^2)*y show(result.simplify_full()) 
       

                                
                            

                                
# page 184 of text auxilary = x^3 + 5*x^2 + 6*x + 2 auxilary.factor().show() solve(auxilary,x) 
       
[x == -sqrt(2) - 2, x == sqrt(2) - 2, x == -1]
[x == -sqrt(2) - 2, x == sqrt(2) - 2, x == -1]
var('t') # first root y = exp(-t) DE = diff(y,t,3) + 5*diff(y,t,2) + 6*diff(y,t) + 2*y show("y =",y) show(DE) pretty_print("---------") # second root y = exp((sqrt(2)-2)*t) DE = diff(y,t,3) + 5*diff(y,t,2) + 6*diff(y,t) + 2*y show("y =",y) show(DE) DE=(DE/e^(t*(sqrt(2)-2))).expand() show(DE) pretty_print("---------") # third root y = exp((-sqrt(2)-2)*t) DE = diff(y,t,3) + 5*diff(y,t,2) + 6*diff(y,t) + 2*y show("y =",y) show(DE) DE=(DE/e^(t*(sqrt(2)-2))).expand() show(DE) 
       

                                
                            

                                
# Consider an easy second order with imaginary roots var('t') pretty_print("D^2 + 4") TBA # first root y = exp(-t) DE = diff(y,t,3) + 5*diff(y,t,2) + 6*diff(y,t) + 2*y show("y =",y) show(DE) # second root y = exp((-sqrt(2)-2)*t) DE = diff(y,t,3) + 5*diff(y,t,2) + 6*diff(y,t) + 2*y show("y =",y.expand()) show(DE) # third root 
       
# Let's try a fourth order with complex roots var('t') # linear coefficient = b # constant term = c^2 + b^2 y = sin(t) # y = cos(t) # y = e^(t) # y = e^(-t) DE = diff(y,t,4) - y show("y =",y) show(DE) 
       

                                
                            

                                
var('t') pretty_print("(D^2+8D+20)[y]=0") y1 = e^(-4*t)*cos(2*t) pretty_print(y1) y2 = e^(-4*t)*sin(2*t) pretty_print(y2) diff(y1,t,2)+8*diff(y1,t)+20*y1 diff(y2,t,2)+8*diff(y2,t)+20*y2 
       
0
0