{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Times" 1 12 0 0 0 1 2 2 2 2 1 2 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 62 "with(Maplets[Elements]): with(Maplets[Tools] ): with(combinat):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "StartEngine() ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "lightorange:=\"#FFB300 \":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "great := [" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "\" Bullseye. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "\" Right on the mark. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "\" Great. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" That's abso lutely right. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "\" Awesome. Yo u're unstoppable. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "\" Correct . \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "\" WOW, nailed that one. \+ \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "\" You got it! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "\" YES! Right on. \"," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 15 "\" Way to go. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "\" Don't stop now. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "\" \+ I knew you could do it! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "\" P erfect. You're unstoppable. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " \" Radical Dude. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "\" Power ho use. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "\" Sweet! Keep on Rocki n'. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "\" You rock! \"," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "\" You got those mad skills. \"," } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "\" Awesome! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" Wowzers! That was great! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "\" Awesome man! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "\" Good job! You really know what you are doing. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "\" You're awesome kid. \"," }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "\" Tearing it up. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "\" Right on the money. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "\" High Five!!!!! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "\" Cool Beans. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "\" Wh at a nerd! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "\" You're so mone y. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "\" You're a genious. \", " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "\" You hit the nail on the head . \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "\" Excellent! \"," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "\" If I had a cookie, I'd give it t o you. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "\" You're a winner. \+ \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "\" That's a winner. \"," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "\" Whoop! Way to go. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "\" That's the way, ah ha ah ha, I like it . \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "\" Oh yeah! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "\" You're the bomb! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "\" That was fantastic! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "\" Oh Snap! \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "\" That's krunk! \"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "]:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "randgreat := rand(1..nops(gr eat)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "nextquest := [" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "\"Keep it up.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "\"Keep going.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\"On to the next function.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "\"Find another partial fraction expansion.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "\"Find another partial fraction decomposition.\", " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\"Expand another function.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\"Decompose another function.\"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "randnext := rand(1..nops(nextquest)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "sorry := [" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" Sorry, that's not right. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" Nope, but don't give up. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "\" Not quite, it's a little off. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "\" Bummer, thought you would get it this time. \+ \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "\" Close, but no cigar. \", " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "\" Slightly off. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "\" If you need help, please ask a human. \+ \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "\" I don't know where you we nt wrong. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\" Sorry, killer p roblem. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "\" No, but don't blo w it off. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "\" D'oh! \"," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "\" That's whack. \"," }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 50 "\" Yikes! Really close. You'll get it next tim e. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "\" Pucha! Thought you wou ld get it this time. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "\" Nice try, but your answer is wrong. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "\" Ask your neighbor for help. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "\" Brutal kid. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "\" Th at won't fly. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" So close an d yet so far. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "\" So, that wa s just practice. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "\" Ooooh... close. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "\" A swing and a miss . \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\" Better luck next time. \+ \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "\" Oops. \"," }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 "\" Tilt. Play again. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "\" I know you can do better. \"," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "\" Sorry Charlie. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\" Better luck next time. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "\" Tisk, tisk. It's a tough one. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "\" It takes a lot of wrongs to make a right. \", " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "\" Even Einstein didn't get eve rything right. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "\" Oh man, yo u were so close. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "\" Today's \+ not your lucky day. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" Don't quit your day job. \"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "\" You'r e colder than a polar bear's toenail. \"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "rands orry := rand(1..nops(sorry)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "tryagain := [" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "\"Try the hi nts.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "\"Fix your answer and ch eck it again.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "\"Give it anoth er try.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "\"Try again.\"," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "\"Please try again.\"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "randtry := rand(1..nops(tryagain)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "showit := [" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "\" \+ OK That's just practice. But try doing it yourself.\"," }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 52 "\" That's fine for practice. Try doing it your self.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "\" Think about it and e nter an answer yourself.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "\" N ext time, try the hints.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "\" N ext time, compute an answer yourself.\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "\" So that was practice. Try doing it yourself.\"" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "randshow := rand(1..nops(showit)):" }}}{EXCHG {PARA 0 "> " 0 "" {XPPEDIT 19 1 "" "6#%#%?G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rand13:=rand(1..3):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rand14:=rand(1..4):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rand02 :=rand(0..2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rand03:=rand(0..3) :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "randm22:=rand(-2..2):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "as:=[$-5..5]:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 54 "bs:=[$-5..5]: nbs:=nops(bs): #if completing th e square" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "cs:=[$1..9]: ncs:=nops( cs):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "bcs1:=[seq(seq([b,c],b=bs), c=cs)]: #if completing the square" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "bcs0:=[seq( [0,c], c=cs)]: #if not completing the square" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "ps:=[$0..4]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "qs:=[$0..4]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "F: =(s,t) -> evalb(s[1] " 0 "" {MPLTEXT 1 0 102 "G:=(s,t) -> evalb(s[1] " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 14 "CompSq:=false:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "NewFunc tion:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "global rand03, rand 02, rand13," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "as, CompSq, bcs1, bc s0, ap, bcq, nlin, nquad, decomp, decomp2, Av, Bv, Cv, func;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "local nlinf, nquadf, af, bcf, nterms, tot , pf, qf, i, j, k, n, zeroout, num, den;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "options `Copyright 2005, Philip B. Yasskin, Texas A&M Univ.`;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "nlinf,nquadf := 0,0;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "while nlinf+nquadf<2 or nlinf+nqua df>4 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " nlinf,nquadf := rand03 (), rand02():" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "end do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "af:=randperm(randcomb(as,nlinf));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "#if Get(CBCompSq) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "# CompSq:=true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "# bcf:=randperm(randcomb(bcs1,nquadf));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "#else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " CompSq:= false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " bcf:=randperm(randcomb( bcs0,nquadf));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "#end if;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "nterms:=8;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "while nterms>6 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " tot:= 7:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " while tot>5 do" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 36 " pf:=[seq(rand13(), i=1..nlinf)];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " qf:=[seq(rand13(), j=1..nquadf) ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " tot:=add(pf[i],i=1..nlinf )+add(qf[j],j=1..nquadf);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " end d o;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " ap := [seq( seq( [af[i] ,k], k=1..pf[i]), i=1..nli nf)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " bcq := [seq( seq( [bcf[j ][],k], k=1..qf[j]), j=1..nquadf)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " nlin:=nops(ap);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " nquad:=n ops(bcq);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " decomp:=add( A[i]/(x -ap[i,1])^ap[i,2], i=1..nlin)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 94 " \+ + add( (B[j]*(x-bcq[j,1])+C[j])/( ((x-bcq[j,1])^2 + bcq[j,2]) )^ bcq[j,3], j=1..nquad);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " n:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " for i to nlinf do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " for \+ k to pf[i] do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " n:=n+1;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " if k=pf[i] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " Av[n]:=op(randcomb([-2,-1,1,2], 1)); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 25 " Av[n]:=randm22();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end if;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " \+ end do;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " end do;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " n:=0; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " for j to nquadf do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " for k to qf[j] do" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 13 " n:=n+1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " if k=qf[j] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " B v[n]:=op(randcomb([-2,-1,1,2], 1));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " Cv[n]:=op(randcomb([-2,-1,1,2], 1));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " \+ Bv[n]:=randm22();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " Cv [n]:=randm22();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end if;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " zeroout:=rand13();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " if zeroout=1 then Bv[n]:=0;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " elif zeroout=2 then Cv[n]:=0; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end if;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " end do;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 146 " end do;\n decomp2:=subs(seq(A[i]=Av[i], i=1..nlin), seq(B[j]=B v[j], j=1..nquad), seq(C[k]=Cv[k], k=1..nquad),decomp); #RIGHT HAND SI DE INTEGRAND" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 26 " func:=simplify(decomp2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " num:=sort(expand(numer(func))):" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 19 " den:=denom(func);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " nterms:=nops(num);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " f unc:=num/den; #LEFT HAND SIDE INTEGRAND" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "end do;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "Set('MMLintegral' = MathML[Export](Int(func,x))) :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "Set('Answer' = \"\"):\nSet('re ply' = \"\", reply(background)=white):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Set('MMLAnswer' = \"\"):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " end proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Expand_Integral:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "global decomp2, func;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 129 "Set('MMLintegral' = MathML[Export](Int(func,x)=Int(d ecomp2,x)));\nSet('MMLAnswer' = MathML[Export](Int(decomp2,x)=\"?\")); \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "Type_One:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 146 "Set('HintBox' =\n \"Use the substitution u = x - a.\\n\\nRemember Int(1/u du) = ln(u) + C\\nand Int(1/u^n du) = \+ u^(-n+1)/(-n+1) + C\");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "Type_Two:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 148 "Set('HintBox' =\n \"Use the substitution u = x^2 + c.\\n\\nRemem ber Int(1/u du) = ln(u) + C\\nand Int(1/u^n du) = u^(-n+1)/(-n+1 ) + C\");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "Typ e_Three:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "Set('HintBox' = \n \"Use the trig substitution x = b * tan(theta).\");\nend proc:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "Check_Answer:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "global decomp2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "local us eranswer, check;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 183 "useranswer:=Ma plets:-Tools:-Get('Answer'::algebraic);\ncheck:=normal(simplify(diff(u seranswer,x)-decomp2));\nSet('MMLAnswer'=MathML[Export](Int(decomp2,x) = useranswer)):\nif check=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 " Set('reply' = great[randgreat()], reply(background)=green, 'reply'( foreground) = black);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "else" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 " Set('reply' = sorry[randsorry()], 'reply'(background) = red, 'reply'(foreground) = white);" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 7 "end if;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " end proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "Show_Answer:=p roc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "global decomp2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "options `Copyright 2005, Philip B. Yasski n, Texas A&M Univ.`;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " Set('MMLA nswer'=MathML[Export](Int(decomp2,x)= int(decomp2,x))):" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 139 " Set('Answer'=int(decomp2,x)):\n Set('reply ' = showit[randshow()], reply(background)=lightorange, 'reply'(foregro und) = black): \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "Preview:=proc()" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "global decomp2;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 167 "local useranswer;\noptions `Copyright 2005, Philip B. Yasskin, Texas A&M Univ.`;\n\n useranswer:=Maplets:-Tools:-Get('A nswer'::algebraic, corrections=true, update=true);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 136 " Set('MMLAnswer'=MathML[Export](Int(decomp2,x)= u seranswer)):\n Set('reply' =\"\", reply(background)=white, 'reply'(fo reground) = white):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " end proc: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 85 "ParFracEvalInteg := Maplet(onstartup = RunWind ow(MAIN), Font[helv10](\"helvetica\",10)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "Window[MAIN]( 'title'=\"Partial Fractions: Evaluating the Integral\", 'defaultbutton'='Preview'," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "BoxColumn(halign=none, background=wheat," }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 47 " BoxRow( inset=0, spacing=0, background=whe at," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 99 " Button['Bnew'](\"New Int egral\", 'onclick'=Evaluate(function=NewFunction), background=turquois e)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 89 " CheckBox[CBCompSq](\"Req uire Completing the Square\", background=wheat, visible=false)," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 114 " Button(\"Specify Function\", ' onclick'=Evaluate(function=SpecifyFunction), visible=false, background =turquoise)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " HorizontalGlue( )," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " Button(\"Hints\", 'onclic k'=RunWindow(HINTS), background=wheat)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " Button(\"Quit\",Shutdown(), background=pink)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " )," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 170 " \+ BoxRow(halign=none, background=wheat, inset=0, spacing=0,\n BoxColu mn(halign=none, background=wheat, \n BoxRow( border=true, inset=0 , spacing=0, background=wheat," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 80 " \+ caption=\"Goal: Compute an Integral using a Partial Fraction Ex pansion:\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 98 " MathMLViewer ['MMLintegral'](value=MathML[Export](Int(f(x),x) = \" \"),height=100, \+ width=500)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " )," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " BoxRow( border=false, background=wheat, " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \"Enter the integral:\" ," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " TextField['Answer'](ba ckground=white, width=50)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " ) ," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " BoxRow( border=true, ins et=0, background=wheat," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ caption=\"Preview appears here:\"," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 97 " MathMLViewer['MMLAnswer'](value=MathML[Export](Int(f(x),x) = \" \"), height=150, width=500)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 575 " )\n ),\n BoxColumn(halign=none, background=wheat,\n \+ VerticalGlue(),\n Button['Expand'](\"Expand\", Evaluate(funct ion=Expand_Integral), background=wheat, enabled=true),\n Vertical Glue(),\n Button['Preview'](\"Preview\",Evaluate(function=Preview ), background=wheat, enabled=true),\n VerticalGlue(),\n Butt on['BCheck'](\"Check\", Evaluate(function=Check_Answer), background=wh eat, enabled=true),\n Button['BShow'](\"Show\", Evaluate(function =Show_Answer), background=wheat, enabled=true),\n VerticalGlue() \n )\n ),\n BoxRow( background=wheat," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 116 " HorizontalGlue(),\n TextField['reply'](backgr ound=white, width=50),\n HorizontalGlue(),\n HorizontalGlue()" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " )," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " BoxRow('background'=\"#DDFFFF\", 'inset'=0, 'spacing'=0," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " Label(\"Programmers: Rechard an d Smith\", 'font'=helv10)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " H orizontalGlue()," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " Label(\"Cop yright 2006, D.B. Meade and P.B. Yasskin\", 'font'=helv10)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " HorizontalGlue()," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 45 " Label(\"v. 1.2a Sept 2006\", 'font'=helv10)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " )" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 694 ")),\nWindow[HINTS]( 'title'=\"Hints\",\nBoxColumn(background=wh eat, halign=none,\n BoxRow(background=wheat,\n \"Click on the form of the term:\"\n ),\n BoxRow(background=wheat,\n HorizontalGlue( ),\n Button['Second'](\" . . A\\n---------\\n(x-a)^n\",\n Eval uate(function=Type_One), background=wheat, enabled=true),\n Button[ 'Fourth'](\" . . . B x\\n-------------\\n(x^2+c)^m\",\n Evaluate( function=Type_Two), background=wheat, enabled=true),\n Button['Sixt h'](\" . . . C\\n-------------\\n(x^2+c)^m\",\n Evaluate(function =Type_Three), background=wheat, enabled=true),\n HorizontalGlue()\n ),\n BoxRow(background=wheat,\n TextBox['HintBox'](\"\",backgrou nd=white, height=4,width=50)\n )\n)\n)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "Maplets[Displa y](ParFracEvalInteg);" }}}{EXCHG }{EXCHG }}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }