LearningGuide

# fsolvecosx0 x pi2pi x 4712388980 in some

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

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 ﬁve 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 ﬁnds the roots of the equation(s) by using a variation of Newton’s method, producing approximate (ﬂoating-point) solutions. &gt; 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. &gt; poly :=3*x^4 - 16*x^3 - 3*x^2 + 13*x + 16; poly := 3 x4 − 16 x3 − 3 x2 + 13 x + 16 &gt; fsolve({poly},{x}); {x = 1.324717957}, {x = 5.333333333} To search for more than one root of a general equation, use the avoid option. &gt; fsolve({sin(x)=0}, {x}); {x = 0.} &gt; fsolve({sin(x)=0}, {x}, avoid={x=0}); {x = −3.141592654} To ﬁnd a speciﬁed number of roots in a polynomial, use the maxsols option. &gt; 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 &gt; 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. &gt; fsolve({cos(x)=0}, {x}, Pi..2*Pi); {x = 4.712388980} In some cases, fsolve may fail to ﬁnd 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 signiﬁcant digits rather than the default of ten. &gt; Digits := 30; Digits := 30 &gt; 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 ﬁve 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 diﬃcult. In fact, working with any transcendental equation is quite diﬃcult. &gt; solve({sin(x)=0}, {x}); 56 • Chapter 3: Finding Solutions {x = 0} Note: Maple returns only one of an inﬁnite number of solutions. However, if you set the environment variable _EnvAllSolutions to true, Maple returns the entire set of solutions. &gt; _EnvAllSolutions := true; _EnvAllSolutions := true &gt; solve({sin(x)=0}, {x}); {x = π _Z1 ~} The preﬁx _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