You are on page 1of 17
era Seth 18 Differential Equations 18.1 Concepts Review 1. 7? +ayr+ay =0; complex conjugate rots 2 Get + Ce 3. (G+Cqnet 4. Cyeosx+C, sinx Problem Set 18.1 1, Roots are 2 and 3, General solution is yaQet + Cnc 2. Roots are -6 and I. General solution is Stannanenntadesee: 3. Auxiliary equation: r? + 6r~7 (r+ TYr= 1) =0 has roots -7, 1. General solution: y IC, +Cz, 50 eae 2 Therefore, 4. Roots are -2 and 5. General solution is y= Qe +Cye*. Particular solution is “Ore S. Repeated root 2. General solution is (C+ Cya)e™* 6. Auxiliary equation: 1 +10r-+25 =0,(r+5)? =0 has one repeated root -$ Instructor's Resource Manual 9. 10, u 1B 14. ie +Cyxe™ or General solution: ya (G Orne Roots are 2V3. General solution is ye (Ce + Ce, Roots are -32 Vil. General solution is 70 (Gel ce) Auxiliary equation: r? +4 =0 has roots #2i. General solution: y = C, cos2x+Cy sin 2x Hx=Oandy=2,then 2=C): if x= and y=3,then 3= Cp, ‘Therefore, y = 2c0s2x +3sin 2x Roots are +37, General solution is Y= (C,0053x+C, sin3x). Particular solution is y= =sin3x—3eos3r. Roots are—1 + i. General solution is y=e*(Cc08x+Cysinz). iary equation: 7? +r+1=0 has roots General solution: aa wal M3 yore 8} ree() rose General solution is Y= +Cgx4 Ce + Cyer, Roots are-1, 1,4, General solution is y= Ce + Oye + Cs cosx+ Cy sin Section 18.1 821 17, Roots are ~2, 2. General solution is Ge + Ce 1 =C,(cosh 2x sinh 2x) + C3 (sinh 2x-+ cosh 2x) (-C; + Cy)sinh 2+ (C, + Cy )eosh 2x = Dy sinh 2x+D, cosh 2x 15, Auxiliary equation: r* +3"? -4=0, (r+1(r=1(? +4)=0 has roots -1, 1,424, General solution: y= CeF + Cyet +C,cos2x+Cysin2x 16, Roots are~2, 3,4. General solution is Ge + Gye + Cy e084 Cy sins = cosh —sinhu, (See Problems 1 and 2, Section 7.8.) wale Re gt tPF » 18, e” =coshu+sinhu and e™* Auxiliary equation: +? ~2br—c? Roots of auxiliary equation: =**— 752 won Foal B05 SF sie) 20 [lgse0e( FE) ca Fs)] 20°) 0 04(SF2)] _ (-3(2}: 2 #12) C+ Cpa) 005 [« Ga) (2 Bs ntesreunse( S| General solution is y = 20. Roots | i, General solution is Auxiliary equation: 1? +4r-+4=0, (r+2)? =0 (Cy cosx+Cy sinx) has roots -2, =e (esiny cosx+ceosy sinx) = ce* sin(x+7). General solution: G+GqzVe*, = (G+ Cy Inyo? y= (C+ Cy Inx)x 22. As done in Problem 21, 23, We need to show that y"+ay"+a2y'= Oif m and ‘rare distinct real roots of the auxiliary equation. a yf and fe into (9) We have, 4 ine + Core™ SprsBesyno 3 ” ta CyPe + Carste™ ‘When put into the differential equation, we 822 Section 18.1 Instructor's Resource Manual obtain (-a\~a=4ay) ana Putting these values into (*) and simplifying yields the desired result: y"* aya, =0. ytayy'tagy =Cynre™ + Cane say (Cie «Cane v0n(Ge"+C3e™) ‘The solutions tothe auxiliary equation are given by 24, We need to show that "+ a,y'+ a3) = Oif a+ Bi are complex conjugate roots of the auxiliary equation. We have, y'=e% ((aC, + BCz)c0s( Bx) +(aCy ~ BG )sin(Bx)) ye ((a%c, BC, +248 )eos( Bx) + (aC = °C, ~ 208 )sin( Bx) When pt into the differential equation, we obtain yreay'sayy =e ((0°C, - 9G, +2af)cos(Bx)+(a*C; ~ AC, -2a8C)sn(B2)) tae ((aC, + BCg)c08(Ax) + (aC, ~ AC, )sin (Bx)) + a3 (Cie cos (Ax) + Cze sin(Bx)) (*) From the solutions tothe auxiliary equation, we find that a= oft and p= fa? 4a, 2 Putting these values into (*) and simplifying yields the desired result: y"+ ay" ay =0 = cos (b) + isin (6) b, eth = ePebY = e*[cos(b) + isin(6)] es yfel6*®™*] = Dome isin i = ae (cos Pr +1sn fu)" -ipsin +c = e™[(a+ fiycos Bx+(ai- B)sin Bx) (c+ Bye2*P = (a+ pile? (cos Bx+ isin Bx)] = €**[(a+ fioos Ax + (ai ~ B)sin Bx} ‘Therefore, Dylel*?*] = (a-+ipye'@r* 26. cel*P s cpel*P* (o, and cy are complex constant.) = ce™*[cos Ax + isin Bx) +cze™ [cos(- Bx) +isin(~Bx)] = e™*[(c +c2)cos Px +(c, ~c2)isin Bx) = €7*[C, cos x+Cy sin Bx), where C, =e, +e. and Cy =¢~c2 Note: If ¢, and cp are complex conjugates, then C, and Cy are rea S628 40, gg-l-162278x 2 y=0Se +05 28, y= 35x02 4207S 29, y= 1,29099e"925* sin(0,9682462) 30, y= 6953335412 5¢0s(0.4714052) ~ 4.94975sin(0.471405x)] Instructor's Resource Manual Section 18.4 823 18.2 Concepts Review 2. 640 +Ce* 3. yor? Bete be 4. y= Bre} Problem Set 18.2 1 yp =Qe +e Ax? 4 (A+ B)x+(24-28+C) Thus, A= 1,44 +B=1,24-2B+ Azt 7 General solution: y =x? +5x4+8+ (Cj +Cax)e" 4. yy = Ce F +Cy-yp = 20? H(A) ya2e? drt Qe* +Cy 5 bs Vee 5 rn 2Ge sce yp «(Let 1) ax jx o(LJet eget sae (ie eae +o 6. Auxiliary equation: r? +6r-+9=0,(r+3)? =0 has roots 3,3. CG +Caxe 824 Section 18.2 particular solution to the nonhomogeneous equation; homogeneous equation Instructor's Resource Manual Then Ge *)e8-BE)a8Ge)=20% Abe Det Bel covet: y= (216 eee -¥(Cycosx+Cysinx) 3) vn(3)e Retrgen y-(3 + 67*(C,cosx+C, sin x) 9. Auxiliary equation: ?—r—2 (+ Ife~2)=0 has roots -1, 2, a= Get Cae Let yp =Beosx+Csinx: yp Then (-Boosx~ Csinx)-(-Bsinx+Ccos*) -2(Beosx+Csinx) = 2sinx, Bosx-Csin x. -Bsinx+Ccosx: yp (-3B-C)cosx+(B-3C)sinx = 2sinx, so-3B-—C=0 s0-38-C=OandB-3C=2; B (Z)oots-(3)insv cet +Qe7 10. yy, =Cye** +Cz oor Sines get +O 17 0 LL. yp = Cyc0s2x+Cy sin 2x v= (Onc2ey(!) ns y-[$}ssinar+cjcorarecysnas has roots #3/, so yp = C, c0s3x4+C; sin3x, (-Bbr + C)sin 3x + (B+3Cx)cos3x: 12. Auxiliary equation: 7? +! Let yp = Brcos3x+Crsin3x: Vp = (-9Bx+6C) cos3x+ (-9Cx- 6B)sin3x ‘Then substituting into the original equation and simplifying, obtain 6Ccos3x-6Bsin3x = sin3x ,s0 C= 0 and 1 6 Instructor's Resource Manual Section 18.2 825 13, yy = Cj cos3x+Cp sin3x Yp = (eos (j)i« “(Re (:}sese(Erocenerciamae 1h ye =Qe%+C 3) 7 2) x2 3x4 Ge 7 +G, (3) ye + Cy 15. Auxiliary equation: 7? -5r-+6=0 has roots 2 and 3,0 yy, = Cie +Cae™*. Let yp = Bes yp = Be": yp = Bet. Then (Be*)~5(Be*)+6(Be") = 2e"; 2Be™ = 27:8 General solution: y = e* +Cye* +Ce™ yi ae 42G +30" Ifx=0.y=1, y'=O, then 1=14G,+Cy and 0=1426 +3C,5 Cj =hCy Therefore, 16. 4 Yee (oposs+(-Z}sine 17. yy = Cet +Qge* sy-(Eeoren yo (Jesse cae 18, Auxiliary equation: r—4=0 has roots 2,-2,s0 yp = Cje™* +Cye™. Let yp = met +e", subject to Ye +vge™ =0, and vie?) +0926) =e. el x a and vy =-e4; 23 and v2 = ‘Then vf(4e%*) =e and v3(-4e"™*) Pana Get eget rey General solution: 19.» Yp ‘y=~cos rin|sinx|-xsin x4 C3 cos 2+ Cy sinx (combined cos x terms) Cycosx+G; sinx ~cosinsina|~cosx~xsin x 826 Section 18.2 Instructor's Resource Manual 20, yp =Cycosx+Cysinz Yp =~sinaln|esex-+eot | y=-sinxlnjesex+cotx|+Ccosx+C; sin Cet Ce. 21, Auxiliary equation: r? ~3r-+2=0 has roots 1.2.50 y, subject to viet +vge™" = 0, and vj(e*)+05(2e**) = eF(ex+1)'. e eer) Let ¥p at du ulu+D) In(l+e~*) taut) =: *sin(l+e4) Few 227 (similar to finding ») ef In lee) ef +e% nfl -e%)+ Get +Cye* y= (+e )In(h+e*) + Det + Dye™™ General solution: 2 » Get +e: yp poet +e + Ce 23. Lp) = (ay + vp)" +O +g) Hel +930) + + vara + vad) + lol + nm + vSun + 2H) + CU + ¥2H2) (nig + vu + ofa vu vf + fu + ud +g) + BC gu + vpn + vd) +eCO +99) (uf + buf + cu) +09 (uf + bur +p) + Blo +v5ue) + Coin +e + a + v4) + OM #8) (uf bu +c) +9 (uf + bu + rg) + (ou + v5) + (oy + v5ua)"+ ful #955) (0) + ¥9(0)+B(0)-+ (0) + A(x) = KC) 24, Auxiliary equation: r? +4=0 has roots #21 Ya = Cc082x+C, sin 2x Now write sin? x in a form involving sin fs or cos fi's. sin? x=Ssing—4sin3x (C.RC. Standard Mathematical Tables, or derive it using half-angle and product identities.) Let yp = Asin x+ Bcosx+ Csin3x+ Doos3x; Yp = Acosx~Bsinx+3Ccos3x-3Dsin3x 5 yp = -Asinx~ Beosx~9Csin3x—9Dcos3x Then ae *, +4y, =3Asinx+3B cosx~SCsin3x-SDeos3x = Ssin. Yet 4yy eos3e = sin B=0,C=+, D=0. 20 L General solution: y= Lsinx+Lsinde4Ccos2e+C,sin2x Instructor's Resource Manual Section 18.2 827 18.3 Concepts Review 4. leetric circuit Problem Set 18.3 Im = 250/10 =25.B =5 Oke) nis y=C, c0s5t-+C, sine. Apply the initial condition to get y = 250,m-=10, (the problem gives the mass as m Thus, y"=~25y. The general solu 2n The period is ~ seconds. p 5 . = 100 It, w= 1 Ib, g= 32.05%, yp ae B= AONE. Then y= (Epona 1 Amplitude is " 2 2n 40v2 Period is == 0.1111 s. Ry His] ). 10851 = Owhenever Sead tnk ort ins{ +24 (i°$4) in( Zone] =0.5 meters per second =05 =05 4. flol= (5) so k= 301b/R, w= 201, g= 321082, yp =I A vy =2 fs, B= 4N3 Then y= C,cos(4v3t) + C2 sin(4V34). etn en satisfies the itil conditions. 7p sit 8, 6-032 £? 48? <0, so there is damped motion. Roots of auxiliary equation are approximately ~0.16 + 8 =e 16'(C; costr+ Cy sin 8). y= e°1 (cos8r + 0,02sin8r) satisfies the initial conditions. 6. Feaaiom;y= 101 =I Rig 4 shin GED 5 5 OD rng 2-40" 0, so camped notin 828 Section 18.3 Instructor's Resource Manual Roots of auxiliary equation are General solution is y= e"6*"(C, cos4.81 + Cy sin 4.8) y= eF4 (4.8C; sin 4.814 4.8Cz cos4.81)— 6.42" (C; cos 4.81 +; sin 4.81) Itr= 1 70, en 16 and 0 4865-646; 0 G <1 and y= rete yf ontts(S}ne] 1 Original amplitude is 1 A. Considering the contribution of the sine term to be negligible due to the 0.02 coefficient, the amplitude is approximately e-®', e-16' 0,1 iff = 14.39, so amplitude will be about one-tenth of original in about 14.4 s. 9.105, so y =e"! (cos +0.105sin), & C=land C= 9. Lot rRo+2= E09; 108g s10%9=% O+O=10 Integrating factor: e D{Qe']=10°*e': Qe! = 10°%e' +c; O=10%+Ce" 1f1= 0,0: Therefore, O(t 0-F(1-e"'), =10°, so Ql) = 10% + (4-10°%)e, 10, Same as Problem 9, except C Then J(1)=Q'(): (4-10°S)e. e . n 2120sin37% Roy a. (0) = 0.00024 sin 371 b. 1) =O) =0.09048c0s37% 12, 1o'+rg'+2=£; 10729742. =20, 9" +1099 = 2000 c io? 09, ‘The auxiliary equation, 7? +10? =0, has roots +1 2, =C,c0s10"!71+ Cy sino"? Qp = 2000(10°°) = 2(10%) is a particular solution (by inspection). General solution: Q(t) = 2(10°*)+C, cost0"!?1 + Cy sin10%/21 Then 1) = O'(0) = -10°2, sin 10/71 + 10!2C3 c0510””7, If1=0,Q=0,1=0, hen 0=2(10)+G, and 0= Cp. ‘Therefore, 1(¢) = -10"7(-2[10°S})sin10"/71 = 2(107/?)sin 10°”, 13, 3.50"+10009+—2-—=120sin377" a0) (Values are approximated to 6 significant figures for the remainder of the problem.) Instructor's Resource Manual Section 18.3 829 Q" + 285.7140! +1428570 = 34.28575in377¢ Roots of the auxiliary equation are 142.857 + 349.9271. Oy = e285 (C; c05349.9271 + Cy sin 349.9270) Qp = ~3.18288(10~)c0s3774-+2,15119(10)sin377% .18288(10"4) 08 3774 + 2.15119(10) sin3 77+ Qh. 1 =Q' =0.119995sin3771 + 0.000810998.cos3771+ Qj, 0.000888 cos 3771 is small and Qj —r 0 as ¢ ><, so the steady-state current is / = .12sin 3771 14, a, Roots of the auxiliary equation are Bi. Yh =O, 005 Bt-+ Cy sin Br. Yp=| poe fain ae 4 [wa] “The desired result follows. b yp=(-G ema : ~(£)roos. @s 2, . Due to the f factor in the last term, it aoe toes increases without bound. Pde ‘ #e 18. Asin(fr-+y) = Alsin Broosy +c0s Brsiny) Therefore, mL = mgsind. (Acos y)sin Bt-+ (Asin y)e0s ft we =C;sin Bt-+ C2 cos Bt, where Cy = Acosy and Hence, —S ~ fina. = Asiny. Ch [Note that 18, a, Since the roots of the auxiliary equation are CRC} = AP cos? y+ Asi 2) F 2. tne station of 6 wool Je- ois 2n 16, ‘The first two terms have period = and the last rns ae cyanffecyon sient has period 2%. Then the sum of the three terms 4 wetenas 0=C fe) is periodic if m{ 2 |= n( 2) for some integers e : B) eB os (by Problem 15). ‘The ee of this function is 5 oem m,n equivalently, if 5 =, a rational number. ne ic wfE ne 17, The magnitudes ofthe tangential components of the forees acting on the pendulum bob must be 2a Rv equal. Therefore, PL =e, 2 tmnje Bh 830 Section 18.3 Instructor's Resource Manual b. Tokeep perfect ime at both places, require R805 = pp. Then 1= 2, so. We ‘396081 Ry = 3963.67 The height of the mountain is about 3963.67 -3960 =3.67 mi (about 19,387 f 18.4 Chapter Re Concepts Test 1. False: y? is not linear iny. 2. True: and y” arelinear in y and y" respectively. 3. Tre: y'=sec? xtsecxtanx 2y'—y? = (2sec? x + 2secxtan.x) tan? x+2see xtan.x+sec? x) = sec? x-tan? x=1 4. False: It should involve 6. 5. True: D? adheres to the conditions for linear operators. Daf) =D) DUsta)=Ds+Ds 6, False: Replacing yby C(x) +Cup() would yield, on the left side, GS) + CS) = (G+) which is fl) only if C, +C, =1 or fa)=0. 7. Tre: -1 isa repeated root, with multiplicity 3, of the auxiliary equation, E(u —up) = L(u)~ L(u) = fx) f(a) =0 9. False: Thatis the form of yy. 9p should have the form Bx cos 3x + Cx sin 3x. 10. True: See Problem 15, Section 18.3. Sample Test Problems e*. Integrating factor is ae Instructor's Resource Manual 2. Roots are 1, 1. y= Ce* + Cet 3. (Second order homogeneous) The auxiliary equation, 7? ~3r + ), has roots 1.2. The general solution is y = Cye™ + Cye®# 326,420, 0 G Therefore, C+ Cpxje"2 S. yy = Cie +Ce* (Problem 2) Jp Hl Get +Cqe? 6, (Second-order nonhomogeneous) The auxiliary equation, 7? + 4r-+4 -2,-2 a= Ce + Cyxe = (6, +Cyx)e™ Let yp = Be: yy = Bes) = Bet , has roots (Be*)+4(Be*)+ 4(Be*)=3e¥, so B General solution: y = 4 (C, +Cyx)e"™* 3 (C +Cpx)e™* (Problem 12) 1) 2-2 vo-(s}P6 r-f(Qe reece Section 18.4 831 10. nL 12, 1B. 4 932 1. Roots are #21 y= C;cos2x+Cy sin2x = sin 2x satisfies the conditions. (Second-order homogeneous) The auxiliary equation, r? +6r4+25 =0, has roots -3 4 4i. General solution: = €*(Gcos4x+C, sind) Roots ate 44, yy = C,cosx+C) sinx Ye y= xeosz~sinxInfoos+C, c08x+ C,sinx (combining the sine terms) cosx-sin x+sin zinfoos| Roots are~4,0,2. y= Cie + Cy + Cye* (Fourth order homogeneous) ‘The auxiliary equation, r# ~37? 10 (7-542 +2)=0, tas rots V5, 3, 2VEi General station: 9 = G0 + CyeVS +5 cos VIx+ C4 sin Vix Repeated roots 43 VHC + Cx) + (C+ C0 a O'()=3-0.029 b. O()+0029=3 Integrating factor is DIO) = 360 Section 18.4 (0) = 150+ ce Q(#) =150~30e" goes through (0, 120). & Q150 gastro, 15. (Simple harmonic motion) k 10: yo =I (92, 10 ‘Then the equation of motion is y= cos 4 4 " mee The ample i [=r the period is 2E=Z, lines =: the periods 22 16, iis at equlbviom when y= 0 -on4t=0, oF x 3 88 ¥'(O=4sin4t, 50 at equilibrium [y|=24] = 4. 17, Q420'+20=1 Roots are -I +i, = “"(C,cos¢+Cy sins) and Op Q=e"(C, cost +; sint+3 1=20 1 eC, =Ca)c0s-+(G +Cp)sine] sins satisfies the initial conditions. Instructor's Resource Manual Maple and Mathematica Code for some Technology Projects Technology Project 12.1 Rotations in the Plane Maple: with(plots) : £ = (x,y) ~>x72 + Qdexay + Bey72 - 136; implicitplot (f(x,y) = 0,x=-16..16,y=-16. .16); Mathematica: <[ recos(theta) , rssin(theta) ] 49 degr := 2#Pi/360: rose := k ->evalf( rect( kedegr , sin(nekedegr) ) ): path := [ seq ( rose(d¥k) , ke1..360) ]: PLOT( CURVES(path) ); Mathematica: rect [theta.,r] := N{{r Cos(theta],r Sin(theta] }] Attributes [rose]={Listable} n= 5; d= 13; rose[k-] = rect{k Degree,Sin{n k Degree] ]; path = Line[ rose{Range[0,360 d,d]] ]; Show (Graphics [{Thickness[.0005] ,path}] ,AspectRatio->1] Technology Project 13.2 Measuring Home Run Distance Instructor's Resource Manual ‘Technology Projects Sample Code 833 phi := 30+degr: theta := arctan( tan(phi) + 2(h-g)/d ); vO := evalf( sqrt( 32*d / ((cos(theta))“2+(tan(phi)tan(theta))) ) + y i= x ->-16#x"2/(vO"2 * (cos(theta))“2) + (tan(theta))#x + gi plot(y(x), x=0..d, scaling=constrained); HRdist evalf( (-- tan(theta) - sqrt( (tan(theta))"2 + 64*g/(v0"2 * (cos(theta))“2) )) / (-32/(v0"2 * (cos(theta))~2)) ); Technology Project 15.1 Newton's Method for Two Equations in Two Unknowns Maple: = (x,y) ->x72 + y72 - 48: (xy) ->x ty - 6 vunapply (aiff (f(x,y), , (r,y)): unapply (diff (f(x,y), (x,y)): unapply (diff (g(x,y) ,x) , (x,y)): unapply (diff (g(x,y) ,y), Gr,y)): 2: yl := 0.8: for n from 1 to 5 do x2 i= xt - ( £(xt,yt)edgy(xt,y1) - g(x1,y1)*dfy(xtyt) ) / ( dfx(xt,y1)*dgy(x1,y1) ~ dgx(xi,yt)edfy(xt,yt) st y2 = yt - ( g(xt,yl)adex(xt,y1) - £(x1,y1)*dgx(xtyt) ) / ( dfx(xt,y1)*dgy(x1,y1) - dgx(xt,yt)edfy(xt,y1) ): x1 t= x2: x72 +y72 - 48; xty- 6 dfx(x.,y] = DLflx,y).x; aty(x.,y] = DLflx,yl.yl; agx[x.,y-] = D(glx,y] x]; dgy(x_,y-] = D(glx.y].y]; xt yi = 0.55 Dol x2 = xt - ( £{x1,yi] dgy(xt,y1] - glxt,yi) dty(xt,yi] ) / (dfx (xt,y1) dgy(xt,yt] - dgx[xt,yt] dfy[xt,y1] ); y2 = yi - ( glxi,yi] dfx(x1,y1] - f(x1,yt) dgx(xt,y1] ) / (Cdtx[xt,yt) dgy(xt,yi] - dgx(xt,yt) dty(xt.y1] ); xi = 834 Technology Projects Sample Code Instructor's Resource Manual Print[x2,’? *?,y21, {a,1,7} 1 Technology Project 15.2 Visualizing the Directional Derivative Maple with(plots): £ r= (xy) ->aex + dey + 4: theta := -70: phi := 3: A: yO i= nt: 0.2: t ->(£(x0texcos(t) ,yOresin(t))-£(x0,y0)) / e: t ->f(x0+excos(t) ,yOrewsin(t)) pi := plotad( f(x,y) , x=-2..2 , y=-2..2, axes=frame , color=grey , orientation=(theta,phi] ): p2 spacecurve( {[x0+e*cos(t),yOte*sin(t) , h(t)]} , t=0..2*Pi , axes-FRAME , thickness=2 , color=black , orientation=[theta,phi]): p3 := contourplot( f(x,y) , x=-2..2, y=-2..2, grid=(21,21) , color=black , scaling=constrained , contours=20 ): pa := plot( [ (xO+e*cos(t) yOressin(t)) , 24Pi) , scaling=constrained , color=black , thickness=2 ): display([p1,p2]); display([p3,p4]); plot( h(t) , t=0..2*Pi ); plot( a(t) , t-0..2*Pi ); evalf( int(a(t),t-0..2*Pi) ); Mathematica fixy] =3x+4y+4; eT ( £[x0+exCos[t] yOre+Sin[t}] - £[x0,y0] ) / @; h(t_] = £[x0+esCos[t] ,yOre*Sin(t]]; pi = PlotaD( flx,y] , {x,-2,2} , {y-2,2} , AxesLabel->{7’x",y7?,72} , Boxed->True , ViewPoint ->{5, -15, 8} , DisplayFunction->Identity ]; p2 = ParametricPlotD[ {xO+e*Cos[t] , yOresSin[t] , h[t]} , {t,0,2Pi} , DisplayFunction->Identity J; p3 = ContourPlot{ f{x,y] , {x,-2,2} , {y,-2,2} , PlotPoints->21 , ContourShading->False , DisplayFunction->Identity ]; p4 = ParanetricPlot( {xO+te+Cos[t] , yOresSin(t]} , {t,0,2Pi} , DisplayFunction->Identity ]; Showl {p1,p2} , DisplayFunction->SDisplayFunction ]; Showl {p3,p4} , DisplayFunction->$DisplayFunction] ; Instructor's Resource Manual ‘Technology Projects Sample Code 835 Plot b{t] , {t,0,2Pi} J; Protl alt] , {t,0,2Pi} Ji NIntegrate[ alt] , {t,0,2Pi} ] Technology Project 16.2 Monte Carlo Integration Mathematica: fx] (i-x) (Sin[100 x (1-x)])°2 xmin = 0; xmax = 1; ymin = 0; ymax = 0.25; numtrials = 1000; pi := Plot[f [x], {x,0,1},PlotStyle->Thickness [0.012] , DisplayFunction->Identity] x = Table[ Randon(Real, {xmin,xmax}), {numtrials} ]; y = Table[ Randon(Real, {ymin, ymax}], {numtrials} ]; data = Transposel{x,y}]; p2 := ListPlot[data,PlotStyle->PointSize(0.012], DisplayFunction->Identity] ; Show [p1, p2,DisplayFunction->$DisplayFunction] numsuce = 0; DolIfC yf(k)] <£(x((k]]] ,numsucc=numsuccti) , {k,1,numtrials}] areaestimate = (xmax-xmin) (ymax-ymin)nunsucc/numtrials; Print[ areaestimate ] Maple with(plots): with (stats) with(linalg): ft x ->x*(1-x)#sin(100*x*(1-x))"2: xmin ymin nuntrials := 1000: pl := plot( £(x) , xsxmin..xmax , randomize (Seed) ; ( stats[random, uniform] (numtrials) ]: ( stats(random, uniform] (numtrials) [seq(xmin,i=1..oumtrials)) + (xmax-xmin)*xx: {seq(ymin,i=1..qumtrials)] + (ymax-ymin)+yy: p2 := pointplot( transpose( (xx,yy] ) ): display( Cpt. p21); numsuce for 1 fron 1 to uumtsials do 836 Technology Projects Sample Code Instructor's Resource Manual numsucc+1 fi: if yyli] s1 ] Instructor's Resource Manual ‘Technology Projects Sample Code 837

You might also like