fsolvecosx0 x pi2pi x 4712388980 in some

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x = −0.2467292569 + 1.320816347 I }, {x = −1.423605849}, {x = −0.2467292569 − 1.320816347 I }, {x = 0.9585321812 − 0.4984277790 I } A general expression for the roots of degree five polynomials in terms of radicals does not exist. 54 • Chapter 3: Finding Solutions 3.2 Solving Numerically Using the fsolve Command The fsolve command is the numeric equivalent of solve. The fsolve command finds the roots of the equation(s) by using a variation of Newton’s method, producing approximate (floating-point) solutions. > fsolve({cos(x)-x = 0}, {x}); {x = 0.7390851332} For a general equation, fsolve searches for a single real root. For a polynomial, however, it searches for all real roots. > poly :=3*x^4 - 16*x^3 - 3*x^2 + 13*x + 16; poly := 3 x4 − 16 x3 − 3 x2 + 13 x + 16 > fsolve({poly},{x}); {x = 1.324717957}, {x = 5.333333333} To search for more than one root of a general equation, use the avoid option. > fsolve({sin(x)=0}, {x}); {x = 0.} > fsolve({sin(x)=0}, {x}, avoid={x=0}); {x = −3.141592654} To find a specified number of roots in a polynomial, use the maxsols option. > fsolve({poly}, {x}, maxsols=1); {x = 1.324717957} By using the complex option, Maple searches for complex roots in addition to real roots. 3.2 Solving Numerically Using the fsolve Command > fsolve({poly}, {x}, complex); • 55 {x = −0.6623589786 − 0.5622795121 I }, {x = −0.6623589786 + 0.5622795121 I }, {x = 1.324717957}, {x = 5.333333333} You can also specify a range in which to look for a root. > fsolve({cos(x)=0}, {x}, Pi..2*Pi); {x = 4.712388980} In some cases, fsolve may fail to find a root even if one exists. In these cases, specify a range. To increase the accuracy of the solutions, increase the value of the special variable, Digits. Note that in the following example the solution is not guaranteed to be accurate to thirty digits, but rather, Maple performs all steps in the solution to at least thirty significant digits rather than the default of ten. > Digits := 30; Digits := 30 > fsolve({cos(x)=0}, {x}); {x = 1.57079632679489661923132169164} Limitations on solve The solve command cannot solve all problems. Maple has an algorithmic approach, and it cannot necessarily use the shortcuts that you might use when solving the problem by hand. • Mathematically, polynomials of degree five or higher do not have a solution in terms of radicals. Maple attempts to solve them, but you may need to use a numerical solution. • Solving trigonometric equations can also be difficult. In fact, working with any transcendental equation is quite difficult. > solve({sin(x)=0}, {x}); 56 • Chapter 3: Finding Solutions {x = 0} Note: Maple returns only one of an infinite number of solutions. However, if you set the environment variable _EnvAllSolutions to true, Maple returns the entire set of solutions. > _EnvAllSolutions := true; _EnvAllSolutions := true > solve({sin(x)=0}, {x}); {x = π _Z1 ~} The prefix _Z on the variable indicates that it has integer values. The tilde (~) indicates that there is...
View Full Document

Ask a homework question - tutors are online