<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="1"/><View-Properties><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="left" name="Input"/><Layout alignment="left" name="Text"/><Layout alignment="left" bullet="none" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 2" rightmargin="0.0" spaceabove="8.0" spacebelow="2.0"/><Layout alignment="left" bullet="none" linespacing="0.0" name="Heading 1" spaceabove="8.0" spacebelow="4.0"/><Layout alignment="left" bullet="none" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" name="Section" spaceabove="16.0" spacebelow="9.0"/><Layout alignment="left" name="Title"/><Layout alignment="left" name="Subsection" spaceabove="13.0" spacebelow="7.0"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Maple Input" opaque="false" size="12"/><Font background="[0,0,0]" family="Times New Roman" name="Text" size="12"/><Font background="[0,0,0]" bold="true" family="Arial" name="Section" size="16"/><Font background="[0,0,0]" bold="true" family="Serif" name="Heading 2" opaque="false" size="16"/><Font background="[0,0,0]" bold="true" family="Serif" name="Heading 1" opaque="false" size="18"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Input" size="12"/><Font background="[0,0,0]" family="Arial" name="Title" size="36"/><Font background="[0,0,0]" bold="true" family="Arial" name="Subsection" size="14"/></Styles><Text-field spacebelow="15.0"><Font background="[0,0,0]" family="Times New Roman"> </Font></Text-field><Group><Text-field layout="Title" style="Title">Chapter 3</Text-field></Group><Text-field spacebelow="1.0"><Font background="[0,0,0]" family="Times New Roman" size="9"> </Font></Text-field><Section><Title><Text-field layout="Section" style="Section">Mathematica code for exercise in section 3.3</Text-field></Title><Section><Title><Text-field layout="Subsection" style="Subsection">22.</Text-field></Title><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">f := (n, x) -&gt; (ln(x+2)-x^(2*n)*sin(x))/(1+x^(2*n)) ;</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">plot(f(2,x),x=0..1/2*Pi);</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">plot(f(5,x),x=0..1/2*Pi);</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">plot(f(10,x),x=0..1/2*Pi);</Text-field></Input></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">plot(f(20,x),x=0..1/2*Pi);</Text-field></Input></Group><Group><Text-field layout="Text" style="Text">The command fsolve(f(x) = 0, x = a); finds a root of f near x=a.</Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">fsolve(f(2,x)=0,x=1);</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">fsolve(f(5,x)=0,x=1);</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">fsolve(f(10,x)=0,x=1);</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">fsolve(f(20,x)=0,x=1);</Text-field></Input></Group></Section></Section><Section><Title><Text-field layout="Heading 1" style="Heading 1">Mathematica code for exercises in section 3.4</Text-field></Title><Section><Title><Text-field layout="Heading 2" style="Heading 2">15.</Text-field></Title><Group><Text-field layout="Text" style="Text">How are these solutions related to the value of x?</Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">fsolve(sin(1) = sin(1/c) - 1/c * cos(1/c));</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">fsolve(sin(1/3) = sin(1/c) - 1/c * cos(1/c));</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">fsolve(sin(0.01) = sin(1/c) - 1/c * cos(1/c));</Text-field></Input></Group></Section><Section><Title><Text-field layout="Subsection" style="Subsection">21.</Text-field></Title><Group><Text-field layout="Text" style="Text">The numpoints command gives somewhat greater detail in the plot. What parts of this graph might warrant studying in closer detail?</Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">plot(x/(1+x*sin(1/x)),x = 0 .. 1,numpoints = 500);</Text-field></Input></Group><Group><Text-field layout="Text" style="Text">Enter the following command to define a new function, F, that is the derivative of the given function.</Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">F := y -&gt; eval(diff(x/(1+x*sin(1/x)),x),x = y);</Text-field></Input></Group><Group><Text-field layout="Text" style="Text">You can now draw the graph of F.</Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">plot(F(y),y = 0 .. 1);</Text-field></Input></Group></Section></Section><Section><Title><Text-field layout="Heading 1" style="Heading 1"><Font encoding="UTF-8">Mathematica code for exercises in Newton\342\200\223Raphson Method</Font></Text-field></Title><Section><Title><Text-field layout="Heading 2" style="Heading 2"><Font executable="false">2.</Font></Text-field></Title><Group><Text-field layout="Text" style="Text"><Font executable="false">If you define f(x), specify an initial value for x, and then define the command nr as given below,  then each time you enter nr, Maple will perform another iteration of the Newton--Raphson method. To change the intial value of x, you need only define the new value.</Font></Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">f := x -&gt; x^3 - 4*x^2 - x + 2;</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">x:= 4; for n from 1 to 10 do x := evalf(x - f(x)/D(f)(x),12) end do;</Text-field></Input></Group></Section><Section><Title><Text-field layout="Heading 2" style="Heading 2">3.</Text-field></Title><Group><Text-field layout="Text" style="Text"><Font encoding="UTF-8" executable="false">The following command will iterate Newton\342\200\223Raphson for each of the starting points.</Font></Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">f := x -&gt; sin(x) - x/2;</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">x:=0.84; for n from 1 to 10 do x := evalf(x - f(x)/D(f)(x),12) end do;</Text-field></Input></Group></Section><Section><Title><Text-field layout="Heading 2" style="Heading 2">4.</Text-field></Title><Group><Text-field layout="Text" style="Text"><Font encoding="UTF-8">The letter I designates the squareroot of \342\200\2231</Font></Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">f := x -&gt; sin(x) - x/2;</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">x:=0.84+0.1*I; for n from 1 to 10 do x := evalf(x - f(x)/D(f)(x),12) end do;</Text-field></Input></Group></Section><Section><Title><Text-field layout="Subsection" style="Subsection">9.</Text-field></Title><Group><Text-field layout="Text" style="Text"><Font encoding="UTF-8">Find the range of values of x at which there could be a root. Use a plot command to find approximate values of these roots. Then use Newton\342\200\223Raphson to find roots to 10-digit accuracy.</Font></Text-field></Group><Group><Input><Text-field layout="Input" prompt="&gt; " style="Input">f := cos(3*x)-x;</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">x:= 4; for n from 1 to 10 do x := evalf(x - f(x)/D(f)(x),12) end do;</Text-field></Input></Group></Section></Section><Text-field/><Text-field/></Worksheet>
