MIT微分方程讲义4
高等数学微分方程的基本概念教学ppt讲解
三、主要问题——求方程的解
微分方程的解:
代入微分方程能使方程成为恒等式的函数.
微分方程的解的分类:
(1)通解: 微分方程的解中含有任意常数,且 独立的任意常数的个数与微分方程的阶数相同.
独立的任意常数的个数=微分方程的阶数 含有几个任意常数的表达式,如果它们不能合并而使 得任意常数的个数减少,则称这表达式中的几个任意 常数相互独立.
由题意知 t = 0 时,
s 0, v ds 0 dt
(8)
Nanjing College of Information and Technology
8
第六章 常微分方程
第一节 微分方程的基本概念
把(8)式分别代入(6),(7)式,得
C1 = 0 , C2 = 0. 故(7)式为
s 1 gt 2
是该微分方程的特解.
第一节 微分方程的基本概念
Nanjing College of Information and Technology
22
第六章 常微分方程
内容小结
第一节 微分方程的基本概念
本节基本概念: 微分方程; 微分方程的阶; 微分方程的解; 通解,初始条件; 特解; 初值问题; 积分曲线.
Nanjing College of Information and Technology
15
第六章 常微分方程
第一节 微分方程的基本概念
例如y = C1x + C2x + 1 与 y = Cx+1 (C1,C2,
C都是任意常数)所表示的函数族是相同的,
因此y = C1x + C2x + 1中的C1,C2是不独立的;
代入初始条件
MIT微分方程课程表
MIT微分方程课程表SE S # TOPICSSKILLS & CONCEPTS INTRODUCEDKEYDATESI. First-order differential equationsR 1 Natural growth, separable equations Modeling: exponential growth with harvestingGrowth rateSeparating variablesSolutions, general and particular Amalgamating constants of integrationUse of ln|y|, and its elimination Reintroduction of lost solutionsInitial conditions - satisfying them by choice of integration constantL 1 Direction fields, existence and uniqueness of solutionsDirection fieldsIntegral curveIsoclinesFunnelsImplicit solutionsFailure of solutions to continue: infinite derivativeR 2 Direction fields, integral curves, isoclines, separatrices, funnelsSeparatrixExtrema of solutionsL2Numerical methods Euler's methodL 3 Linear equations, modelsFirst order linear equationSystem/signal perspectiveBank account modelRC circuitSolution by separation if forcing termis constantR3Euler's method; linear models Mixing problems L 4 Solution of linear equations, integrating factorsHomogeneous equation, null signal Integrating factorsTransientsDiffusion example; coupling constantR 4 First order linear ODEs; integrating factorsSinusoidal input signalL 5 Complex numbers, roots of unity Complex numbersRoots of unityPS 2 outL Complex exponentials; sinusoidal Complex exponential 6 functions Sinusoidal functions: Amplitude,Circular frequency, Phase lagL 7 Linear system response to exponentialand sinusoidal input; gain, phase lagFirst order linear response toexponential or sinusoidal signalComplex-valued equation associatedto sinusoidal inputPS: half lifeR 5 Complex numbers; complex exponentialsL 8 Autonomous equations; the phase line,stabilityAutonomous equationPhase lineStabilitye^{k(t-t_0)} vs ce^{kt}PS 2 due;PS 3 outL9Linear vs. nonlinear Non-continuation of solutions R6Review for exam IExam IHour exam III. Second-order linear equationsR 7 Solutions to second order ODEsHarmonic oscillatorInitial conditionsSuperposition in homogeneous caseL1 1 Modes and the characteristic polynomial Spring/mass/dashpot systemGeneral second order linear equation Characteristic polynomialSolution in real root caseL 12 Good vibrations, damping conditions Complex rootsUnder, over, critical dampingComplex replacement, extraction ofreal solutionsTransienceRoot diagramR 8 Homogeneous 2nd order linear constant coefficient equationsGeneral sinusoidal responseNormalized solutionsL 13 Exponential response formula, spring driveDriven systemsSuperpositionExponential response formulaComplex replacementSinusoidal response to sinusoidalsignalR9Exponential and sinusoidal input signalsL Complex gain, dashpot drive Gain, phase lag PS 3 due;14 Complex gain PS 4 outL 15 Operators, undetermined coefficients,resonanceOperatorsResonanceUndetermined coefficientsR 10 Gain and phase lag; resonance; undetermined coefficientsL16Frequency response Frequency responseR11Frequency response First order frequency responseL 17 LTI systems, superposition, RLCcircuits.RLC circuitsTime invariancePS4 due;PS 5 outL18Engineering applications Damping ratio R12Review for exam IIL 19 Exam IIHourExam IIIII. Fourier seriesR13Fourier series: introduction Periodic functions L 20 Fourier seriesFourier seriesOrthogonalityFourier integralL 21 Operations on fourier series SquarewavePiecewise continuityTricks: trig id, linear combination,shiftR14Fourier series Different periodsL 22 Periodic solutions; resonance Differentiating and integrating fourier seriesHarmonic responseAmplitude and phase expression for Fourier seriesR15Fourier series: harmonic responseL 23 Step functions and delta functions Step functionDelta functionRegular and singularity functions Generalized functionGeneralized derivativePS 5 due;PS 6 outL 24 Step response, impulse responseUnit and step responsesRest initial conditionsFirst and second order unit step or unit impulse response R 16 Step and delta functions, and step and delta responses L 25 ConvolutionPost-initial conditions of unit impulseresponseTime invariance: Commutation withDTime invariance: Commutation witht-shiftConvolution productSolution with initial conditions as w *qR17Convolution Delta function as unit for convolutionL 26 Laplace transform: basic propertiesLaplace transformRegion of convergenceL[t^n]s-shift ruleL[sin(at)] and L(cos(at)]t-domain vs s-domainPS 6 due;PS 7 outL 27 Application to ODEsL[delta(t)]t-derivative ruleInverse transformPartial fractions; coverupNon-rest initial conditions for firstorder equationsR 18 Laplace transformUnit step response using Laplace transform.L 28 Second order equations; completing the squaress-derivative ruleSecond order equationsR19Laplace transform IIL 29 The pole diagramWeight and transfer functionL[weight function] = transfer functiont-shift rulePolesPole diagram of L T and long term behaviorPS 7 due;PS 8 outL 30 The transfer function and frequency responseStabilityTransfer and gainR20Review for exam IIIExam III HourExam III IV. First order systemsL 32 Linear systems and matricesFirst order linear systemsEliminationMatricesAnti-elimination: Companion matrixR21First order linear systemsL 33 Eigenvalues, eigenvectorsDeterminantEigenvalueEigenvectorInitial valuesR22Eigenvalues and eigenvectors Solutions vs trajectories L 34 Complex or repeated eigenvalues Eigenvalues vs coefficientsComplex eigenvaluesRepeated eigenvaluesDefective, completePS 8 due;PS 9 outL 35 Qualitative behavior of linear systems;phase planeTrace-determinant planeStabilityR23Linear phase portraits Morphing of linear phase portraits L 36 Normal modes and the matrixexponentialMatrix exponentialUncoupled systemsExponential lawR 24 Matrix exponentialsInhomogeneous linear systems(constant input signal)L 37 Nonlinear systemsNonlinear autonomous systemsV ector fieldsPhase portraitEquilibriaLinearization around equilibriumJacobian matricesPS 9 dueL 38 Linearization near equilibria; thenonlinear pendulumNonlinear pendulumPhugoid oscillationTacoma Narrows BridgeR25Autonomous systems Predator-prey systemsL 39 Limitations of the linear: limit cyclesand chaosStructural stability Limit cycles Strange attractors R26ReviewsFinal exam。
常微分方程4 PPT资料共46页
x (t0 ) 0 ,x '(t0 ) 0 , ,x (n 1 )(t0 ) 1
的 n个x解 1(t),x2(t) ,xn(t)一定,存 又因为在 1 0 0
W [x 1 (t0 )2,x 2 (t0 ) ,,x n (t0 ) ]0
d d n n x ta 1 (t)d d n n 1 1 x t a n (t)x f(t) (3 .1 .1 ) 其ai(中 t)i(1 ,2, n)及 f(t)都a 是 tb的连.
如f(果 t)0,则方 (3.1.1)程 变为
d d n n x ta 1 (t)d d n n 1 1 x t a n (t)x 0 (3 .1 .2 )
c 1 x 1 ( n 1 ) ( t 0 ) c 2 x 2 ( n 1 ) ( t 0 ) c n x n ( n 1 ) ( t 0 ) 0
其系数行列式为 W(t0) 0 , 故它有非零 c1,c解 2,cn,
现以这组常数构造函数,
上述方程组 c1,c2是 ,cn关 的于 齐次方 , 程 它的系数 W就 ro是 n的 sk行 y 列 ,由线式 性代数理论知
要使方程组存在非零解, 则它的系数行列式必为零,
即 W (t)0, t [a,b].
注 定理3的逆不成立.
如函数
t2, t 0
x1(t)
0,
, t 0
0, t 0
x ( t ) c 1 x 1 ( t ) c 2 x 2 ( t ) c n x n ( t )( , 3 . 1 . 7 )
第六课微分方程(讲稿)2010-9-24
第六课 微分方程第一节 微分方程的基本概念1. 微分方程——凡表示未知函数、未知函数的导数(或微分)与自 变量之间关系的方程称为微分方程. 简称方程.(1)常微分方程——未知函数是一元函数的微分方程;本章只讨论常微分方程. 例如: x dxdy2=,02=-xdx dy , 4.022-=dt s d等等.(2) 偏微分方程——未知函数是多元函数的微分方程.例如: 02222=∂∂+∂∂yzx z 等. 2. 微分方程的阶——方程中未知函数的最高阶导数的阶数.例如: x dxdy 2=为一阶(常)微分方程, 4.022-=dt s d 为二阶微分方程. 5222()43x y x y xy x ''''''+-=为三阶微分方程. 3.n 阶微分方程(1) 一般形式 0),,,,()(='n y y y x F .注:①F 是1+n 个变量的函数;②)(n y 必须出现.(2) 标准形式 ),,,,()1()(-'=n n y y y x f y.注:本章仅讨论f 是连续函数(在讨论范围内)类型微分方程. (3) 一阶微分方程对称形式 0),(),(=+dy y x Q dx y x P 4.微分方程的解——若函数)(x y ϕ=在区间I 上使得 0)](,),(),(,[)(≡'x x x x F n ϕϕϕ ,则称函数)(x y ϕ=为微分方程0),,,,()(='n y y y x F 在I 上的解.(1) 通解——含有任意常数,常数的个数与微分方程阶数相同,且各 个常数互相独立的解. ),,,,(21n C C C x y ϕ=. 例如,例1中的通解 C x y +=2;例2中的通解2122.0C t C t s ++-=.(2) 特解——确定了通解中任意常数以后的解)(x y ϕ=.例如:例1中的特解 12+=x y ;例2中的特解 t t s 202.02+-=. 5.初始条件——求出特解的条件:)1(0)1(0000)(,,)(,)(--='='=n n y x y x y x ϕϕϕ .注:① 0x ——x 的初值;)(0k y ——)(k y的初值;② 此时解微分方程的问题称为初值问题.记作⎪⎩⎪⎨⎧-=='==- .1,,1,0 ,),,,,,()(0)()1()(0n k y y y y y x f y k x x k n n 例如:例1中初始条件2|1==x y ,例2中的初始条件 0|0==t s ,20|0='=t s .提问:(1)关于微分方程x y xyx y e d d 2d d 22=++的下列结论: ①该方程式齐次微分方程 ; ②该方程是线性微分方程;③该方程式常系数微分方程 ; ④该方程为二阶微分方程. 其中正确的是[ ].(A)①,②,③ (B)①,②,④ (C)①,③,④ (D)②,③,④答由于方程不能化成)(d d xyx y ϕ=的形式,因此①错;而由方程的形式知其为二阶常系数非齐次线性微分方程,因此②,③,④对⇒选(D). (2)微分方程y y x x '=''⋅ln 的通解是[ ].(A) 21ln C x x C y +=; (B) 21)1(ln C x x C y +-=; (C) x x y ln = ; (D) 2)1(ln 1+-=x x C y答由于方程是二阶方程,所以其通解必含两个相对独立的任意常数; (A)求导后代入原方程不能使得等式成立⇒选(B). (3)下列方程中有一个是一阶微分方程,它是[ ]. (A) y y x y x y ''='-22)(;(B) 0)(5)(7542=+-'+''x y y y ; (C) 0=+'+''y y y x ; (D) 0d )(d )(2222=++-y y x x y x . 答 选(D).第二节 一阶微分方程一阶微分方程的常见形式:(,,)0F x y y '= 或 (,)y f x y '=. 一、可分离变量的微分方程 1. 分离变量的微分方程:形如 dx x f dy y g )()(= 或)()(y g x f y ='的一阶微分方程. 2.可分离变量的微分方程:dx x f dy y g )()(=必存在 隐式通解C x F y G +=)()((微分方程积分得). 例1 求微分方程xy y 2='的通解. (1) 0d )1(d )21(2=+++y x x x y解 分离变量得y yx x x 21d 1d 2+-=+, 两边积分得 2111l n 1l n 12l n222x y C +=-++, 即 2(1)(12)x y C ++= (C 为任意非负常数).(2)221dy x y xy dx =+++221(1)tan[(1)]12dy x dx y x C y ⇒=+⇒=+++. (3)sin(2)sin(2)y x y x y '+-=+满足()24y ππ=的特解.提示:原方程可化为2cos 2ln csc cot sin 2sin dyxdx y y x C y=⇒-=+ 由()24y ππ=得ln(21)C =-,故通解为 ln csc cot sin 2y y x -=+ln(21)-(4) (05.4) 微分方程0=+'y y x 满足初始条件2)1(=y 的特解为 .巧解 由0=+'y y x 知0)(='xy ,故微分方程的通解为xc y =,由2)1(=y 知2=c ,故所求特解为xy 2=. 二、齐次微分方程1.齐次方程:形如y y f x ⎛⎫'= ⎪⎝⎭的一阶微分方程. 2.齐次方程的解法:设有齐次方程 ⎪⎭⎫⎝⎛='x y f y ,解法:(1) 令,xyu =则 dy du u xdx dx =+;( 注意()u u x = ) (2) 代入原方程得 )(u f dxdux u =+, 即x dx u u f du =-)(; (3) 两端积分,得上述方程通解 C x u +=Φ||ln )(,其中 ⎰-=Φu u f duu )()(;(4) 再将y u x =代入原方程得通解 C x x y +=⎪⎭⎫⎝⎛Φ||ln .例2 (07.3.4)微分方程31()2dy y y dx x x=-满足11x y ==的特解 为 .【答案】应填 .1ln xy x =+【详解】作变量代换y u x =,则dy duu x dx dx=+,代入原方程得312du u x u u dx +=-,即 312du dx u x =-,积分22ln()x y cx = 由1|1x y C e ==⇒=, 故所求特解为 1()1ln xy x e x-=>+. 例3 (98.7) 设函数)(x f 在),1[+∞上连续,若由曲线)(x f y =,直线)1(,1>==t t x x 与x 轴所围成的平面图形绕x 轴旋转一周所成的旋转体的体积为2()[()(1)]3V t t f t f π=-,试求()y f x =所满足的微分方程,并求该微分方程满足条件 22|9x y ==的解. 解 由于d 221()()[()(1)]3t V t f x x t f t f ππ==-⎰,两边对t 求导,得223()2()()f t tf t t f t '=+即 xy y y x 2322-=', 也即 23()2y y y x x'=- 令xy u =,则)1(3d d -=u u x u x .当01u u ≠≠且时,方程变为d d 3(1)u x u u x =-,解之得31u Cx u-=,所以方程有解3y x Cx y -=,c 为任意常数,由92|2==x y ,知1C =-,故所求解为 )1( 13≥+=x xxy . 当001u y u y x =⇒==⇒=or 时不符合已知条件(舍).三、一阶线性微分方程 1.【定义】方程 )()(x Q y x P y =+' 称为一阶线性微分方程. (1) 非齐次方程——0)(≡x Q ;(2) 齐次方程 —— 0)(≡x Q ;0)(=+'y x P y .2.齐次方程0)(=+'y x P y 的通解:()P x dxy Ce -⎰=,其中C 为任意 常数.3.非齐次方程解的结构:方程 )()(x Q y x P y =+'的通解为0()()y y x Y x =+.其中)(0x y 为原方程的特解, ()Y x 为齐次方程 的通解.例4 (06.4) 设非齐次线性微分方程)()(x Q y x P y =+'有两个不同 的解21,y y ,c 为任意常数,则该方程的通解是 ( )(A)12[()()]c y x y x - (B)112()[()()]y x c y x y x +-(C)12[()()]c y x y x + (D)112()[()()]y x c y x y x ++ 答 (B).因为21,y y 是非齐次方程两个不同的解,那么21y y -就是齐 次方程的一个非零解,于是)(21y y c -是齐次方程的通解,从而)(211y y c y -+是非齐次方程的通解⇒选(B)⇒不选(A),(C),(D). 4.非齐次方程)()(x Q y x P y =+'特解的形式()()P x dxy u x e -⎰=. ( 1)()()(C dx x y x Q e x u +⎰±= )5.常数变易法解非齐次线性微分方程的步骤(1) 将齐次通解的C 换成)(x u 即()()P x dxy u x e -⎰=(将其视为非齐次解)显然 ⎰-⎰'='--PdxPdx uPe e u y . (2) 代入非齐次方程Q Py y =+'得 Q Pue uPe e u PdxPdx Pdx =⎰+⎰-⎰'---即 ⎰='PdxQe u ⇒ dx e Q u Pdx ⎰=⎰.(3) 显然dx e x Q e ue y dx x P dx x P dx x P ⎰⎰=⎰=⎰--)()()()(为非齐次的一个 特解.6.非齐次方程的通解:⎪⎭⎫ ⎝⎛+⎰⎰=⎰-C dx e x Q e y dx x P dx x P )()()(, 其中C 为任意常数.例5(07.4.10)设函数()f x 具有连续的一阶导数, 且满足2202)()()(x dt t f t x x f x+'-=⎰,求()f x 的表达公式.【详解1】 2220()()()x xf x x f t dt t f t dt x ''=-+⎰⎰x x f x x f x dt t f x x f x2)()()(2)(220+'-'+'='⎰即 0()2()2xf x x f t d t x ''=+⎰也即 ()2[()(0)]2f x x f x f x '=-+ 由题设知0)0(=f ,故有22()()f x xf x x '-= ,从而]2[)(22c e x e x f xdxxdx +⎰⎰=----⎰=][222c dx e e e x x x ⎰+- =)(22c e e x x +--=21x ce +-将0)0(=f 代入上式得c =1,所以1)(2-=x e x f【详解2】2220()()x x t f t dt x '-+⎰2202)()(x t df t x x +-=⎰22200[()()]2()xxx t f t t f t dt x =---+⎰dt t tf f x x⎰+-=02)(2)]0(1[所以 2()[1(0)]2()x f x x f tf t dt =-+⎰由题设知0)0(=f ,故有x x xf x f 2)(2)(=-', 得21()()f x x f x '=+两边积分得 21l n |()|f x x C +=+于是有 1)(2-=+Cxe x f由0)0(=f 得 C =0,所以1)(2-=x ex f .【详解3】222()()x x t f t d tx '-+⎰20202)(|)(x t df t t f x xx+-=⎰2022)(2)()]0()([x dt t tf x f x f x f x x ++--=⎰dt t tf f x x ⎰+-=02)(2)]0(1[20()[1(0)]2()x f x x f tf t dt =-+⎰由题设知0)0(=f ,故有()2()2f x xf x x '-= ① 由 0)(2)(=-'x xf x f 有x x f x f 2)()(='两边积分得 12|)(|ln C x x f += 于是 2)(x ce x f = 令 2)()(x e x c x f =代入①式得 22)(x xe x c -=' 两边积分得 C e x c x +-=-2)(, 因此 1)(2-=x ce x f 将0)0(=f 代入上式得c =1,所以2()1x f x e =- 例6(灵活解题) 解微分方程 3()0(0)ydx x y dy y +-=>. (3dy y dx y x=-并不是线性方程,转化为下列形式才可以变为一阶线性微分方程)解 原方程可化为21dx x y dy y += 解相应齐次方程10dx x dy y +=得通解 C x y=. 利用常数变异法,令()u y x y=代入原方程整理得334014du y dy du y dy u y C =⇒=⇒=+⎰⎰,代入()u y x y =得原方程的通解为 404xy y C =+.例7(1)(08.4.4)微分方程2()0xy x e dx xdy -+-=的通解为.(0xy xe C x -=-+)提示:方程可化为1x y y xe x -'-=,对应齐次方程的解为y Cx =, 常数变易法得 0x C e C -=-+,通解为0xy xe C x -=-+.(2)(90.5) 求微分方程sin e cos (ln )xy y x x -'+=的通解.解 由一阶线性微分方程的通解公式得通解为)ln (e ]d ln e[e sin d cos sin d cos c x x x c x xe y x xx xxx +-=+=---⎰⎰⎰.解法二 解相应齐次方程 cos 0y y x '+=得通解sin xy Ce -=,令sin xy ue-=代入原方程得0ln u x x x C =-+,所以原方程的通解为 sin e(ln )xy x x x c -=-+.(3)(92.5) 求连续函数)(x f ,使它满足202d ()()x f x f t t x +=⎰.分析:注意方程中隐含的条件(0)0f =.解 对方程两端求导,得x x f x f 2)(2)(=+',这是一阶线性方程, 通解为21e )d e 2(e )(2d 2d 2-+=+=--⎰⎰⎰x c c x x x f x xx. 由(0)0f =得 12c =,故所求函数为211()22x f x e x -=+-.(4)(95.6) 已知连续函数)(x f 满足条件320d e 3()()x x tf x f t =+⎰,求)(x f .解 令3ts =, 则 300d 3d 3()()x x t f t f s s =⎰⎰.(将被积函数化为简单函数)代入题设函数)(x f 所满足的关系式,得x xs s f x f 20e d )(3)(+=⎰.令0=x ,得1)0(=f ,上式两端对x 求导得xx f x f 2e 2)(3)(+=', 故)(x f 是一阶线性方程xx f x f 2e 2)(3)(=-'满足1)0(=f 的特 解,由通解公式得x xc x f 23e 2e)(-=,再由1)0(=f 知3=c .于是所求函数为 x xx f 23e 2e3)(-=.分析:注意方程中隐含的条件1)0(=f .解积分方程时注意:变限函数积分求导数,定限函数积分求积分.例如:(97.4) 若13201d 1()()f x x f x x x =++⎰求10()f x dx ⎰. 解 将方程两边同时求从0到1上的积分得x x x f x x x x x f d ]d )([d 11d )(103102101⎰⎰⎰⎰++= 即x x x x f x x x f d d )(|arctan d )(311101⎰⎰⎰⋅+=x x f x x f d )(414d )(1010⎰⎰+=π所以 3d )(10π=⎰x x f .321()13x f x x π=++(97.3)若函数12201()1()1f x x f x dx x=+-+⎰ 1()f x dx =⎰.答案:ππ-4.例8 (06.8) 在xOy 坐标平面上,连续曲 线L 过点)0,1(M ,其上任意点),(y x P)0(≠x 处的切线斜率与直线OP 的斜 率之差等于ax (常数0>a ),(Ⅰ)求L 的方程; (Ⅱ)当L 与直线ax y =所围成的平面图形的面积为83时,确定a 的值.解(Ⅰ)设曲线L 的方程为)(x f y =且0)1(=f ,则yy ax x'-=, 解齐次微分方程0=-'xyy 得y cx =,令x x u y )(=,代入原方程,由 常数变易法解得 a x u =')( 积分得 0)(c ax x u +=,于是x c ax y 02+=,由0)1(=f 得a c -=0故L 的方程为 2y a x a x =-.(Ⅱ)解方程组2,.y ax ax y ax ⎧=-⎨=⎩ 得交点坐标为(0,0),(2,2),aL 与直线ax y =所围成的平面图形如图29-,其面积为3222200(2)()|3x s ax ax dx a x =-+=-+⎰8(4)3a =-+,又38=s ,由38)438(=+-a ,得2=a .例9 (03.9) 设)()()(x g x f x F =,其中函数)(),(x g x f 在),(+∞-∞内满足以下条件: ()(),()()f x g x g x f x ''==且 (0)0f =,()()2e x f x g x +=.(1)求)(x F 所满足的一阶微分方程;(2)求出)(x F 的表达式.解 (1) 由条件有e 222()()()(2)2()x F x g x f x F x '=+=-,可知)(x F 所满足的一阶微分方程为4e 2()2()x F x F x '+=.(2)由一阶线性微分方程的通解公式得方程的通解为d de [e e d e e 22222()4]x x x x x F x x c c --⎰⎰=+=+⎰.将0)0(=F 代入,可得1-=c ,所以)(x F 的表达式为x x x F 22e e )(--=.例10(01.7) 已知)(x f n 满足x n n n e x x f x f 1)()(-+='(n 为正整数),且n f n e )1(=,求函数项级数∑∞=1)(n n x f 之和. 解 由已知条件可知)(x f n 满足一阶线性微分方程x n n n x x f x f e )()(1-=-' 其通解为).(e )(c n x x f n xn +=由nf n e )1(=,得0=c , 故ne x xf xn n =)(, 这样 n x n x x f n n x x n n n n ∑∑∑∞=∞=∞===111e e )(. 设∑∞==1)(n nnx x S ,其收敛域为)1,1[-,且0)0(=S ,当)1,1(-∈x 时,有x x x S n n -=='-∞=∑11)(11,于是 )1l n (d 11d )()0()(00x t tt t S S x S x x --=-='+=⎰⎰, 由)(x S 及)1ln(x --在1-=x 的连续性知,上述和函数在1-=x 也成立,所以当11<≤-x 时,有)1ln(e )(1x x f x n n --=∑∞=.例11(2010.3.4)设12,y y 是一阶非齐次微分方程 ()()y p x y q x '+=的两个特解,若常数,λμ使12y y λμ+是该方程的解,12y y λμ-是对应齐次方程的解,则( )(A )11,22λμ==; (B)11,22λμ=-=-; (C )21,33λμ==; (D )22,33λμ==. 答案:(A ).解 利用解性质与解结构判断.由12y y λμ+是该方程的解得 1212()()()()y y p x y y q x λμλμ'+++=将1122()()()()y p x y q x y p x y q x '+=⎫⎬'+=⎭代入上述方程得 11()q q q λμλμ+=⇒+=,同理12y y λμ-是对应齐次方程的解00(2)q q λμλμ⇒-=⇒-= 综合(1)(2)解得11,22λμ==. 第四节 可降阶的二阶微分方程二阶微分方程(,,)y f x y y '''=通过适当的变量替换可以转化为一阶微分方程,具有此类性质的方程称为可降阶的二阶微分方程.一、)(x f y =''型的微分方程(直接积分求通解)由1()()'''=⇒=+⎰y f x y f x dx C12[()]⇒=++⎰⎰y f x dx C dx C得原方程通解为 12[()]y f x dx dx C x C =++⎰⎰. 例12 求方程21s i n 23x x y e ''=-的通解. 解:两边积分得 211()3cos 43x x y y dx e C '''==++⎰; 两边再积分得原方程的通解为21219sin 83x x y y dx e C x C '==+++⎰. 二、(,)y f x y '''=型的微分方程(不显含y 的方程)解法:(1) 令y p '=(注意p 为x 的函数), 方程化为 (,)p f x p '=;解此方程得通解),(1C x p ϕ=;(1) 再解方程 ),(1C x y ϕ=' 得原方程的通解21),(C dx C x y +=⎰ϕ.对不显含y 的方程,通过变量替换y p '=,使原方程变为 只含p 、x 的一阶微分方程,求出通解后再回代得到关于x 、y 的一阶微分方程,进而求出原方程组的解.三、(,)y f y y '''=型的微分方程(不显含x 的方程)解法:(1) 令y p '=, 视p 为y 的函数, 注意到()y y x = 那么 d p d p d y d p y p dx dy dx dy''==⋅=, 代入原方程, 得 ),(p y f dydp p =,解此方程得通解 ),(1C y p ϕ=; (2) 再解方程 ),(1C y y ϕ=' 得原方程的通解21),(C x C y dy +=⎰ϕ.对不显含x 的方程,通过变量替换y p '=,使原方程变为只 含p 、y 的一阶微分方程,求出通解后再回代得到关于x 、y 的一阶微分方程,进而求出原方程组的解.例13 解方程(1)21()y y '''=+解 此方程既不显含x 也不显含y ,用不显含y 的方程求解, 设 p y =',则将 p y '=''代入方程得 2211dp p p dx p'=+=+即,积分得x 1arctanp=+C 所以 1tan()p x C =+ 即11sin()cos()x C dy dx x C +=+,积分得 通解为 12ln cos()y x C C =-++.(2)3()y y y ''''=+解 此方程既不显含x 也不显含y ,用不显含x 的方程求解, 设 p y =',则yp py d d =''代入方程得 321dp dp p p p dy dy p =+=+即, 两端积分得1arctanp=y+C 所以 1tan()p y C =+即 11c o s ()s i n ()y C dx dy y C +=+,积分得通解为 1212ln sin()ln sin()xy C x C y C C e +=++=即.例14(96.数1-2.7分)设对0x ∀>,曲线()y f x =上一点 (,())x f x 处的切线在y 轴上的截距为01()x f t dt x ⎰, 求()f x 的表达式.解 过所给点的切线方程为 ()()()Y f x f x X x '-=-, 令0X =得()()Y f x f x x '=-, 依题意得01()()()x f x f x x f t dt x '-=⎰, 两边求导得200()x y xy x '''+=>(不显含y 的方程),设p y =',则p y '=''代入方程得110,c c dy xp p p x dx x'+=⇒==由,故 12()ln f x c x c =+. 第七节 二阶常系数线性微分方程一、二阶常系数线性微分方程及其解的结构1.【定义】方程 ()y py qy f x '''++= 称为二阶线性微分方程.其中,p q 为实常数,()f x 为x 的已知函数(自由项).齐次方程——若0)(≡x f ,称方程为齐次方程;非齐次方程——若0)(≡/x f ,称方程为非齐次方程.2.二阶常系数齐次线性微分方程解的结构:1))(),(x v x u 线性无关:C x v x u ≡/)()(, (C 为常数,0)(≠x v ). 例如:① x x sin ,cos 线性无关. (因 ≡/xx sin cos 常数) 2)齐次线性方程解性质:(1)设)(1x y 是方程的解且C 为任意常数,则1()y Cy x =仍为方程的解.(2)设)(1x y 与)(2x y 是方程的解,则12()()y y x y x =+仍为方程的解.3)结论:设)(1x y 与)(2x y 是齐次线性方程的两个的解,则 )()(2211x y C x y C y +=(21,C C 是任意常数)为齐次方程的解.4)【 定理1】(齐次微分方程解的结构)设)(1x y 与)(2x y 是齐次线 性方程的两个线性无关的解,则)()(2211x y C x y C y +=(21,C C 是 任意常数)为齐次方程的通解.例: 易知,x x e e -均为方程0y y ''-=的解,又因,x x e e -线性无关, 则方程的通解为12x x y C e C e -=+, (21,C C 是任意常数). 例: 易知x x sin ,cos 均为方程0=+''y y 的解,又因x x sin ,cos 线 性无关,则方程的通解为x C x C y sin cos 21+=, (21,C C 是任意常数).3. 二阶常系数非齐次线性微分方程解的结构:1) 非齐次线性微分方程解性质:(1)设)(1x y 与)(2x y 是非齐次方程的两个的解,则12()()y x y x - 为对应齐次线性微分方程的解.(2))(1x y 齐次方程的解, )(*x y 是非齐次方程的解,则 *1()()y y x y x =+是非齐次方程的解.2) 【定理2】(非齐次微分方程解的结构)设)(*x y 是二阶非齐次 线性方程)(x f qy y p y =+'+''的一个特解,)(x Y 是其对应齐次 方程通解,则*()()y Y x y x =+是非齐次方程的通解.提问:123(),(),()y x y x y x 为给定非齐次方程的三个线性无关的解, 则通解为1121231()()[()()][()()]y x y x C y x y x C y x y x =+-+-?5)定理3:(非齐次方程解的叠加原理)设)(*x y k 为方程 ()k y py qy f x '''++=的特解, n k ,,2,1 =.则∑==n k k x yx Y 1*)()(为方程∑==+'+''n k k x f qy y p y 1)(的特解. 证明:)()()(x qY x Y p x Y +'+''∑∑===+'+''=n k k n k kk k x f x qy x y p x y 11***)()}(])([])({[. 二、二阶常系数齐次线性方程及其解法方程 0=+'+''qy y p y 的解形式.特征方程根 方程的通解21r r ≠ 1212r x r x y C e C e =+21r r r ==12()rx y C C x e =+βαi r ±= 12(cos sin )x y e C x C x αββ=+)0(≠β例15 (94.5) 设函数)(x y y =满足条件4400204,(),().y y y y y '''++=⎧⎨'==-⎩求广义积分0d ()y x x +∞⎰.解 特征方程为0442=++r r ,解之得221-==r r ,原方程的通解 为x x c c y 221e )(-+=, 由初始条件得0,221==c c ,故 微分方程的特解为x y 2e 2-=,故1)2(d e d e 2d )(20200===-+∞-+∞+∞⎰⎰⎰x x x x y x x . 三、二阶常系数非齐次方程及其解法1.方程的形式:)(x f qy y p y =+'+'' (*)2.解法步骤:(1) 先求出其对应齐次方程的通解 )()(2211x y C x y C y +=;(2) 再求出非齐次方程的一个特解 )(*x y ;(3) 那么原方程的通解为 )()()(*2211x y x y C x y C y ++=.3.特解的常见解法:待定系数法;常数变异法.4.待定系数法求非齐次方程的特解两个重要结论:(待定系数法求解)1).设()()x m f x e P x λ=,若λ是常数(若0λ=则()()m f x P x =),则二阶常系数非齐次方程(*)具有特解*()()k x m y x x Q x e λ=,()(x P m ,)(x Q m 均为x 的m 次多式). k (2,1,0=k )的取值如下:(1)若λ不是特征方程02=++q pr r 的根,取k o =.(2)若λ是特征方程02=++q pr r 的单根,取1k =.(3)若λ是特征方程02=++q pr r 的二重根,取2k =.例16 (89.5) 求微分方程x y y y -=+'+''e 265的通解.解 特征方程为0652=++r r ,解之得特征根为2-和3-,对应齐次微分方程的通解为 x x c c x y 3221*e e )(--+=,其中 21,c c 为任意常数.由 0,0,1k m λ===-.设所给非齐次方程的特解为x A x y -=e )(~, 将)(~x y 代入原方程,得1=A ,于是原方程的特解为xx y -=e )(~. 综上所述原方程的通解为x x x c c y ---++=e e e 3221.例17 (00.6) 求微分方程22e 0x y y '''--=满足条件01()y =,01()y '=的解.解 对应齐次方程02='-''y y 的特征方程为022=-r r , 解之得特征根2,021==r r ,对应齐次方程的通解为xc c y 221*e +=. 由 1,0,2k m λ===. 设非齐次方程的特解为x Ax y 2e ~=,则22e 2e xx y A Ax '=+,x x Ax A y 22e 4e 4~+='',代入原方程,可得21=A .则x x y 2e 21~=. 这样原方程的通解为x x c c y y y 221e )21(~++=+=*, 由初始条件知 12211212C C C +=⎧⎪⇒⎨+=⎪⎩41,4321==c c , 于是 所求特解为 x x y 2e )21(4143++=. 例18求微分方程2e x y y y '''-+=满足条件1)0(=y , 1)0(='y 的特解.解 对应齐次方程20y y y '''-+=的特征方程为2210r r -+=,解之得特征根121r r ==,对应齐次方程的通解为*12()e x y c xc =+.由于1λ=为特征方程的根的二重根,设非齐次方程的特解为 2e x y Ax =,则将22e 2e x x y A Ax '=+, x x Ax A y 22e 4e 4~+='',代入原方程, 可得 21=A .则21e 2x y x =. 这样原方程的通解为2121()e e 2x x y y y c c x x *=+=++,由初始条件知1212110C C C C =⎧⇒=-⎨+=⎩, 于是所求解为21(1)e 2x y x x =-+. 例19 设函数()y f x =满足微分方程322xy y y e '''-+=,且其图 形在(0,1)点处的切线与曲线21y x x =-+在该点的切线重合,求 10()f x dx ⎰.解:解微分方程的特征方程 2123201,2r r r r -+=⇒==⇒ 对应齐次方程的通解为212e e x x y C C =+,因为1λ=为特征方程的单根,设e x y Ax *=为原方程的特解, 代入原方程得 2A =- 所以原方程的通解为 212e e 2e x x x y C C x =+-.依题意得 12112211(0)1(0)12210C C C y y C C C +===⎧⎧⎧⇒⇒⎨⎨⎨'=--++=-=⎩⎩⎩ 从而 ()2x x f x xe e =-+,故 111000()(2)[(32)]3x x x f x dx xe e dx x e e =-+=-=-⎰⎰. 2).设]sin cos [)(x P x P e x f n l x ωωλ+=,},max{n l m =,ωλμi +=,若μ为特征方程02=++q pr r 的k 重根)1,0(=k ,则方程(*)具有特解 ]s i n c o s[)()2()1(*x R x R e x x y m m x k ωωλ+=, 其中:)2()1(,,,m m n l R R P P 分别为m m n l ,,,次多项式,且λ、ω均为常数.而k 的取值如下:(1)若ωλμi +=(或i μλω=-)不是特征方程02=++q pr r的根,取k o =.(2)若ωλμi +=(或i μλω=-)是特征方程02=++q pr r 的根, 取1k =.例20 方程x y y sin =+''的一个特解.解:(1) x x P x P e x f n l x sin ]sin cos [)(=+=ωωλ,1,0,0,1,0=====ωλm P P n l ,(2) i i =+=ωλμ为特征方程012=+r 的单根, 取1k =. 那么原方程具有特解x bx x ax x R x R e x y m m x k sin cos ]sin cos [)2()1(+=+=ωωλ(3) )cos sin ()sin cos (x bx x ax x b x a y +-++='x ax b x bx a sin )(cos )(-++=,]cos )(sin )([)sin cos (x ax b x bx a x a x b y -++-+-='' x bx a x ax b sin )2(cos )2(+--=,(4) 代入原方程x y y sin =+'', 有x x bx x ax x bx a x ax b sin sin cos sin )2(cos )2(=+++--即 x x a x b s i n s i n 2c o s 2=- ⇒ 0=b , 21-=a . (5) 所以原方程有一个特解x x x bx x ax y cos 21sin cos *-=+=. 例21 方程4sin y y x ''+=的一通解.解:由特征方程012=+r 得r i =±⇒对应齐次方程的通解为12cos sin y C x C x =+.又由()[cos sin ]4sin x l n f x e P x P x x λωω=+=,0,4,0,0,1l n P P m λω=====,而 i i =+=ωλμ为特征方程012=+r 的单根, 取1k = 那么原方程具有特解x bx x ax x R x R e x y m m x k sin cos ]sin cos [)2()1(+=+=ωωλ将)cos sin ()sin cos (x bx x ax x b x a y +-++='x ax b x bx a sin )(cos )(-++=,]cos )(sin )([)sin cos (x ax b x bx a x a x b y -++-+-=''x bx a x ax b sin )2(cos )2(+--=,代入原方程4sin y y x ''+=, 有(2)c o s (2)s i n c o s s i n b a x x a b x x a x x b x x x --+++= 即 2c o s 2s i n 4s i b x a x x -= ⇒ 0=b , 2a =-.所以原方程有一个特解 *cos sin 2cos y ax x bx x x x =+=-.故原方程得通解为 12cos sin y C x C x =+2cos x x -.(12,C C R ∈)例22 求方程x x y y 2cos =+''的一个特解.解:(1) x x x P x P e x f n l x2cos ]sin cos [)(=+=ωωλ,2,0,1,0,=====ωλm P x P n l ,(2) i i 2=+=ωλμ不是特征方程012=+r 的根, ,取k o =.那么原方程具有特解 ]sin cos [)2()1(x R x R e x y m m x k ωωλ+=x d cx x b ax 2sin )(2cos )(+++=(3) x d cx x b ax x c x a y 2cos )(22sin )(22sin 2cos +++-+='x ax b c x cx d a 2sin )22(2cos )22(--+++=, x a x c y 2sin 22cos 2-=''x ax b c x cx d a 2cos )22(22sin )22(2--+++- x cx d a x ax b c 2sin )444(2cos )444(++---=, (4) 代入原方程x x y y 2cos =+'', 有x cx d a x ax b c 2sin )444(2cos )444(++---x x x d cx x b ax 2cos 2sin )(2cos )(=++++即 x x x cx d a x ax b c 2cos 2sin )334(2cos )334(=++---.(5) 列方程组⎪⎪⎩⎪⎪⎨⎧==+=-=-.03,034,13,034c d a a b c ⇒ 31-=a , 0==c b , 94=d .(6) 所以原方程有一个特解x x x x d cx x b ax y 2sin 942cos 312sin )(2cos )(*+-=+++=.常数变异法求二阶常系数非齐次线性微分方程特解 用观察法找非齐次方程的解很方便,也是可行的.但是对于比较复杂的方程和初学者而言,要观察出特解很不容易.为此介绍一个求非齐次方程的特解的方法:常数变异法.设齐次方程0y py q '''++=的通解为1122y C u C u =+,其中 1C ,2C 为任意常数,12,u u 是方程的两个线性无关的特解. 用12(),()v x v x 取代12,C C ,即 1122()()y v x u v x u =+ (1) 式(1),以及它的一、二阶导数应使()y py q f x '''++=成立,求(1)式对x 的导数,有 11221122()y v u v u v u v u '''''=+++(2) 为确定x 的任意函数12(),()v x v x ,要求12(),()v x v x 满足以下条件: 第一个条件是 11220v u v u ''+=由此,(2)式变为 1122y v u v u '''=+ (3) 将(3)式两边再求对x 的导数,得11221122()y v u v u v u v u ''''''''''=+++ 将(1)(2)(3)式都代入原方程,整理得111122221122()()()()v u pu qu v u pu qu v u v u f x ''''''''''+++++++= 由于12,u u 是方程的解,所以上式可以化为 1122()v u v u f x ''''+= (4) (4)式是任意函数12(),()v x v x 满足的第二个条件.即为使 1122()()y v x u v x u =+是非齐次方程的特解,12(),()v x v x应该满足方程组 112211220()v u v u v u v u f x ⎧''+=⎪⎨''''+=⎪⎩ (5)此为关于12,v v ''的线性方程组,由于12,u u 线性无关,,即12u u 不等于常数,所以上面方程组的行列式122112212212()0u u u u u u u u u u u '''=-=-≠'',因此,上面关于12,v v ''的线性方程组有唯一解.解出12,v v ''后,取积分就可以确定出12(),()v x v x ,代入1122()()y v x u v x u =+就得到了非齐次方程的特解.例23 求非齐次方程 32xy y y xe '''-+=的通解.解:不难求出对应的齐次方程组的通解为 *212x xy C e C e =+设原方程有特解 212()()x x y v x e v x e =+, 则12(),()v x v x 满足方程组21212212120022xx x x x x xe v e v v e v e v e v xe v e v x ''''⎧⎧+=+=⎪⎪⇒⎨⎨''''+=+=⎪⎪⎩⎩解之得 12,x v x v xe -''=-=,积分得 2121,(1)2x v x v x e -=-=-+,从而特解为21(1)2x y x x e =-++故原方程的通解为 22121(1)2x x xy C e C e x x e =+-++即 22121()2xx y x x e C C e '=-+++, 其中 111C C '=-,2C 为任意常数. 常数变异法求非齐次方程特解有时计算较复杂.因此,当()f x具有某些特定形式时,利用待定系数法求非齐次方程的特解更方便. 待定系数法的思路是:方程()y py q f x '''++=的特解y 应与()f x 的形式相同.因此可设特解y 为形式与()f x 相同但含有待定系数的函数(这时称y 为试解),将y 代入原方程.利用方程两端对于x 的任意取值恒等的条件,确定待定系数的值,从而求出原方程的特解.对于()f x 的几种常见形式,设特解的方法如表9-2(表中01()m m m P x a a x a x =+++为已知多项式):表9-2()f x 的形式 取试解的条件试解y 的形式()()m f x P x =零不是特征根01()m m m y Q x A A x A x ==+++01,,,m A A A 为待定常数零是特征单根()m y xQ x =零是二重特征根2()m y x Q x = ()()x m f x e P x α=α为已知常数α不是特征根 ()x m y e Q x α= α是单特征根()x m y xe Q x α= α是二重特征根2()x m y x e Q x α=1()(cos x f x e a x αβ=2sin )a x β+12,,,a a αβ均为已知常数i αβ±不是特征根 1(cos x y e A x αβ=2sin )A x β+12,A A 为待定常数i αβ±是特征根1(cos x y xe A x αβ=2sin )A x β+12,A A 为待定常数。
《常微分方程》全套课件(完整版)
例1 物体下落问题 设质量为m的物体,在时间t=0时,在距
地面高度为H处以初始速度v(0) = v0垂直地面 下落,求ss此物体下落时距离与时间的关系.
有恒等式
因此,令
,则有
因此,所谓齐次方程,实际上就是方程(1.9)的右端函数 是一个关于变元x,y的零次齐次式.
如果我们把齐次方程称为第一类可化为变量分离的方程,那么我们 下面要介绍第二类这种方程.
1.3.2 第二类可化为变量可分离的方程 形如 (1.30) 的方程是第二类可化为变量可分离的方程.其中, 显然,方程(1.30)的右端函数,对于x,y并不
是方程(1.5)在区间(-1,+1)
上的解,其中C是任意常数.又方程(1.5)有两个明显
的常数解y =±1,这两个解不包含在上述解中.
3. 函数
是方程(1.6)在区间(-∞,
+∞)上的解,其中和是独立的任意常数.
4. 函数
是方程(1.7)在区间(-
∞,+∞)上的解,其中和是独立的任意常数.
这里,我们仅验证3,其余留给读者完成.事实上,
(1.13)
显然,方程(1.4)是一阶线性方程;方程(1.5)是一阶非线性方程;方程 (1.6)是二阶线性方程;方程(1.7)是二阶非线性方程.
通解与特解
微分方程的解就是满足方程的函数,可定义如下.
定义1.1 设函数 在区间I上连续,且有直
到n阶的导数.如果把
代入方程(1.11),得到在
区间I上关于x的恒等式,
常微分方程讲义++很详细
定值.方程(1.12)的初值问题常记为
(1.16) 初值问题也常称为柯西(Cauchy)问题. 对于一阶方程,若已求出通解 ,只要把初值条件
代入通解中,得到方程
从中解出 C,设为
,代入通解,即得满足初值条件的解
.
对于 n 阶方程,若已求出通解 得到 n 个方程式
后,代入初值条件(1.15),
(1.17)
2 讲 变量可分离方程方程?1.什么是变量可分离方程?1.什
么是 21.什么是变量可分离方程? 什形如
1. 或
(1.18)
(1.19) 的方程,称为变量可分离方程.我们分别称(1.18)、(1.19)为显式变量可分离方程和微 分形式变量可分离方程. 方程(1.18)的特点是,方程右端函数是两个因式的乘积,其中一个因式是只含 x 的函数,另一个因式是只含 y 的函数.而方程(1.19)是(1.18)的微分形式.例如,方 程
是未知函数对 t 导
数.现在,我们还不会求解方程(1.1),但是,如果考虑 k=0 的情形,即自由落体运动,此 时方程(1.1)可化为
(1.2) 将上式对 t 积分两次得
(1.3) 其中 和 是两个独立的任意常数,它是方程(1.2)的解.
一般说来,微分方程就是联系自变量、未知函数以及未知函数的某些导数之间的关
系式.如果其中的未知函数只与一个自变量有关,则称为常微分方程;如果未知函数是 两个或两个以上自变量的函数,并且在方程中出现偏导数,则称为偏微分方程.本书所 介绍的都是常微分方程,有时就简称微分方程或方程. 例如下面的方程都是常微分方程
(1.4)
(1.5)
(· =
)
(1.6)
(′=
)
(1.7)
在一个常微分方程中,未知函数最高阶导数的阶数,称为方程的阶.这样,一阶常 微分方程的一般形式可表为 (1.8) 如果在(1.8)中能将 y′解出,则得到方程 (1.9) 或 (1.10)
MIT公开课:单变量微积分讲义unit1(1~7)
Lecture 1
18.01 Fall 2006
Unit 1: Derivatives
A. What is a derivative?
• Geometric interpretation • Physical interpretation • Important for any measurement (economics, political science, finance, physics, etc.)
Lecture 1: Derivatives, Slope, Velocity, and Rate of Change
Geometric Viewpoint on Derivatives
y
Q Secant line P f(x) x0 x0+∆x Tangent line
Figure 1: A function with secant and tangent lines The derivative is the slope of the line tangent to the graph of f (x). But what is a tangent line, exactly? 1
Δx→0
n times
lim
Δy = nxn−1 Δx
Therefore,
d n x = nxn−1 dx This result extends to polynomials. For example, d 2 (x + 3x10 ) = 2x + 30x9 dx
Physical Interpretation of Derivatives
Area = 1 1
(2y0 )(2x0 ) = 2x0 y0 = 2x0 ( ) = 2 (see Fig. 5) 2 x0
MIT麻省理工学院 算法导论公开课 Problem Set 4 solution
Introduction to Algorithms October 29, 2005 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik D. Demaine and Charles E. Leiserson Handout 18Problem Set 4 SolutionsProblem 4-1. TreapsIf we insert a set of n items into a binary search tree using T REE-I NSERT, the resulting tree may be horribly unbalanced. As we saw in class, however, we expect randomly built binary search trees to be balanced. (Precisely, a randomly built binary search tree has expected height O(lg n).) Therefore, if we want to build an expected balanced tree for a fixed set of items, we could randomly permute the items and then insert them in that order into the tree.What if we do not have all the items at once? If we receive the items one at a time, can we still randomly build a binary search tree out of them?We will examine a data structure that answers this question in the affirmative. A treap is a binary search tree with a modified way of ordering the nodes. Figure 1 shows an example of a treap. As usual, each item x in the tree has a key key[x]. In addition, we assign priority[x], which is a random number chosen independently for each x. We assume that all priorities are distinct and also that all keys are distinct. The nodes of the treap are ordered so that (1) the keys obey the binary-search-tree property and (2) the priorities obey the min-heap order property. In other words,•if v is a left child of u, then key[v]<key[u];•if v is a right child of u, then key[v]>key[u]; and•if v is a child of u, then priority(v)>priority(u).(This combination of properties is why the tree is called a “treap”: it has features of both a binary search tree and a heap.)Figure 1: A treap. Each node x is labeled with key[x]:p riority[x]. For example, the root has key G and priority 4.It helps to think of treaps in the following way. Suppose that we insert nodes x1,x2,...,x n, each with an associated key, into a treap in arbitrary order. Then the resulting treap is the tree that wouldhave been formed if the nodes had been inserted into a normal binary search tree in the order given by their (randomly chosen) priorities. In other words, priority[x i]<priority[x j]means that x i is effectively inserted before x j.(a) Given a set of nodes x1,x2,...,x n with keys and priorities all distinct, show that thereis a unique treap with these nodes.Solution:Prove by induction on the number of nodes in the tree. The base case is a tree withzero nodes, which is trivially unique. Assume for induction that treaps with k−1orfewer nodes are unique. We prove that a treap with k nodes is unique. In this treap, theitem x with minimum priority must be at the root. The left subtree has items with keys<key[x]and the right subtree has items with keys >key[x]. This uniquely defines theroot and both subtrees of the root. Each subtree is a treap of size ≤k−1, so they areunique by induction.Alternatively, one can also prove this by considering a treap in which nodes are inserted in order of their priority. Assume for induction that the treap with the k−1nodes with smallest priority is unique. For k=0t his is trivially true. Now considerthe treap with the k nodes with smallest priority. Since we know that the structureof a treap is the same as the structure of a binary search tree in which the keys areinserted in increasing priority order, the treap with the k nodes with smallest priorityis the same as the treap with the k−1nodes with smallest priority after inserting thek-th node. Since BST insert is a deterministic algorithm, there is only one place thek-th node could be inserted. Therefore the treap with k nodes is also unique, provingthe inductive hypothesis.(b) Show that the expected height of a treap is O(lg n), and hence the expected time tosearch for a value in the treap is O(lg n).Solution: The idea is to realize that a treap on n nodes is equivalent to a randomlybuilt binary search tree on n nodes. Recall that assigning priorities to nodes as theyare inserted into the treap is the same as inserting the n nodes in the increasing orderdefined by their priorities. So if we assign the priorities randomly, we get a randomorder of n priorities, which is the same as a random permutation of the n inputs, sowe can view this as inserting the n items in random order.The time to search for an item is O(h)where h is the height of the tree. As we saw inlecture, E[h]=O(lg n). (The expectation is taken over permutations of the n nodes,i.e., the random choices of the priorities.)Let us see how to insert a new node x into an existing treap. The first thing we do is assign x a random priority priority[x]. Then we call the insertion algorithm, which we call T REAP-I NSERT, whose operation is illustrated in Figure 2.(e) (f)Figure 2: Operation of T REAP-I NSERT. As in Figure 1, each node x is labeled with key[x]: priority[x]. (a) Original treap prior to insertion. (b) The treap after inserting a node with key C and priority 25. (c)–(d) Intermediate stages when inserting a node with key D and priority 9.(e) The treap after insertion of parts (c) and (d) is done. (f) The treap after inserting a node with key F and priority 2.(c) Explain how T REAP-I NSERT works. Explain the idea in English and give pseudocode.(Hint: Execute the usual binary search tree insert and then perform rotations to restorethe min-heap order property.)Solution: The hint gives the idea: do the usual binary search tree insert and thenperform rotations to restore the min-heap order property.T REAP-I NSERT (T,x)inserts x into the treap T(by modifying T). It requires that xhas defined key and priority values. We have used the subroutines T REE-I NSERT,R IGHT-R OTATE, and R IGHT-R OTATE as defined in CLRS.T REAP-I NSERT (T,x)1T REE-I NSERT (T,x)2 while x =root[T]and priority[x]<priority[p[x]]3 do if x=left[p[x]]4 then R IGHT-R OTATE (T,p[x])5 else L EFT-R OTATE (T,p[x])Note that parent pointers simplify the code but are not necessary. Since we only needto know the parent of each node on the path from the root to x(after the call toT REE-I NSERT), we can keep track of these ourselves.(d) Show that the expected running time of T REAP-I NSERT is O(lg n). Solution:T REAP-I NSERT first inserts an item in the tree using the normal binary search treeinsert and then performs a number of rotations to restore the min-heap property.The normal binary-search-tree insertion algorithm T REE-I NSERT always places thenew item at a new leaf of tree. Therefore the time to insert an item into a treap isproportional to the height of a randomly built binary search tree, which as we saw inlecture is O(lg n)in expectation.The maximum number of rotations occurs when the new item receives a priority lessthan all priorities in the tree. In this case it needs to be rotated from a leaf to the root.An upper bound on the number of rotations is therefore the height of a randomly builtbinary search tree, which is O(lg n)in expectation. (We will see that this is a fairlyloose bound.) Because each rotation take constant time, the expected time to rotate isO(lg n).Thus the expected running time of T REAP-I NSERT is O(lg n+lg n)=O(lg n).T REAP-I NSERT performs a search and then a sequence of rotations. Although searching and rotating have the same asymptotic running time, they have different costs in practice. A search reads information from the treap without modifying it, while a rotation changes parent and child pointers within the treap. On most computers, read operations are much faster than write operations. Thus we would like T REAP-I NSERT to perform few rotations. We will show that the expected number of rotations performed is bounded by a constant (in fact, less than 2)!(a) (b)Figure 3: Spines of a binary search tree. The left spine is shaded in (a), and the right spine is shaded in (b).In order to show this property, we need some definitions, illustrated in Figure 3. The left spine of a binary search tree T is the path which runs from the root to the item with the smallest key. In other words, the left spine is the maximal path from the root that consists only of left edges. Symmetrically, the right spine of T is the maximal path from the root consisting only of right edges. The length of a spine is the number of nodes it contains.(e) Consider the treap T immediately after x is inserted using T REAP-I NSERT. Let Cbe the length of the right spine of the left subtree of x. Let D be the length of theleft spine of the right subtree of x. Prove that the total number of rotations that wereperformed during the insertion of x is equal to C+D.Solution: Prove the claim by induction on the number of rotations performed. Thebase case is when x is the parent of y. Performing the rotation so that y is the new rootgives y exactly one child, so C+D=1.Assume for induction that the number of rotations k performed during the insertionof x equals C+D. The base case is when 0 rotations are necessary and x is insertedas a leaf. Then C+D=0. To prove the inductive step, we show that if after k−1rotations C+D=k−1, then after k rotations C+D=k. Draw a picture of aleft and right rotation and observe that C+D increases by 1 in each case. Let y bethe parent of x, and suppose x is a left child of y. After performing a right rotation, ybecomes the right child of x, and the previous right child of x becomes the left childof y. That is, the left spine of the right subtree of x before the rotation is tacked onto y, so the length of that spine increases by one. The left subtree of x is unaffectedby a right rotation. The case of a left rotation is symmetric. Therefore after one morerotation C+D increases by one and k=C+D, proving the inductive hypothesis.We will now calculate the expected values of C and D. For simplicity, we assume that the keys are 1,2,...,n. This assumption is without loss of generality because we only compare keys.�For two distinct nodes x and y , let k = key [x ]and i = key [y ], and define the indicator random variableX 1 if y is a node on the right spine of the left subtree of x (in T ),i,k =0 otherwise .(f) Show that X i,k =1if and only if (1) priority [y ]> priority [x ], (2) key [y ]< key [x ], and(3) for every z such that key [y ]< key [z ]< key [x ],we have p riority [y ]< priority [z ].Solution:To prove this statement, we must prove both directions of the “if and only if”. Firstwe prove the “if” direction. We prove that if (1) priority [y ]> priority [x ], (2) key [y ]<key [x ], and (3) for every z such that key [y ]< key [z ]< key [x ]are true, priority [y ]< priority [z ], then X i,k =1. We prove this by contradiction. Assume that X i,k =0. That is, assume that y is not on the right spine of the left subtree of x . We show thatthis leads to a contradiction. If y is not on the right spine of the left subtree of x ,it could be in one of three places:1. Suppose y is in the right subtree of x . This contradicts condition (2) becausekey [y ]< key [x ].2. Suppose y is not in one of the subtrees of x . Then x and y must share somecommon ancestor z . Since key [y ]< key [x ], we know that y is in the left subtreeof z and x is in the right subtree of z and key [y ]< key [z ] < key [x ]. Since y isbelow z in the tree, priority [z ]< priority [x ]and priority [z ]< priority [y ]. Thiscontradicts condition (3).3. Suppose that y is in the left subtree of x but not on the right spine of the leftsubtree of x . This implies that there exists some ancestor z of y in the left subtreeof x such that y is in the left subtree of z . Hence key [y ]< key [z ]< key [x ]. Sincez is an ancestor of y , priority [z ]< priority [y ], which contradicts condition (3).All possible cases lead to contradictions, and so X i,k =1.Now for the “only if” part. We prove that if X i,k =1, then statements (1), (2), and (3) are true. If X i,k =1, then y is in the right spine of the left subtree of x . Since y is ina subtree of x , y must have been inserted after x ,so p riority [y ]> priority [x ], proving(1). Since y is in the left subtree of x , key [y ]< key [x ], proving (2). We prove (3) by contradiction: suppose that X i,k =1and there exists a z such that key [y ]< key [z ]< key [x ]and priority [z ]< priority [y ]. In other words, z was inserted before y . There arethree possible cases that satisfy the condition key [z ]< key [x ]:1. Suppose z is in the right spine of the left subtree of x .For y to be inserted into theright spine of the left subtree of x , it will have to be inserted into the right subtreeof z . Since key [y ]< key [z ], this leads to a contradiction.2. Suppose z is in the left subtree of x but not in the right spine. This implies thatz is in the left subtree of some node z in the right spine of x . Therefore for y tobe inserted into the right spine of the left subtree of x , it must be inserted into theright subtree of z . This leads to a contradiction by reasoning similar to case 1.3. Suppose that z is not in one of the subtrees of x . Then z and x have a commonancestor z such that z is in the left subtree of z and x is in the right subtree of x .This implies key [z ] < key [z ] < key [x ]. Since key [y ]< key [z ]< key [z ], y cannotbe inserted into the right subtree of z . Therefore it cannot be inserted in a subtreeof x , which is a contradiction.Therefore there can be no z such that key [y ] < key [z ] < key [x ] and priority [z ] < priority [y ]. This proves statement (3). We have proven both the “if” and “only if” directions, proving the claim.(g) Show that(k − i − 1)! 1 Pr {X i,k =1} == . (k − i +1)! (k − i +1)(k − i )Solution: We showed in the previous part that X i,k =1if and only if the priorities of the items between y and x are ordered in a certain way. Since all orderings are equally likely, to calculate the probability we count the number of permutations of priorities that obey this order and divide by the number of total number of priority permutations. We proved in (e) that whether or not X i,k =1depends only on the relative ordering of the priorities of y , x , and all z such that key [y ] < key [z ] < key [x ]. Since we assumed that the keys of the items come from {1,...,n }, the keys of the items in question are i,i +1,i +2,...,k − 1,k . There are (k − i +1)!permutations of the priorities of these items. Of these permutations, the ones for which X i,k =1are those where i has minimum priority, k has the second smallest priority, and the priorities of the remaining k − i − 1 items follow in any order. There are (k − i − 1)! of these permutations. Thus the probability that we get a “bad” order is (k −i −1)!/(k −i +1)!= 1/(k − i )(k − i +1).(h) Show thatk −1 � 1 1 E [C ]= =1− . j (j +1)k j =1 Solution:X For a node x with key k , E [C ]is the expected number of nodes in the right spine of the left subtree of x . This equals the sum of the expected value of the random variables i,k for all i in the tree. Since X i,k =0for all nodes i ≥ k , we only need to consider i <k .� � � k −1 �k −1 � E [C ]=E [X i,k ]=E X i,k i =1 i =1 k −1 =Pr {X i,k =1}i =1 k −1 � 1 =(k − i )(k − i +1) i =1 k −1 � 1= j (j +1)j =1 1To simplify this sum, observe that j (j 1+1) = j +1−j = − 1 . Therefore the sumj (j +1) j j +1 telescopes and we have 1 E [C ]=1− . kIf you didn’t see this, you could have proven that the equationk −1 � 1 1 =1− j (j +1)k j =1 holds by induction on k . In the proving the inductive hypothesis you might have 11discovered 1 − = .j j +1 j (j +1)(i) Use a symmetry argument to show that1 E [D ]=1− . n − k +1Solution: The idea is to consider the treap produced if the ordering relationship amongthe keys is reversed. That is, for all items x , leave priority [x ]unchanged but replacekey [x ]with n − key [x ]+1.Let T be the binary tree we get when inserting the items (in increasing order of priority) using the original keys. Once we remap the keys and insert them into a newbinary search tree, we get a tree T whose shape is the mirror image of the shape ofT . (reflected left to right). Consider the item x with key k in T and therefore has key n − k +1 i n T . The length of the left spine of x ’s right subtree in T has becomethe length of the right spine of x ’s left subtree in T . We know by part (g) that the expected length of the right spine of a left subtree of a node y is 1− 1/idkey [y ],so the expected length of the right spine of the left subtree of x in T is 1− 1/(n − k +1), which means that 1 E [D ]=1− . n − k +1(j) Conclude that the expected number of rotations performed when inserting a node into a treap is less than 2.Solution:11 E [number of rotations ]= E [C +D ]=E [C ]+E [D ]=1− +1− k n − k +1 ≤ 1+1=2. Problem 4-2. Being balancedCall a family of trees balanced if every tree in the family has height O (lg n ), where n is the number of nodes in the tree. (Recall that the height of a tree is the maximum number of edges along any path from the root of the tree to a leaf of the tree. In particular, the height of a tree with just one node is 0.)For each property below, determine whether the family of binary trees satisfying that property is balanced. If you answer is “no”, provide a counterexample. If your answer is “yes”, give a proof (hint: it should be a proof by induction). Remember that being balanced is an asymptotic property, so your counterexamples must specify an infinite set of trees in the family, not just one tree. (a) Every node of the tree is either a leaf or it has two children.Solution: No. Counterexample is a right chain, with each node having a leaf hanging off to the left(b) The size of each subtree can be written as 2k − 1, where k is an integer (k is not the same for each subtree).Solution: Yes.Consider any subtree with root r . We know from the condition that the size of this subtree is 2k 1 − 1. We also know that the size of the subtree rooted at the left child of r is 2k 2 − 1, and the size of the subtree rooted at the right child of r is 2k 3 − 1. But the size of the subtree at r is simply the node r together with the nodes in the left and right subtrees. This leads to the equation 2k 1 − 1=1+(2k 2 − 1)+(2k 3 − 1),or 2k 1 =2k 2 +2k 3. Now we show that k 2 =k 3. This is easy to see if you consider the binary representations of k 1, k 2, and k 3.Otherwise, if we assume WLOG that k 2 ≤ k 3, then we have 2k 1−k 2 =1+2k 3−k 2. 2Now, the only pair of integer powers of 2 that could satisfy this equation are 21 and 0 . Thus k 3 − k 2 =0,or k 2 =k 3, and the left and right subtrees of r have an equal number of nodes. It follows that the tree is perfectly balanced.(c) There is a constant c>0such that, for each node of the tree, the size of the smallerchild subtree of this node is at least c times the size of the larger child subtree.Solution:Yes1. The proof is by induction. Assume that the two subtrees of x with n nodes in itssubtree has two children y and z with subtree sizes n1 and n2. By inductive hypothesis,the height of y’s subtree is at most d lg n1 and the height of z’s subtree is at most d lg n2for some constant d. We now prove that the height of x’s subtree is at most d lg n.Assume wlog that n1 ≥n2. Therefore, by the problem statement, we have n2 ≥cn1.Therefore, we have n=n1 +n2 +1≥(1+c)n1 +1≥(1+c)n1 and the height hof x’s subtree is d lg n1 +1≤d lg(n/(c+1))+1≤d lg n−d lg(1+c)+1≤d lg nif d lg(1+c)≥1. Therefore, for sufficiently large d, the height of a tree with n nodesis at most d lg n.(d) There is a constant c such that, for each node of the tree, the heights of its childrensubtrees differ by at most c.Solution: Yes1. Let n(h)be the minimum number of nodes that a tree of height h thatsatisfies the stated property can have. We show by induction that n(h)≥(1+α)h−1,for some constant 0<α≤1. We can then conclude that for a tree with n nodes,h≤log1+α(n+1)=O(lg n).For the base case, a subtree of height 0has a single node, and 1≥(1+α)0 −1forany constant α≤1.In the inductive step, assume for all trees of height k<h, that the n(k)≥(1+α)k−1.Now consider a tree of height h, and look at its two subtrees. We know one subtreemust have height h−1, and the other must have height at least h−1−c. Therefore,we known(h)≥n(h−1)+n(h−1−c)+1.Using the inductive hypothesis, we getn(h) ≥(1+α)h−1 −1+(1+α)h−1−c−1+1≥2(1+α)h−1−c−1.Suppose we picked αsmall enough so that (1+α)<21/(c+1). Then (1+α)c+1 <2.Therefore, we getn(h)≥2(1+α)h−1−c−1≥(1+α)h−1.1Note that in this problem we assume that a nil pointer is a subtree of size 0, and so a node with only one child has two subtrees, one of which has size 0. If you assume that a node with only one child has only one subtree, then the answer to this problem part is “no”.�11Handout18: Problem Set4SolutionsTherefore, we satisfy the inductive hypothesis.Note that if we plug this value for αback into h≤log1+α(n+1),we getlg(n+1)h≤≤(c+1)l g(n+1).lg(1+2c+1)(e) The average depth of a node is O(lg n). (Recall that the depth of a node x is thenumber of edges along the path from the root of the tree to x.)Solution: No.√Consider a tree with n−n nodes organized as a complete binary tree, and the other √ √n nodes sticking out as a chain of length n from the balanced tree. The height of√√√the tree is lg(n−n)+n=Ω(n), while the average depth of a node is at most�√√ √(1/n)n·(n+lg n)+(n−n)·lg n√√=(1/n)(n+n lg n+n lg n−nlgn)=(1/n)(n+n lg n)=O(lg n)√Thus, we have a tree with average node depth O(lg n), but height Ω(n).。
第四模块微分方程PPT课件
例 函数 y 3e2x是微分方程 y - 4 y 0
的什么解?
解: y 6e2x , y 12e2x ,
y - 4 y 12e2x - 4 3e2x 0,
y 3e2x 中不含任意常数,
故为微分方程的特解。
第11页/共45页
三、可分离变量的微分方程
1.定义 具有如下形式的一阶微分方程:
含有未知函数的导数的方程,如何求解呢?
第4页/共45页
相关知识 一、微分方程的定义
— 积分问题
推广
— 微分方程问题 含未知函数及其导数的方程叫做微分方程 . 实质: 联系自变量,未知函数以及未知函数的某些 导数(或微分)之间的关系式。
方程中所含未知函数导数的最高阶数叫做微分 方程的阶。
第5页/共45页
第3页/共45页
课题分析
根据导数的本质,“课题”中所谓的人口增 长率就是人口总数对于时间的变化率R(t ) 或 dR(t)
dt
由“课题”中所给的条件“人口的增长率与 当时的人口总数成正比”可得方程
dR(t) 0.014R(t) dt
且该方程还满足条件 R(t) |t1990 R(1990 ) 11.6
第42页/共45页
例 质量为m的物体自由悬挂在一端固定的弹簧上,
在无外力作用下做自由运动, 取其平衡位置为原点建
立坐标系如图, 设 t = 0 时物体的位置为
初始
求物体的运动规律
解 位移满足自由振动方程 ,
第43页/共45页
(1) 无阻尼自由振动情况 ( n = 0 ) 方程:
特征方程: 方程通解: 利用初始条件得: 故所求特解:
R
L
K
第23页/共45页
课题分析
五分钟MIT公开课
五分钟MIT公开课简介从上一篇开始,我们就正式开始线积分的学习了。
初学线积分的人可能会感觉到畏惧与头疼,因为线积分的知识点非常繁杂。
MIT公开课从物理学角度入手,带给我们最直觉和直观的感受。
另外我也准备了大量的动画帮助理解让线积分不再成为微积分中的拦路虎。
回顾上一篇的知识点,非常重要,其他的比如二重积分都可以暂时扔到一边了。
五分钟MIT公开课-多元微积分:向量场和线积分目录•简介•一个做功的例子•线积分的基本定理•保守和路径独立例子:功的线积分线积分是从物理学的角度引入的,这一节是对物理做功和线积分的回顾。
平面上有一曲线C,有一向量场来描述每一个点上的向量,我们要找出沿着这条曲线所做的功:三个公式分别为定义式,几何表达式和直角坐标系下表达式。
例:在向量场yi+xj里,质点沿一扇形轨迹运动,扇形轨迹由三部分构成。
要计算这个线积分,只要三段分别求和再相加就可以了。
c1:从(0,0) 到(1,0),y=0, dy=0c2:单位圆的一部分。
根据圆的参数方程:c3:参数化这条路径:更简单的表达,使用c3的反向路径:总功:线积分的基本定理算了半天居然是0!怎么能够避免计算?找到这个诀窍,会方便很多。
当多元方程存在的时候,就有梯度向量。
但实际上,是一个向量场。
在这种特殊情况下,向量场实际上是一个函数的梯度,也就是梯度场。
f是关于x和y的函数,称为向量场的势函数(potential)。
在物理学中,计算重力或者电场所做的功,只需要计算起点和终点的势能差,与路径无关。
一个微积分的基本定理是,如果对函数的导数积分,就可以得到原函数。
多元微积分也一样,如果对函数的梯度做线积分,也可以得到原函数。
基本定理:如果沿轨迹对向量场,即方程的梯度做线积分,其结果为原方程的终点与起点值之差注意:非常有局限性,仅仅在向量场是梯度的情况下才满足。
来看看基本定理的物理和几何解释。
对梯度积分,其实是对函数的导数积分:证明:例子回到最开始的例子,向量场为:图像显示了等高线和向量场的重合,可以看出,向量场垂直于等高线,所以也是梯度。
常微分方程讲义全文
6、恰当方程
M (x, y)dx + N (x, y)dy = 0
判定:全微分 ⇔ ∂M ≡ ∂N ∂y ∂x
x
y
∫ ∫ 解法: M (x, y)dx + x0
y0 N (x0 , y)dy = C
初值问题: C = 0
例 2xydx + (x2 − y2 )dy = 0
解: ∂M ∂y
≡ ∂N ∂x
uz′ = −(z −1)(z − 2) /(z + 1)
z = 1, z = 2 ⇔ v = u, v = 2u ⇔ y = x + 1, y = 2x
⎛ ⎝⎜
z
3 −
2
−
z
2 −
1
⎞ ⎠⎟
dz
= − du u
⇒
(z − 2)3 (z −1)2
= C /u
( y − 2x)3 = C( y − x −1)2
一阶 线性 二阶 线性 一阶 非线性
齐方程、非齐次方程
在方程中,不含未知函数及其导数的项,称为自由项。 自由项为零的方程,称为齐方程。 自由项不为零的方程,称为非齐方程。
d x = x2 dt
一阶齐线性方程
d2 y d x2
+
b
d d
y x
+
cy
=
sin
x
二阶非齐线性方程
⎜⎛ d x ⎞⎟2 − x2 = t3 ⎝ dt ⎠
一阶非齐非线性方程
微分方程的一般表示形式
n 阶微分方程的一般形式 为 F (x, y′, y′′,L, y(n) ) = 0 。
F
(x,
y′,
y′′)
第四章 微分方程讲稿
第四章 微分方程§4. 1 微分方程的基本概念导入:(8分钟)函数是客观事物的内部联系在数量方面的反映, 利用函数关系又可以对客观事物的规律性进行研究. 因此如何寻找出所需要的函数关系, 在实践中具有重要意义. 在许多问题中, 往往不能直接找出所需要的函数关系, 但是根据问题所提供的情况, 有时可以列出含有要找的函数及其导数的关系式. 这样的关系就是所谓微分方程. 微分方程建立以后, 对它进行研究, 找出未知函数来, 这就是解微分方程.引例 一曲线通过点(1, 2), 且在该曲线上任一点M (x , y )处的切线的斜率为2x , 求这曲线的方程.解 设所求曲线的方程为y =y (x ). 根据导数的几何意义, 可知未知函数y =y (x )应满足关系式(称为微分方程)x dxdy2=. (1) 此外, 未知函数y =y (x )还应满足下列条件:x =1时, y =2, 简记为y |x =1=2. (2) 把(1)式两端积分, 得(称为微分方程的通解)⎰=xdx y 2, 即y =x 2+C , (3) 其中C 是任意常数.把条件“x =1时, y =2”代入(3)式, 得2=12+C ,由此定出C =1. 把C =1代入(3)式, 得所求曲线方程(称为微分方程满足条件y |x =1=2的解):y =x 2+1.几个概念:微分方程: 表示未知函数、未知函数的导数与自变量之间的关系的方程, 叫微分方程. 常微分方程: 未知函数是一元函数的微分方程, 叫常微分方程. 偏微分方程: 未知函数是多元函数的微分方程, 叫偏微分方程.微分方程的阶: 微分方程中所出现的未知函数的最高阶导数的阶数, 叫微分方程的阶. x 3 y '''+x 2 y ''-4xy '=3x 2 , y (4) -4y '''+10y ''-12y '+5y =sin2x , y (n ) +1=0, 一般n 阶微分方程:F (x , y , y ', ⋅ ⋅ ⋅ , y (n ) )=0. y (n )=f (x , y , y ', ⋅ ⋅ ⋅ , y (n -1) ) .微分方程的解: 满足微分方程的函数(把函数代入微分方程能使该方程成为恒等式)叫做该微分方程的解. 确切地说, 设函数y =ϕ(x )在区间I 上有n 阶连续导数, 如果在区间I 上, F [x , ϕ(x ), ϕ'(x ), ⋅ ⋅ ⋅, ϕ(n ) (x )]=0,那么函数y =ϕ(x )就叫做微分方程F (x , y , y ', ⋅ ⋅ ⋅, y (n ) )=0在区间I 上的解.通解: 如果微分方程的解中含有任意常数, 且任意常数的个数与微分方程的阶数相同, 这样的解叫做微分方程的通解.初始条件: 用于确定通解中任意常数的条件, 称为初始条件. 如 x =x 0 时, y =y 0 , y '= y '0 . 一般写成00y y x x ==, 00y y x x '='=. 特解: 确定了通解中的任意常数以后, 就得到微分方程的特解. 即不含任意常数的解. 初值问题: 求微分方程满足初始条件的解的问题称为初值问题. 如求微分方程y '=f (x , y )满足初始条件00y y x x ==的解的问题, 记为⎩⎨⎧=='=00),(y y y x f y x x .积分曲线: 微分方程的解的图形是一条曲线, 叫做微分方程的积分曲线.§4. 2 一阶微分方程导入:(8分钟)1. 求微分方程y '=2x 的通解. 为此把方程两边积分, 得y =x 2+C .一般地, 方程y '=f (x )的通解为C dx x f y +=⎰)((此处积分后不再加任意常数). 2. 求微分方程y '=2xy 2 的通解.因为y 是未知的, 所以积分⎰dx xy 22无法进行, 方程两边直接积分不能求出通解.为求通解可将方程变为xdxdy y 212=, 两边积分, 得C x y +=-21, 或Cx y +-=21, 可以验证函数Cx y +-=21是原方程的通解. 一般地, 如果一阶微分方程y '=ϕ(x , y )能写成g (y )dy =f (x )dx形式, 则两边积分可得一个不含未知函数的导数的方程G (y )=F (x )+C ,由方程G (y )=F (x )+C 所确定的隐函数就是原方程的通解对称形式的一阶微分方程:一阶微分方程有时也写成如下对称形式:P (x , y )dx +Q (x , y )dy =0在这种方程中, 变量x 与y 是对称的.若把x 看作自变量、y 看作未知函数, 则当Q (x ,y )≠0时, 有),(),(y x Q y x P dx dy -=. 若把y 看作自变量、x 看作未知函数, 则当P (x ,y )≠0时, 有),(),(y x P y x Q dy dx -=. 一、可分离变量的微分方程: 如果一个一阶微分方程能写成g (y )dy =f (x )dx (或写成y '=ϕ(x )ψ(y ))的形式, 就是说, 能把微分方程写成一端只含y 的函数和dy , 另一端只含x 的函数和dx , 那么原方程就称为可分离变量的微分方程. 讨论: 下列方程中哪些是可分离变量的微分方程? (1) y '=2xy , 是. ⇒y -1dy =2xdx . (2)3x 2+5x -y '=0, 是. ⇒dy =(3x 2+5x )dx . (3)(x 2+y 2)dx -xydy =0, 不是.(4)y '=1+x +y 2+xy 2, 是. ⇒y '=(1+x )(1+y 2). (5)y '=10x +y , 是. ⇒10-y dy =10x dx . (6)xyy x y +='. 不是. 可分离变量的微分方程的解法:第一步 分离变量, 将方程写成g (y )dy =f (x )dx 的形式;第二步 两端积分:⎰⎰=dx x f dy y g )()(, 设积分后得G (y )=F (x )+C ; 第三步 求出由G (y )=F (x )+C 所确定的隐函数y =Φ(x )或x =ψ(y )G (y )=F (x )+C , y =Φ (x )或x =ψ(y )都是方程的通解, 其中G (y )=F (x )+C 称为隐式(通)解. 例1 求微分方程xy dxdy2=的通解. 解 此方程为可分离变量方程, 分离变量后得xdx dy y21=, 两边积分得⎰⎰=xdx dy y 21,即 ln|y |=x 2+C 1, 从而 2112x C C xe e e y ±=±=+.因为1C e ±仍是任意常数, 把它记作C , 便得所给方程的通解2x Ce y =.例2 铀的衰变速度与当时未衰变的原子的含量M 成正比. 已知t =0时铀的含量为M 0, 求在衰变过程中铀含量M (t )随时间t 变化的规律. 解 铀的衰变速度就是M (t )对时间t 的导数dtdM . 由于铀的衰变速度与其含量成正比, 故得微分方程M dtdM λ-=, 其中λ(λ>0)是常数, λ前的曲面号表示当t 增加时M 单调减少. 即0<dtdM . 由题意, 初始条件为M |t =0=M 0.将方程分离变量得dt MdM λ-=. 两边积分, 得⎰⎰-=dt M dM )(λ, 即ln M =-λt +ln C , 也即M =Ce -λt . 由初始条件, 得M 0=Ce 0=C ,所以铀含量M (t )随时间t 变化的规律M =M 0e -λt .例3 设降落伞从跳伞塔下落后, 所受空气阻力与速度成正比, 并设降落伞离开跳伞塔时速度为零. 求降落伞下落速度与时间的函数关系.解 设降落伞下落速度为v (t ). 降落伞所受外力为F =mg -kv ( k 为比例系数). 根据牛顿第二运动定律F =ma , 得函数v (t )应满足的方程为kv mg dtdv m-=, 初始条件为v |t =0=0.方程分离变量, 得mdt kv mg dv =-, 两边积分, 得⎰⎰=-mdt kv mg dv ,1)ln(1C m t kv mg k +=--, 即t m k Ce k m g v -+=(ke C kC 1--=),将初始条件v |t =0=0代入通解得kmg C -=, 于是降落伞下落速度与时间的函数关系为)1(t m k e km gv --=. 例4 求微分方程221xy y x dxdy+++=的通解. 解 方程可化为)1)(1(2y x dxdy++=, 分离变量得dx x dy y )1(112+=+, 两边积分得⎰⎰+=+dx x dy y )1(112, 即C x x y ++=221arctan .于是原方程的通解为)21tan(2C x x y ++=.例5 有高为1m 的半球形容器, 水从它的底部小孔流出, 小孔横截面面积为1cm 2. 开始时容器内盛满了水, 求水从小孔流出过程中容器里水面高度h 随时间t 变化的规律. 解 由水力学知道, 水从孔口流出的流量Q 可用下列公式计算:gh S dtdV Q 262.0==, 其中0. 62为流量系数, S 为孔口横截面面积, g 为重力加速度. 现在孔口横截面面积S =1cm 2, 故gh dtdV 262.0=, 或dt gh dV 262.0=. 另一方面, 设在微小时间间隔[t , t +d t ]内, 水面高度由h 降至h +dh (dh <0), 则又可得到dV =-πr 2dh ,其中r 是时刻t 的水面半径, 右端置负号是由于dh <0而dV >0的缘故. 又因222200)100(100h h h r -=--=,所以 dV =-π(200h -h 2)dh . 通过比较得到dh h h dt gh )200(262.02--=π,这就是未知函数h =h (t )应满足的微分方程.此外, 开始时容器内的水是满的, 所以未知函数h =h (t )还应满足下列初始条件:h |t =0=100.将方程dh h h dt gh )200(262.02--=π分离变量后得dh h h gdt )200(262.02321--=π.两端积分, 得⎰--=dh h h g t )200(262.02321π,即 C h h g t +--=)523400(262.02523π,其中C 是任意常数. 由初始条件得C g t +⨯-⨯-=)100521003400(262.02523π,5101514262.0)52000003400000(262.0⨯⨯=-=g g C ππ.因此)310107(262.0252335h h gt +-⨯=π.上式表达了水从小孔流出的过程中容器内水面高度h 与时间t 之间的函数关系.二、一阶线性微分方程方程)()(x Q y x P dxdy=+叫做一阶线性微分方程. 如果Q (x )≡0 , 则方程称为齐次线性方程, 否则方程称为非齐次线性方程. 方程0)(=+y x P dx dy 叫做对应于非齐次线性方程)()(x Q y x P dxdy=+的齐次线性方程. 提问:下列方程各是什么类型方程? (1)y dxdy x =-)2(⇒021=--y x dx dy是齐次线性方程.(2) 3x 2+5x -5y '=0⇒y '=3x 2+5x , 是非齐次线性方程. (3) y '+y cos x =e -sin x , 是非齐次线性方程. (4)y x dxdy+=10, 不是线性方程.(5)0)1(32=++x dxdy y ⇒0)1(23=+-y x dx dy 或32)1(x y dy dx +-, 不是线性方程. 1、齐次线性方程的解法: 齐次线性方程0)(=+y x P dxdy是变量可分离方程. 分离变量后得dx x P ydy)(-=, 两边积分, 得1)(||ln C dx x P y +-=⎰,或 )( 1)(C dxx P e C Ce y ±=⎰=-, 这就是齐次线性方程的通解(积分中不再加任意常数). 例6 求方程y dxdyx =-)2(的通解. 解 这是齐次线性方程, 分离变量得2-=x dx y dy , 两边积分得ln|y |=ln|x -2|+lnC ,方程的通解为y =C (x -2).非齐次线性方程的解法:将齐次线性方程通解中的常数换成x 的未知函数u (x ), 把⎰=-dxx P e x u y )()(设想成非齐次线性方程的通解. 代入非齐次线性方程求得)()()()()()()()()(x Q e x u x P x P e x u e x u dxx P dx x P dx x P =⎰+⎰-⎰'---, 化简得⎰='dxx P e x Q x u )()()(,C dx e x Q x u dxx P +⎰=⎰)()()(,于是非齐次线性方程的通解为])([)()(C dx e x Q e y dx x P dx x P +⎰⎰=⎰-,或 dx e x Q e Ce y dxx P dx x P dx x P ⎰⎰⎰+⎰=--)()()()(.非齐次线性方程的通解等于对应的齐次线性方程通解与非齐次线性方程的一个特解之和.例7 求方程25)1(12+=+-x x y dx dy 的通解. 解 这是一个非齐次线性方程. 先求对应的齐次线性方程012=+-x y dx dy 的通解. 分离变量得12+=x dx y dy , 两边积分得ln y =2ln (x +1)+ln C ,齐次线性方程的通解为y =C (x +1)2.用常数变易法. 把C 换成u , 即令y =u ⋅(x +1)2, 代入所给非齐次线性方程, 得2522)1()1(12)1(2)1(+=+⋅+-+⋅++⋅'x x u x x u x u21)1(+='x u ,两边积分, 得C x u ++=23)1(32. 再把上式代入y =u (x +1)2中, 即得所求方程的通解为])1(32[)1(232C x x y +++=. 例8 有一个电路如图所示, 其中电源电动势为E =E m sin ωt (E m 、ω都是常数), 电阻R 和电感L 都是常量. 求电流i (t ).解 由电学知道, 当电流变化时, L 上有感应电动势dtdi L-. 由回路电压定律得出 0=--iR dtdi LE , 即LE i L R dt di =+. 把E =E m sin ω t 代入上式, 得t LE i L R dt di m sin ω=+. 初始条件为i |t =0=0.方程t LE i L R dt di m sin ω=+为非齐次线性方程, 其中 L R t P =)(, t LE t Q m s i n )(ω=.由通解公式, 得 ])([)()()(C dt e t Q et i dtt P dtt P +⎰⎰=⎰-) sin (C dt e t LE e dt L Rm dt L R+⎰⎰=⎰-ω)sin (C dt te e LE t L R t L Rm +=⎰-ω t L R mCe t L t R LR E -+-+=) cos sin (222ωωωω. 其中C 为任意常数.将初始条件i |t =0=0代入通解, 得222 L R LE C mωω+=,因此, 所求函数i (t )为) cos sin ( )(222222t L t R L R E e L R LE t i m t L R m ωωωωωω-+++=-. 总结:1、微分方程的相关概念a 、微分方程的阶b 、微分方程的通解与特解 2、可分离变量的微分方程a 、可分离变量的微分方程b 、可转化为可分离变量的微分方程 3、一阶线性微分方程a 、一阶线性齐次微分方程b 、一阶线性非齐次微分方程c 、常数变易法 教学后记:作业:。
第四章第一节微分方程的基本概念
第四章第一节微分方程的基本概念基本内容1. 微分方程:含有未知函数、未知函数的导数(或微分)与自娈量之间的关系的方程称为微分方程。
未知函数是一元函数的微分方程称为常微分方程。
微分方程中所出现的未知函数的最高阶导数的阶数称为微分方程的阶。
2. 微分方程的解:使微分方程成为恒等式的函数)(xyy=称为微分方程的解。
如果微分方程的解中含有任意常数,且任意常数的个数与微分方程的阶数相同,这样的解叫做微分方程的通解。
3.特解:确定微分方程通解中的任意常数的值的条件称为定解条件,确定了通解中的任意常数后得到的解称为微分方程的特解。
习题选解1.试指出下列各微分方程的阶数(1)220 x dy y dx-=解:一阶(2)43()0 y y y y''''''-=解:二阶(3)220 d Q dQ QL Rdt Cdt++=解:二阶。
(4)(76)()0 x y dx x y dy-++=解:一阶(5)2sin ddρρθθ+=解:一阶(6)(5)20 y y y y''''-++=解:5阶2.指出下列各题中的函数是否为所给微分方程的解(1)30dy xy dx +=,3C y x = 解:因为343()dy C Cdxx x '==-,代入微分方程,得: 左边=333330dy C C xy dx x x +=-+==右边,所以3C y x =是微分方程的解。
(2)222220d y dyx x y dx dx -+=, 223y x x =-解:因为2(23)26dy x x x dx '=-=-,22(26)6d y x dx '=-=-代入微分方程,得: 左边222222262(26)2(23)0d y dy x x y x x x x x dx dx =-+=---+-==右边,所以223y x x =-是微分方程的解。
微分方程讲稿
第一章 微分方程的基本概念300多年前,由牛顿和莱布尼兹所创立的微积分学,是人类科学史上划时代的重大发现,而微积分的产生和发展,又与求解微分方程问题密切相关.这是因为微积分产生的一个重要动因来自于人们探求物质世界运动规律的需求.一般地,运动规律很难全靠实验观测认识清楚,因为人们不太可能观察到运动的全过程.然而,运动物体(变量)与它的瞬时变化率(导数)之间,通常在运动过程中按照某种己知定律存在着联系,我们容易捕捉到这种联系,而这种联系,用数学语言表达出来,其结果往往形成一个微分方程.一旦求出这个方程的解 其运动规律将一目了然.所以数学分析中所研究的函数,是反映客观现实世界运动过程中量与量之间的关系。
但在大量的实际问题中遇到稍微复杂的一些运动过程时,反映运动规律的量与量之间的关系(即函数)往往不能直接写出来,却比较容易地建立这些变量和它们导数(或微分)的关系式。
这种联系着自变量,未知函数及它的导数(或微分)的关系式,数学上称之为微分方程,当然其中未知函数的导数或微分是不可缺少的。
§1.1微分方程:某些物理过程的数学模型例1.1.1 物体冷却过程的数学模型将某物体放置于空气中,在时刻t=0时,测量得它的温度为c u 1500=,10分钟后测量得温度为c u 1001=,我们要求决定此问题u 和时间t 的关系,并计算20分钟后物体的温度。
这里我们假定空气的温度保持为c u a 24=。
解:为了解决上述问题,需要了解一些热力学的基本规律: 1. 热量总是从温度高的物体向温度低的物体传导的;2. 在一定的温度范围内,一个物体的温度变化速度与这一物体的温度和所在介质温度的差值成比例(牛顿冷却定律)设物体在时刻t 的温度为)(t u u =,则温度的变化速度以dtdu来表示。
注意到热量总是从温度高的物体向温度低的物体传导的,因而a u u >0,所以温差a u u -恒正;又因物体将随时间而逐渐冷却,故温度变化速度dtdu恒负。
微分方程解法ppt课件
阶段汽车运动规律的函数S=S(t),应满足方程:
4
d 2s
dt2 4
(5)
及条件
S
t0
0, v t0
ds dt
t 0
10
(6)
对(5)式两端积分一次,得
v
ds dt
4t
c1
(7)
在积分一次,得S 2t 2 c1t c2
(8)
将条件v t0 10代入(7)式中,将条件S t0 0代入(8)式,
原方程,经整理得 C(x) ex
y C(x) 代入 x
解得
C(x) ex C
于是原方程的通解为 y 1 (ex C) x
方法二 直接利用非齐次方程的通解公式(5),得
23
y
e
1 x
dx
(
e
x
e
1 x
dx
dx
C
)
x
eln x ( e x eln xdx C) x
1 x
( exdx
b N
N Ceabt bN
于是
N
Cbeabt 1 Ceabt
1
b 1 eabt
C
这就是种群的生长规律 。
15
8.3 一阶线性微分方程
形如
y P(x)y Q(x)
(1)
的方程叫做一阶线性微分方程(linear differential equation of first
Order),它的特点为左端是关于未知函数y及一阶导数
curve).如 y x2 c 是方程(1)的积分曲线族,而 y x2 1只是其中过(1,2)点的一条积分曲线。
10
8.2 可分离变量的一阶微分方程
第九章微分方程4
其中:k是为: 2 p q 0 的根的重数,(k 0,1,2).
齐次微分方程的通解: yh (C1 C2 x)e2x ,
2是特征方程的二重根 , 故设非齐次微分方程一个特解: yp x2( Ax B)e2x ,
即 y p ( Ax3 Bx2 )e2x , 则 yp (3Ax2 2Bx)e2x 2( Ax3 Bx2 )e2x
解:
f
(
x)
sin
x
x
x0
f
(t )dt
x
0
tf
(t )dt ,
则有
:
f (0) 0,
两边对x求导得:f
( x)
cos
x
x
0
f
(t )dt
xf
(x)
xf
( x),
cos
x
x
0
f
(t )dt
两边再对x求导得: f ( x) sin x f ( x),且 : f (0) 1,
[(2A 4B)cos x (2B 4A)sin x]e2x 10e2x cos x,
2A 4B 10
2B
4A
0,
A1 B 2,
故设
yp
(cos x 2sin x)e2x ,
方程通解:y C1ex C2e x (cos x 2sin x)e2x . 15
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
[2] Example: Diffusion, e.g. of heat. About this time of year I start to think about summer. I put my rootbeer in a cooler but it still gets warm. Let's model its temperature by an ODE. x(t) = root beer temperature at time t .
[In the first lecture, I posed this (with a different righthand side) as a flashcard problem, but I did it just after describing the calculation of an integrating factor for a *reduced* equation. The reduced equation is x' + 2x/t = 1 , and this has integrating factor t^2 . So it was a poorly placed question.] That was great! The factor t we multiplied by is an "integrating factor." I guessed it here. Often you can. The factor to use in the cooler equation and other equations may not be so obvious. Here's a calculation, for a linear equation in reduced form,
Let's takek = 1/3 , for example. say
Suppose the temperature outside is rising at a constant rate: T_ext = 60 + 6t (in hours after 10:00) x(0) = 32 .
and we need an initial condition: let's say So the IVP is x' + (1/3) x = 20 + 2t ,
This is "Newton's law of cooling." k could depend upon t and we would still have a linear equation, but let's suppose that we are not watching the process for so long that the insulation of the cooler starts to break down! Systems and signals analysis: The system is the cooler. The output signal = system response is x(t) , the temperature in the cooler. The input signal is the external temperature T_ext(t) . Note that the right-hand side is k signal itself. times the input signal, not the input
Definition: A "linear ODE" is one that can be put in the "standard form" _______________________________ | | | r(t)x' + p(t)x = q(t) | |_______________________________|
For example, suppose we have the equation t x' + 2 x = t (This is not separable; it is linear and in standard form, but not reduced standard form.) Here's a *trick*. Multiply both sides by t : t^2 x' + 2t x = t^2 The left hand side is now the derivative of a product: (d/dt) (t^2 x) = t^2 We can solve this by integrating: t^2 x = t^3/3 + c so x = t/3 + c t^{-2}
x = x(t)
r(t), p(t) are the "coefficients" [I may have called q(t) also a coefficient also on Monday; this is not correct, fix it if I did.] The left hand side represents the "system," and the right hand side arises from an "input signal." A solution x(t) is a "system response" or "output signal." We can always divide through by r(t), to get an equation of the Reduced standard form: _______________________________ | | | x' + p(t)x = q(t) | |_______________________________|
(with
p(t) = 2t )
on the right:
x' + 2tx = 0 dx/x = - 2t dt ln|x| = - t^2 + c |x| = e^c e^{-t^2}
Eliminate the absolute value and reintroduce the lost solution:
x(0) = 32 .
(cooler)
This isn't separable: it's something new. We'll describe a method which works for ANY first order linear ODE.
[3] Method: Integrating factors (Euler) This method is based on the product rule for differentiation: (d/dt) ( u x ) = ux' + u'x
k is small when the insulation is good, large when it is bad. It's zero when the insulation is perfect. k is a COUPLING CONSTANT When it is zero, the temperature inside the cooler is decoupled from the temperature outside. In the construction industry, a number like k is pasted on windows; it's called the U-value of the window.
kt.
is
x_h = e^{- int p(t) dt}
,
x = C x_h
We will see that the general case can be solved by an algebraic trick that produces a sequence of two integrations.
x = C e^{- int p(t) dt}
x = C e^{-t^2}
In the example, we chose a particular anti-derivative of k , namely That is what I really have in mind to do in general. The constant of integration is taken care of by the constant C . So the general solution to *any* nonzero solution: (*)_h has the form C x_h , where x_h
The greater the temperature difference between inside and outside, the faster x(t) changes. Simplest ("linear") model of this: x'(t) = k ( T_ext(t) - x(t) ) where T_ext(t) is the "external" temperature. Sanity check: When T_ext(t) > T(t), x'(t) > 0 (assuming k > 0 ). We get a linear equation: x' - k x = k T_ext