355w2003_lab06 - MLC Lab Visit Lab 06 Maple Mth 355(a.k.a...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
MLC Lab Visit - Lab 06 - Maple Mth 355 (a.k.a. Mth 399) Feb 12, 2003 Maple 7 Bent E. Petersen [email protected] There are 3 problems below. Problem solutions are due Feb 19, 2003. Email your solutions to me as Maple worksheet attachments. Your worksheet must execute correctly for full credit. In this week’s lab we investigate a few randomly chosen features of Maple. Partial Fractions > restart; Partial fraction decomposition in Maple is carried out with the convert() command. > f:=(3*x^2-2*x+7)/( (x^2+1)*(x-3)^3*(x^2+x-1) ); := f + 3 x 2 2 x 7 () + x 2 1( ) x 3 3 + x 2 x 1 > convert(f,parfrac,x); + + 14 55 1 x 3 3 512 3025 1 x 3 2 30197 332750 x 3 1 250 + 91 3 x + x 2 1 5 1331 + 75 38 x + x 2 x 1 Note since all the coefficients here are rational, Maple attempts the expansion over the rational numbers. This is the reason the last term is not what you were led to expect in calculus since x^2+x-1 does factor over the rationals. We can force a factorization by telling Maple to use the extension field of the rationals obtained by appending the square root of 5. > convert(f,parfrac,x,sqrt(5)); 2 1331 56 59 5 + + 2 x 1 5 2 1331 + 56 5 + 2 x 1 5 1 250 + 3 x + x 2 1 30197 332750 x 3 512 3025 1 x 3 2 + + 14 55 x 3 3 +
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This expression should agree with what you learned in calculus, but it is inconvenient, and not really general, to have to specifiy the radicals to append. A more general and more convenient procedure is to use RootOf:: > h:=convert(f,parfrac,x,RootOf(x^2+x-1)); h 1 1331 + 151 112 ( ) RootOf + _Z 2 _Z 1 x () RootOf + _Z 2 _Z 1 1 1331 + 39 112 ( ) RootOf + _Z 2 _Z 1 + + x 1( ) RootOf + _Z 2 _Z 1 + := 1 250 + 91 3 x + x 2 1 30197 332750 x 3 512 3025 1 x 3 2 14 55 x 3 3 + + + Cool, but not very familiar. We need to evaluate the RootOf() expressions. This may be done with the allvalues() command, but it will evaluate the full expression for each root (and so give us 2 copies): > allvalues(h); 1 1331 + 56 59 5 + x 1 2 1 2 5 1 1331 56 5 + + x 1 2 1 2 5 1 250 + 3 x + x 2 1 30197 332750 x 3 512 3025 1 x 3 2 + + + 14 55 x 3 3 + 1 1331 95 56 5 + + x 1 2 1 2 5 1 1331 95 56 5 + x 1 2 1 2 5 1 250 + 3 x + x 2 1 30197 332750 x 3 + + + , 512 3025 1 x 3 2 14 55 x 3 3 + As expected we got 2 copies of the answer. Just pick one: > allvalues(h)[1]; 1 1331 + 56 5 + x 1 2 1 2 5 1 1331 56 5 + + x 1 2 1 2 5 1 250 + 3 x + x 2 1 30197 332750 x 3 512 3025 1 x 3 2 + + +
Background image of page 2
14 55 () x 3 3 + We can also request that Maple perform the factorization over the real numbers. In this case Maple will use floating point arithmetic. > convert(f,parfrac,x,real); .02270458805 1 + x 1.618033989 .1654544002 x .6180339887 .2545454546 x 3. 3 .1692561984 x 3. 2 + .09074981217 x 3. + .03599999996 .05200000000 x + x 2 1. + + You can make a rational approximation in the obvious way: > convert(convert(f,parfrac,x,real),rational); 6119 269505 1 + x 28657 17711 2070 12511 1 x 17711 28657 14 55 x 3 3 512 3025 1 x 3 2 27659 304783 x 3 + + + 3599996 99999889 13 250 x + x 2 1 + Let’s look at complex roots: > g:=( (2*x^3-x-1)/((x^2+2*x+5)^2*(x^2-1)) ); := g 2 x 3 x 1 + + x 2 2 x 5 2 x 2 1 > convert(g,parfrac,x); + 1 16 1 + x 1 1 16 + x 1 + + x 2 2 x 5 1 4 − + 17 x + + x 2 2 x 5 2 Exactly what we expected! Of course we may prefer to expand over the complex numbers: > convert(g,parfrac,x,complex);
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
+ .1250000000 .2187500000 I () + x + 1.000000000 2.000000000 I 2 + .03125000000 .06250000000 I + x + 1. 2. I .06250000000 + x 1.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/11/2012 for the course MTH 141, 142, taught by Professor Mcallister during the Spring '08 term at SUNY Empire State.

Page1 / 17

355w2003_lab06 - MLC Lab Visit Lab 06 Maple Mth 355(a.k.a...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online