L2041-02

# L2041-02 - Worksheet 2 Basic Algebra in Maple eval avalf...

This preview shows pages 1–3. Sign up to view the full content.

Worksheet 2: Basic Algebra in Maple eval, avalf, evalc There are standard functions in Maple for evaluating expressions. eval is used to evaluate expressions exactly. evalc is used to evaluate expressions containing complex numbers. evalf is for numerical evaluation. Example: Consider the complex number I^I where I=sqrt(-1). > evalc(I^I); evalf(I^I); eval(I^I); > Exercise: Evaluate the following: int(exp(x^3),x=0. .2); > A := int(exp(x^3),x=0. .2); evalf(%); solve and fsolve Maple can solve for the roots of a polynomial. Example: Find the roots of x^2 + 4x + 5: One may for example factor a quadratic to find its roots: > solve(x^2+4*x+5);

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

View Full Document
Exercise: Find the roots of x^7+x^6+x^2+x+1: > solve(x^7+x^6+x^2+x+1); The output has to be interpreted, but what really happened is that maple failed to find the roots, and instead just noted that there are 7 roots, which it presented as "RoofOf" with an index. Solving a given equation is not automatic. One can save these roots by assigning the output: > Soln := solve(x^7+x^6+x^2+x+1): Then one may examine the roots one at a time as follows: > Soln[1]; Notice that we selected the first root of the polynomial. Can we determine it value?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

L2041-02 - Worksheet 2 Basic Algebra in Maple eval avalf...

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

View Full Document
Ask a homework question - tutors are online