a) Find the number of solutions of the equation sin(x)=x/573204.
b) Find the approximate difference between the two largest solutions.
Let's start with the solutions where x>=0.
573,204/(2*pi) ~= 91,228.25000004677, so when x/573,204 reaches a value of 1, the sine function has gone through just over 91,228.25 cycles. Through each cycle, including that just-bigger-than-a-quarter-cycle, there are two points where the sine curve intersects the straight line, so this accounts for 91,229 * 2 = 182,458 solutions.
Both functions are odd, so there are just as many solutions with x<=0, but one of the solutions is in fact at x=0, common to both sets, so there are 182,458 + 182,457 = 364,915 solutions altogether
The following program first brackets 91228*2*pi and 91228.25*2*pi to find the next-to-last solution, by doing a binary search, and then does the same between 91228.25*2*pi and 91228.251*2*pi to find the last solution. One solution is then subtracted from the other.
5 point 10
15 print Number
30 while High>Low and abs(Diff)>0
60 if Diff>0 then High=Avg
70 if Diff<0 then Low=Avg
130 while High>Low and abs(Diff)>0
160 if Diff<0 then High=Avg
170 if Diff>0 then Low=Avg
200 print Sol1:print Sol2:print Diff:print Sol2-Sol1
where the first line indicates how many cycles it takes for the linear function to reach 1, the second line is the penultimate solution, the third line is the last solution, the zero confirms a solution really was found, and the last line shows the difference between the two largest solutions.
I would not trust the last few digits, due to rounding of the narrow-gapped functions, so I've bolded some trustworthy parts above. So the part b answer would be 0.000004034345991551110231073294395365353.
Posted by Charlie
on 2007-01-31 11:26:34